From bf99ae66d14857dfcd97dc6ccb8e82a38d3bd75f Mon Sep 17 00:00:00 2001
From: jiangping <jp@doumee.com>
Date: 星期五, 19 七月 2024 09:05:46 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'
---
wechat_jiaxuan/static/icon/ic_play.png | 0
wechat_jiaxuan/pages/store/staffList.wxml | 33
wechat_jiaxuan/pages/kefu/index.wxml | 4
wechat_staff/pages/promotion/index.js | 14
wechat_staff/pages/login/index.wxml | 19
wechat_staff/pages/index/index.wxss | 17
wechat_jiaxuan/components/disProduct/index.less | 7
wechat_jiaxuan/pages/detailDis/product.wxml | 85 +
wechat_jiaxuan/pages/detailDis/realpic.wxml | 2
wechat_staff/pages/homeId/index.js | 64
wechat_jiaxuan/pages/homeId/index.js | 64
wechat_jiaxuan/pages/store/staff.less | 11
wechat_jiaxuan/pages/kefu/service.js | 74 +
wechat_jiaxuan/components/authCard/authCard.js | 50
wechat_jiaxuan/pages/store/store.wxml | 45
wechat_jiaxuan/pages/store/staffList.js | 24
wechat_jiaxuan/pages/homeId/index.json | 2
wechat_jiaxuan/pages/homeId/index.wxss | 7
wechat_jiaxuan/pages/consult/detail.js | 45
wechat_jiaxuan/pages/productVideo/index.wxss | 18
wechat_jiaxuan/pages/productVideo/index.js | 38
wechat_jiaxuan/pages/detailDis/case.wxml | 2
wechat_jiaxuan/components/disCase/index.wxss | 8
wechat_jiaxuan/static/icon/download.png | 0
wechat_jiaxuan/components/authCard/authCard.wxss | 6
wechat_jiaxuan/pages/consult/detail.json | 5
wechat_jiaxuan/pages/design/design.js | 16
wechat_jiaxuan/pages/store/info.wxml | 41
wechat_jiaxuan/pages/index/index.wxss | 48
wechat_staff/static/icon/home_ic_chanpin@2x 2.png | 0
wechat_jiaxuan/components/disProduct/index.js | 60
wechat_jiaxuan/pages/detailDis/realpic.json | 6
wechat_jiaxuan/pages/store/info.js | 50
wechat_jiaxuan/pages/kefu/service.wxml | 3
wechat_jiaxuan/app.wxss | 14
wechat_jiaxuan/app.json | 6
wechat_jiaxuan/pages/kefu/index.json | 4
wechat_jiaxuan/pages/consult/consult.js | 50
wechat_jiaxuan/pages/design/design.wxml | 4
wechat_jiaxuan/pages/detailDis/realpic.wxss | 27
wechat_jiaxuan/pages/store/staff.wxml | 35
wechat_jiaxuan/pages/store/store.wxss | 7
wechat_jiaxuan/pages/consult/detail.wxss | 28
wechat_jiaxuan/pages/store/staffList.less | 1
wechat_jiaxuan/pages/index/index.js | 160 ++
wechat_jiaxuan/pages/detailDis/product.js | 134 +
wechat_staff/pages/index/index.less | 22
wechat_jiaxuan/pages/consult/consult.less | 17
wechat_jiaxuan/package-lock.json | 32
wechat_staff/pages/work/index.js | 16
wechat_jiaxuan/pages/homeId/index.wxml | 12
wechat_jiaxuan/pages/productVideo/index.wxml | 22
wechat_staff/pages/homeId/index.wxml | 38
wechat_jiaxuan/api/index.js | 175 +++
wechat_staff/static/icon/home_ic_anli@2x 2.png | 0
wechat_jiaxuan/components/authCard/authCard.wxml | 14
wechat_jiaxuan/pages/detailDis/product.less | 83 +
wechat_jiaxuan/package.json | 1
wechat_jiaxuan/pages/detailDis/case.less | 44
wechat_jiaxuan/pages/index/index.wxml | 53
wechat_jiaxuan/pages/userinfo/mysub.wxml | 8
wechat_jiaxuan/components/disProduct/index.wxss | 7
wechat_jiaxuan/pages/store/info.wxss | 17
wechat_staff/static/icon/home_ic_shijing@2x 2.png | 0
wechat_jiaxuan/pages/discover/discover.js | 13
wechat_jiaxuan/pages/userinfo/mysub.js | 19
wechat_jiaxuan/pages/consult/consult.wxss | 18
wechat_staff/project.config.json | 2
wechat_jiaxuan/pages/kefu/service.wxss | 0
wechat_jiaxuan/app.js | 56
wechat_jiaxuan/pages/kefu/service.json | 6
wechat_jiaxuan/pages/store/staff.wxss | 10
wechat_staff/project.private.config.json | 9
wechat_jiaxuan/static/images/mingpian_bg_nianxian.png | 0
wechat_jiaxuan/pages/consult/detail.wxml | 26
wechat_jiaxuan/pages/store/info.json | 3
wechat_staff/pages/login/index.less | 5
wechat_jiaxuan/pages/kefu/index.less | 2
wechat_jiaxuan/pages/store/store.js | 68 +
wechat_staff/pages/homeId/index.json | 2
wechat_jiaxuan/pages/index/index.less | 62
wechat_jiaxuan/pages/detailDis/realpic.less | 30
wechat_jiaxuan/pages/detailDis/case.js | 26
wechat_jiaxuan/project.private.config.json | 13
wechat_jiaxuan/pages/consult/consult.json | 3
wechat_jiaxuan/static/icon/wechat.png | 0
wechat_jiaxuan/components/disCase/index.less | 8
wechat_jiaxuan/pages/store/staff.js | 17
wechat_jiaxuan/utils/request.js | 2
wechat_staff/api/index.js | 66 +
wechat_jiaxuan/components/disProduct/index.wxml | 62
wechat_jiaxuan/pages/store/staffList.wxss | 1
wechat_jiaxuan/pages/detailDis/product.json | 7
wechat_jiaxuan/pages/detailDis/case.json | 6
wechat_jiaxuan/pages/detailDis/realpic.js | 32
wechat_jiaxuan/pages/consult/consult.wxml | 17
wechat_staff/pages/index/index.wxml | 48
wechat_staff/pages/login/index.wxss | 5
wechat_jiaxuan/pages/homeId/index.less | 5
wechat_jiaxuan/pages/store/info.less | 19
wechat_jiaxuan/pages/productVideo/index.less | 16
wechat_jiaxuan/static/images/mingpian_bg_kehu.png | 0
wechat_jiaxuan/pages/store/store.less | 7
wechat_jiaxuan/utils/qqmap-wx-jssdk.min.js | 1
wechat_jiaxuan/pages/detailDis/product.wxss | 70 +
wechat_jiaxuan/components/authCard/authCard.less | 6
wechat_jiaxuan/pages/discover/discover.wxml | 12
wechat_jiaxuan/pages/kefu/index.js | 19
wechat_staff/pages/login/index.js | 99 +
wechat_jiaxuan/pages/auth/auth.js | 1
wechat_staff/static/icon/home_ic_zixun.png | 0
wechat_staff/app.js | 36
wechat_jiaxuan/components/disCase/index.js | 110 +
wechat_jiaxuan/pages/consult/detail.less | 31
wechat_jiaxuan/pages/design/design.json | 2
wechat_jiaxuan/pages/detailDis/case.wxss | 39
wechat_jiaxuan/components/disCase/index.wxml | 111 -
wechat_jiaxuan/pages/store/staffList.json | 3
/dev/null | 0
wechat_staff/pages/index/index.js | 51
wechat_jiaxuan/static/images/mendian_bg.png | 0
wechat_staff/pages/login/index.json | 3
122 files changed, 2,422 insertions(+), 762 deletions(-)
diff --git a/wechat_jiaxuan/api/index.js b/wechat_jiaxuan/api/index.js
index 982312f..8cc744d 100644
--- a/wechat_jiaxuan/api/index.js
+++ b/wechat_jiaxuan/api/index.js
@@ -39,6 +39,65 @@
url: '/web/customer/getMemberInfo',
})
}
+// 棣栭〉 蹇楄瑁呬慨
+export const getZSZXCatalogs = () => {
+ return request({
+ url: '/web/customer/getZSZXCatalogs',
+ method: "POST"
+ })
+}
+// 涓彴鏍囩
+export const getCataLogTagList = (data) => {
+ return request({
+ url: '/web/customer/getCataLogTagList',
+ method: "POST",
+ data
+ })
+}
+// 涓彴 鍒嗙被鏁版嵁
+export const getCatalogList = (data) => {
+ return request({
+ url: '/web/customer/getCatalogList',
+ method: "POST",
+ data
+ })
+}
+// 涓彴 鍒嗙被浜у搧璇︽儏
+export const getProductInfo = (data) => {
+ return request({
+ url: '/web/customer/getProductInfo',
+ data
+ })
+}
+// 涓彴 鍒嗕韩
+export const shareContent = (data) => {
+ return request({
+ url: '/web/customer/shareContent',
+ data
+ })
+}
+// 蹇楄瑁呬慨 鍐呭
+export const pageZSZXContentList = (data) => {
+ return request({
+ url: '/web/customer/getZhongTaiZbDecoPage',
+ method: "POST",
+ data
+ })
+}
+// 棣栭〉 瀹氬埗鏈嶅姟 鍒楄〃
+export const getCustomizedNewsList = (data) => {
+ return request({
+ url: '/web/customer/getCustomizedNewsList',
+ data
+ })
+}
+// 瀹氬埗鏈嶅姟 璇︽儏
+export const getCustomizedNewsDetail = (data) => {
+ return request({
+ url: '/web/customer/getCustomizedNewsDetail',
+ data
+ })
+}
// 鑾峰彇闂ㄥ簵鍒楄〃
export const getShopPage = (data) => {
return request({
@@ -54,6 +113,117 @@
data
})
}
+// 鑾峰彇 瀵艰喘鍒楄〃
+export const myUserPage = (data) => {
+ return request({
+ url: '/web/customer/myUserPage',
+ method: "POST",
+ data
+ })
+}
+// 鑾峰彇 瀵艰喘璇︽儏
+export const usersDetailByIamId = (data) => {
+ return request({
+ url: '/web/customer/usersDetailByIamId',
+ data
+ })
+}
+// 棣栭〉 杞挱 鍒楄〃
+export const getHomeBanner = (data) => {
+ return request({
+ url: '/web/customer/getZhongTaiCarouselImage',
+ method: 'POST',
+ data
+ })
+}
+// 棣栭〉 杞挱 璇︽儏
+export const getHomeBannerDetail = (data) => {
+ return request({
+ url: '/web/customer/getZhongTaiCarouselImageDetail',
+ method: 'POST',
+ data
+ })
+}
+// 鍒嗙被浜у搧 鍒嗛〉鍒楄〃 涓彴
+export const getZhongTaiProductPage = (data) => {
+ return request({
+ url: '/web/customer/getZhongTaiProductPage',
+ method: 'POST',
+ data
+ })
+}
+// 鍒嗙被妗堜緥 鍒嗛〉鍒楄〃 涓彴
+export const getZhongTaiWholecasePage = (data) => {
+ return request({
+ url: '/web/customer/getZhongTaiWholecasePage',
+ method: 'POST',
+ data
+ })
+}
+// 鎴戠殑瀹� 鍒嗛〉鍒楄〃 涓彴
+export const getZhongTaiVideoPage = (data) => {
+ return request({
+ url: '/web/customer/getZhongTaiVideoPage',
+ method: 'POST',
+ data
+ })
+}
+// 浜у搧璧勮 鍒嗛〉鍒楄〃 涓彴
+export const getZhongTaiProductNewsPage = (data) => {
+ return request({
+ url: '/web/customer/getZhongTaiProductNewsPage',
+ method: 'POST',
+ data
+ })
+}
+// 浜у搧璧勮 璇︽儏
+export const getProductNewsInfo = (data) => {
+ return request({
+ url: '/web/customer/getProductNewsInfo',
+ method: 'GET',
+ data
+ })
+}
+// 鎿嶄綔 琛屼负鍐呭
+export const actionDo = (data) => {
+ return request({
+ url: '/web/customer/actionDo',
+ data
+ })
+}
+// 鎴戠殑 棰勭害鍒楄〃
+export const customerLogPage = (data) => {
+ return request({
+ url: '/web/customer/customerLogPage',
+ method: 'POST',
+ data
+ })
+}
+// 鍐呭 鍠滄
+export const likeContent = (data) => {
+ return request({
+ url: '/web/customer/likeContent',
+ method: 'GET',
+ data
+ })
+}
+// 鍐呭 鏀惰棌
+export const collectContent = (data) => {
+ return request({
+ url: '/web/customer/collectContent',
+ method: 'GET',
+ data
+ })
+}
+// 鎴戠殑 鍠滄鍒楄〃
+export const getZhongTaiCusFavorite = (data) => {
+ return request({
+ url: '/web/customer/getZhongTaiCusFavorite',
+ method: 'POST',
+ data
+ })
+}
+
// 鏇存柊浼氬憳淇℃伅
export const editMember = (data) => {
return request({
@@ -89,8 +259,9 @@
// 鑾峰彇鐪佸競鍖�
export const getArea = (data) => {
return request({
- url: '/web/common/getArea',
- data
+ url: '/web/common/getAreaTree',
+ data,
+ method: "POST"
})
}
// 灏忕▼搴忔敞閿�
diff --git a/wechat_jiaxuan/app.js b/wechat_jiaxuan/app.js
index bf87c72..e56016f 100644
--- a/wechat_jiaxuan/app.js
+++ b/wechat_jiaxuan/app.js
@@ -11,37 +11,31 @@
this.globalData.bottomLift = WindowInfo.screenHeight - WindowInfo.safeArea.bottom;
}
//
- const res = wx.getStorageSync('member')
- if (res) {
- this.globalData.userInfo = res
- } else {
- // 鐧诲綍
- wx.login({
- timeout: 5000,
- success(res) {
- if (res.code) {
- //鍙戣捣缃戠粶璇锋眰
- wxLoginCustomer({
- code: res.code
- }).then(res => {
- console.log(res)
- if (res && res.data.member) {
- wx.setStorageSync('member', res.data.member)
- wx.setStorageSync('openid', res.data.member.openid)
- wx.setStorageSync('sessionKey', res.data.sessionKey)
- wx.setStorageSync('token', res.data.token)
- } else {
- console.log('鐧诲綍澶辫触锛�')
- }
- })
- } else {
- console.log('鐧诲綍澶辫触锛�' + res)
- }
- },
- fail(err) {
- console.log(err)
+ wx.login({
+ timeout: 5000,
+ success(res) {
+ if (res.code) {
+ //鍙戣捣缃戠粶璇锋眰
+ wxLoginCustomer({
+ code: res.code
+ }).then(res => {
+ console.log(res)
+ if (res && res.data.member) {
+ wx.setStorageSync('member', res.data.member)
+ wx.setStorageSync('openid', res.data.member.openid)
+ wx.setStorageSync('sessionKey', res.data.sessionKey)
+ wx.setStorageSync('token', res.data.token)
+ } else {
+ console.log('鐧诲綍澶辫触锛�')
+ }
+ })
+ } else {
+ console.log('鐧诲綍澶辫触锛�' + res)
}
- })
- }
+ },
+ fail(err) {
+ console.log(err)
+ }
+ })
}
})
\ No newline at end of file
diff --git a/wechat_jiaxuan/app.json b/wechat_jiaxuan/app.json
index c37523e..8ab36d9 100644
--- a/wechat_jiaxuan/app.json
+++ b/wechat_jiaxuan/app.json
@@ -16,6 +16,7 @@
"pages/productVideo/index",
"pages/homeId/index",
"pages/kefu/index",
+ "pages/kefu/service",
"pages/detailDis/product",
"pages/detailDis/case",
"pages/detailDis/realpic",
@@ -52,7 +53,7 @@
"pagePath": "pages/consult/consult",
"iconPath": "static/tabbar/nav_mendian.png",
"selectedIconPath": "static/tabbar/nav_mendianAc.png",
- "text": "鍜ㄨ"
+ "text": "璧勮"
},
{
"pagePath": "pages/mine/mine",
@@ -71,8 +72,7 @@
},
"requiredPrivateInfos": [
"getLocation",
- "chooseLocation",
- "getFuzzyLocation"
+ "chooseLocation"
],
"permission": {
"scope.userLocation": {
diff --git a/wechat_jiaxuan/app.wxss b/wechat_jiaxuan/app.wxss
index 1325fd3..c534b16 100644
--- a/wechat_jiaxuan/app.wxss
+++ b/wechat_jiaxuan/app.wxss
@@ -65,4 +65,18 @@
.flex-column {
flex-direction: column;
+}
+button {
+ margin: 0;
+ padding: 0;
+ background-color: inherit;
+ position: static;
+}
+
+button:after {
+ content: none;
+}
+
+button::after {
+ border: none;
}
\ No newline at end of file
diff --git a/wechat_jiaxuan/components/authCard/authCard.js b/wechat_jiaxuan/components/authCard/authCard.js
index d44d311..97e2db3 100644
--- a/wechat_jiaxuan/components/authCard/authCard.js
+++ b/wechat_jiaxuan/components/authCard/authCard.js
@@ -1,4 +1,6 @@
-import { getShopPage } from '../../api/index'
+import {
+ getShopPage
+} from '../../api/index'
Component({
/**
* 缁勪欢鐨勫睘鎬у垪琛�
@@ -8,18 +10,52 @@
type: String,
value: '0',
observer(val) {
- if(val === '1'){
- this.getShops()
+ if (val === '1') {
+ let that = this
+ wx.getLocation({
+ type: 'wgs84',
+ success(res) {
+ const latitude = res.latitude
+ const longitude = res.longitude
+ that.getShops(latitude, longitude)
+ }
+ })
+
}
}
},
},
data: {
-
+ shopList: []
},
methods: {
- getShops() {
- getShopPage()
+ getShops(latitude, longitude) {
+ getShopPage({
+ model: {
+ longitude,
+ latitude
+ }
+ }).then(res => {
+ this.setData({
+ shopList: res.data.records
+ })
+ })
+ },
+ shopDetail(e) {
+ const id = e.currentTarget.dataset.id
+ wx.navigateTo({
+ url: `/pages/store/info?id=${id}`,
+ })
+ },
+ jumpStaff() {
+ wx.navigateTo({
+ url: '/pages/store/staffList',
+ })
+ },
+ jumpAuth() {
+ wx.navigateTo({
+ url: '/pages/auth/auth',
+ })
},
jumpStore() {
wx.navigateTo({
@@ -27,4 +63,4 @@
})
}
}
-})
+})
\ No newline at end of file
diff --git a/wechat_jiaxuan/components/authCard/authCard.less b/wechat_jiaxuan/components/authCard/authCard.less
index 81d6107..532c928 100644
--- a/wechat_jiaxuan/components/authCard/authCard.less
+++ b/wechat_jiaxuan/components/authCard/authCard.less
@@ -1,7 +1,8 @@
.container{
- width: 750rpx;
+ width: 670rpx;
+ margin: 0 auto;
background-color: #fff;
- padding: 10rpx 40rpx;
+ padding: 10rpx 10rpx;
}
.wrap1{
display: flex;
@@ -98,6 +99,7 @@
.name{
display: flex;
margin-bottom: 20rpx;
+ font-size: 28rpx;
.icon{
width: 60rpx;
height: 60rpx;
diff --git a/wechat_jiaxuan/components/authCard/authCard.wxml b/wechat_jiaxuan/components/authCard/authCard.wxml
index 5478818..06601ff 100644
--- a/wechat_jiaxuan/components/authCard/authCard.wxml
+++ b/wechat_jiaxuan/components/authCard/authCard.wxml
@@ -8,7 +8,7 @@
<view class="name">AI鎵捐璁�</view>
<view class="desc">浣犺韩杈圭殑鍏ㄥ眿璁捐涓撳</view>
</view>
- <view class="btn">
+ <view class="btn" bindtap="jumpAuth">
<view>鍘�</view>
<view>鐪�</view>
<view>鐪�</view>
@@ -25,22 +25,22 @@
<view class="desc">鎮ㄨ韩杈圭殑鍏ㄥ眿璁捐涓撳锝�</view>
</view>
<image class="right" src="../../static/icon/arrow_right.png" mode="widthFix"></image>
-
</view>
<view class="list">
- <view class="item" wx:for="{{6}}">
+ <view class="item" wx:for="{{shopList}}">
<view class="name">
<view class="icon">
<image src="../../static/icon/mendian_item.png" mode="widthFix"></image>
</view>
- <text>鍚堣偉绾㈡槦鏂板搧鍏�</text>
+ <text>{{ item.name }}</text>
</view>
<view class="addr">
<view class="left">
<image class="icon" src="../../static/icon/location.png" mode="widthFix"></image>
- <text>3.9km</text>
+ <text wx:if="{{ item.distanceStr }}">{{ item.distanceStr }}</text>
+ <text wx:else>--</text>
</view>
- <view class="right">
+ <view class="right" data-id="{{ item.id }}" bindtap="shopDetail">
<text>杩涘叆闂ㄥ簵</text>
<van-icon name="arrow" />
</view>
@@ -49,7 +49,7 @@
</view>
</view>
<!-- 宸叉巿鏉� 宸茬粦瀹� -->
- <view wx:if="{{ type == '2' }}" class="wrap1 wrap3">
+ <view bindtap="jumpStaff" wx:if="{{ type == '2' }}" class="wrap1 wrap3">
<view class="ai df_ct">
<image src="../../static/icon/home_ic_guwen@2x.png" mode="widthFix"></image>
</view>
diff --git a/wechat_jiaxuan/components/authCard/authCard.wxss b/wechat_jiaxuan/components/authCard/authCard.wxss
index c5ef4f9..60a6a1b 100644
--- a/wechat_jiaxuan/components/authCard/authCard.wxss
+++ b/wechat_jiaxuan/components/authCard/authCard.wxss
@@ -1,7 +1,8 @@
.container {
- width: 750rpx;
+ width: 670rpx;
+ margin: 0 auto;
background-color: #fff;
- padding: 10rpx 40rpx;
+ padding: 10rpx 10rpx;
}
.wrap1 {
display: flex;
@@ -98,6 +99,7 @@
.wrap2 .list .item .name {
display: flex;
margin-bottom: 20rpx;
+ font-size: 28rpx;
}
.wrap2 .list .item .name .icon {
width: 60rpx;
diff --git a/wechat_jiaxuan/components/disCase/index.js b/wechat_jiaxuan/components/disCase/index.js
index a76c4eb..1059c35 100644
--- a/wechat_jiaxuan/components/disCase/index.js
+++ b/wechat_jiaxuan/components/disCase/index.js
@@ -1,4 +1,4 @@
-// components/disCase/index.js
+import { getCataLogTagList, getZhongTaiWholecasePage, actionDo } from '../../api/index'
Component({
/**
* 缁勪欢鐨勫睘鎬у垪琛�
@@ -7,18 +7,112 @@
},
data: {
- showParams: false,
- activeStatus: '0'
+ activeIndex: -1,
+ activeParam: [],
+ selParam: '',
+ tagCodes: [],
+
+
+ cateList: [],
+ dataList: [],
+ pageNum: 1,
+ pageSize: 10,
+ search: '',
+ sortType: 'NORMAL',
+ catalogCode: 'whole_case'
+ },
+ attached() {
+ this.getCatelist()
},
methods: {
+ getCatelist(){
+ const { catalogCode } = this.data
+ getCataLogTagList({
+ catalogCode: 'real_case'
+ }).then(res => {
+ if(res.data && res.data.length > 0){
+ this.setData({
+ cateList: res.data
+ })
+ setTimeout(() => {
+ this.getList()
+ }, 300)
+ }
+ })
+ },
+ getList() {
+ const { sortType, search, tagCodes, pageNum, pageSize } = this.data
+ getZhongTaiWholecasePage({
+ catalogCode: 'whole_case',tagCodes,pageNum,pageSize, sortType,search
+ }).then(res => {
+ this.setData({ dataList: res.data.records })
+ })
+ },
+ statusChange(e) {
+ const sortType = e.currentTarget.dataset.status
+ this.setData({sortType})
+ this.getList()
+ },
+ handleAction(e){
+ const actionType = e.currentTarget.dataset.code
+ const id = e.currentTarget.dataset.id
+ actionDo({
+ actionType,
+ id
+ }).then(res => {
+ this.getList()
+ })
+ },
handleDetail(e) {
wx.navigateTo({
url: '/pages/detailDis/case',
})
},
- changeShowParams(){
- const showParams = !this.data.showParams
- this.setData({showParams})
+ tagClick(e) {
+ const code = e.currentTarget.dataset.code
+ const paramIndex = e.currentTarget.dataset.index
+ const { cateList, tagCodes, activeParam, activeIndex } = this.data
+ const index = tagCodes.indexOf(code)
+
+ if(index === -1){
+ tagCodes.push(code)
+ cateList[activeIndex].paramIndex = paramIndex
+ cateList[activeIndex].paramName = activeParam[paramIndex].labelValueName
+ }else{
+ tagCodes.splice(index, 1)
+ cateList[activeIndex].paramIndex = -1
+ cateList[activeIndex].paramName = ''
+ }
+ this.setData({ tagCodes, cateList })
+ console.log('tagCodes', tagCodes);
+ },
+ cancelParam() {
+ const { cateList } = this.data
+ cateList.forEach(item => {
+ item.paramIndex = -1
+ item.paramName = ''
+ })
+ this.setData({ tagCodes: [],activeParam: [],cateList,activeIndex: -1 })
+ },
+ bindblur() {
+ this.getList()
+ },
+ subParam() {
+ this.setData({ activeParam: [] })
+ this.getList()
+ },
+ changeShowParams(e){
+ const { cateList } = this.data
+ const activeIndex = e.currentTarget.dataset.index
+ if(activeIndex === this.data.activeIndex){
+ this.setData({ activeIndex: -1, activeParam: [], selParam: '' })
+ }else{
+ this.setData({
+ activeIndex,
+ activeParam: cateList[activeIndex].valueVos
+ })
+ }
+
// this.setData({showTwo: false})
},
changeTwo(){
@@ -26,9 +120,5 @@
this.setData({showTwo})
this.setData({showOne: false})
},
- statusChange(e) {
- const activeStatus = e.currentTarget.dataset.status
- this.setData({activeStatus})
- }
}
})
diff --git a/wechat_jiaxuan/components/disCase/index.less b/wechat_jiaxuan/components/disCase/index.less
index 10e7bfb..0585800 100644
--- a/wechat_jiaxuan/components/disCase/index.less
+++ b/wechat_jiaxuan/components/disCase/index.less
@@ -22,16 +22,20 @@
.main_content {
height: calc(100% - 120rpx);
+ .query_wrap_scroll{
+ width: 670rpx;
+ padding: 0 40rpx;
+ }
.query_wrap {
display: flex;
- padding: 0 16rpx;
.item {
+ margin-right: 36rpx;
height: 88rpx;
display: flex;
+ flex-shrink: 0;
align-items: center;
justify-content: center;
color: #666666;
- flex: 1;
.name {
margin-right: 6rpx;
}
diff --git a/wechat_jiaxuan/components/disCase/index.wxml b/wechat_jiaxuan/components/disCase/index.wxml
index 0e72d83..b11fe30 100644
--- a/wechat_jiaxuan/components/disCase/index.wxml
+++ b/wechat_jiaxuan/components/disCase/index.wxml
@@ -1,115 +1,50 @@
<view class="app">
<view class="search_wrap">
<image src="../../static/icon/ic_search@2x.png" mode="widthFix"></image>
- <input type="text" placeholder="鎼滅储浜у搧鍚嶇О" />
+ <input bindblur="bindblur" model:value="{{ search }}" type="text" placeholder="鎼滅储妗堜緥鍚嶇О" />
</view>
<!-- -->
<view class="main_content">
- <view class="query_wrap">
- <view class="item" bindtap="changeShowParams">
- <view class="name">椋庢牸</view>
- <van-icon name="{{ showParams ? 'arrow-up' : 'arrow-down' }}" />
+ <scroll-view class="query_wrap_scroll" scroll-x>
+ <view class="query_wrap">
+ <view data-index="{{ index }}" wx:for="{{ cateList }}" class="item" bindtap="changeShowParams">
+ <view class="name">{{ item.paramName || item.labelName }}</view>
+ <van-icon name="{{ activeIndex === index ? 'arrow-up' : 'arrow-down' }}" />
+ </view>
</view>
- <view class="item" bindtap="changeShowParams">
- <view class="name">绌洪棿</view>
- <van-icon name="{{ showParams ? 'arrow-up' : 'arrow-down' }}" />
- </view>
- <view class="item" bindtap="changeShowParams">
- <view class="name">闂村悕</view>
- <van-icon name="{{ showParams ? 'arrow-up' : 'arrow-down' }}" />
- </view>
- <view class="item" bindtap="changeShowParams">
- <view class="name">闂寸О</view>
- <van-icon name="{{ showParams ? 'arrow-up' : 'arrow-down' }}" />
- </view>
- <view class="item" bindtap="changeShowParams">
- <view class="name">绌虹О</view>
- <van-icon name="{{ showParams ? 'arrow-up' : 'arrow-down' }}" />
- </view>
- </view>
- <view wx:if="{{ showParams }}" class="query_param">
+ </scroll-view>
+ <!-- param -->
+ <view wx:if="{{ activeParam && activeParam.length > 0 }}" class="query_param">
<view class="list">
- <view class="item active">涓滆姖鐢佃</view>
- <view class="item">涓滆姖鍟婄殑鏃舵拻鐨勪唬鐢佃</view>
- <view class="item">涓滆姖鐢佃</view>
- <view class="item">涓滆姖鐢佃</view>
- <view class="item">涓滆姖鐢佃</view>
+ <view data-index="{{index}}" data-code="{{ item.labelValueCode }}" bindtap="tagClick" wx:for="{{ activeParam }}" class="item {{ cateList[activeIndex].paramIndex === index ? 'active' : '' }}">{{ item.labelValueName }}</view>
</view>
<view class="btns">
- <view class="btn" bindtap="changeShowParams">鍙栨秷</view>
- <view class="btn sub">纭</view>
+ <view class="btn" bindtap="cancelParam">鍙栨秷</view>
+ <view bindtap="subParam" class="btn sub">纭</view>
</view>
</view>
<view class="status">
- <view class="item {{ activeStatus == '0' ? 'active' : '' }}" data-status="0" bindtap="statusChange">榛樿</view>
+ <view class="item {{ sortType == 'NORMAL' ? 'active' : '' }}" data-status="NORMAL" bindtap="statusChange">榛樿</view>
<view class="separate"></view>
- <view class="item {{ activeStatus == '1' ? 'active' : '' }}" data-status="1" bindtap="statusChange">鏈�鐑�</view>
+ <view class="item {{ sortType == 'HOT' ? 'active' : '' }}" data-status="HOT" bindtap="statusChange">鏈�鐑�</view>
<view class="separate"></view>
- <view class="item {{ activeStatus == '2' ? 'active' : '' }}" data-status="2" bindtap="statusChange">鏈�鏂�</view>
+ <view class="item {{ sortType == 'LATEST' ? 'active' : '' }}" data-status="LATEST" bindtap="statusChange">鏈�鏂�</view>
</view>
<!-- goods_list -->
<view class="goods_list">
- <view class="item" bindtap="handleDetail">
+ <view wx:for="{{ dataList }}" class="item" bindtap="handleDetail">
<view class="img_wrap">
- <image src="../../static/icon/test.png" class="img"></image>
+ <image src="{{ item.coverImage }}" class="img"></image>
<image wx:if="{{ false }}" class="new" src="../../static/icon/chanpin_ic_new@2x.png" mode="widthFix"></image>
</view>
<view class="content">
- <view class="name">閽㈢惔鏇查挗鐞存洸閽㈢惔鏇查挗鐞存洸閽㈢惔鏇查挗鐞存洸閽㈢惔鏇查挗鐞存洸</view>
+ <view class="name">{{ item.title }}</view>
<view class="info">
- <image wx:if="{{ false }}" class="icon" src="../../static/icon/detail_nav_collect.png" mode="widthFix"></image>
- <image wx:else="" class="icon" src="../../static/icon/detail_nav_collected.png" mode="widthFix"></image>
- <text class="num {{true ? 'primary' : ''}}">34</text>
+ <image wx:if="{{ !item.isCollection }}" data-code="like" bindtap="handleAction" class="icon" src="../../static/icon/detail_nav_collect.png" mode="widthFix"></image>
+ <image wx:else data-code="like_cancel" bindtap="handleAction" class="icon" src="../../static/icon/detail_nav_collected.png" mode="widthFix"></image>
+ <text class="num {{true ? 'primary' : ''}}">{{ item.collectCount }}</text>
<image class="icon" src="../../static/icon/zixun_ic_liulan.png" mode="widthFix"></image>
- <text>1000</text>
- </view>
- </view>
- </view>
- <view class="item">
- <view class="img_wrap">
- <image src="../../static/icon/test.png" class="img"></image>
- <image wx:if="{{ false }}" class="new" src="../../static/icon/chanpin_ic_new@2x.png" mode="widthFix"></image>
- </view>
- <view class="content">
- <view class="name">閽㈢惔鏇查挗鐞存洸閽㈢惔鏇查挗鐞存洸閽㈢惔鏇查挗鐞存洸閽㈢惔鏇查挗鐞存洸</view>
- <view class="info">
- <image wx:if="{{ false }}" class="icon" src="../../static/icon/detail_nav_collect.png" mode="widthFix"></image>
- <image wx:else="" class="icon" src="../../static/icon/detail_nav_collected.png" mode="widthFix"></image>
- <text class="num {{true ? 'primary' : ''}}">34</text>
- <image class="icon" src="../../static/icon/zixun_ic_liulan.png" mode="widthFix"></image>
- <text>1000</text>
- </view>
- </view>
- </view>
- <view class="item">
- <view class="img_wrap">
- <image src="../../static/icon/test.png" class="img"></image>
- <image wx:if="{{ false }}" class="new" src="../../static/icon/chanpin_ic_new@2x.png" mode="widthFix"></image>
- </view>
- <view class="content">
- <view class="name">閽㈢惔鏇查挗鐞存洸閽㈢惔鏇查挗鐞存洸閽㈢惔鏇查挗鐞存洸閽㈢惔鏇查挗鐞存洸</view>
- <view class="info">
- <image wx:if="{{ false }}" class="icon" src="../../static/icon/detail_nav_collect.png" mode="widthFix"></image>
- <image wx:else="" class="icon" src="../../static/icon/detail_nav_collected.png" mode="widthFix"></image>
- <text class="num {{true ? 'primary' : ''}}">34</text>
- <image class="icon" src="../../static/icon/zixun_ic_liulan.png" mode="widthFix"></image>
- <text>1000</text>
- </view>
- </view>
- </view>
- <view class="item">
- <view class="img_wrap">
- <image src="../../static/icon/test.png" class="img"></image>
- <image wx:if="{{ false }}" class="new" src="../../static/icon/chanpin_ic_new@2x.png" mode="widthFix"></image>
- </view>
- <view class="content">
- <view class="name">閽㈢惔鏇查挗鐞存洸閽㈢惔鏇查挗鐞存洸閽㈢惔鏇查挗鐞存洸閽㈢惔鏇查挗鐞存洸</view>
- <view class="info">
- <image wx:if="{{ false }}" class="icon" src="../../static/icon/detail_nav_collect.png" mode="widthFix"></image>
- <image wx:else="" class="icon" src="../../static/icon/detail_nav_collected.png" mode="widthFix"></image>
- <text class="num {{true ? 'primary' : ''}}">34</text>
- <image class="icon" src="../../static/icon/zixun_ic_liulan.png" mode="widthFix"></image>
- <text>1000</text>
+ <text>{{ item.viewCount }}</text>
</view>
</view>
</view>
diff --git a/wechat_jiaxuan/components/disCase/index.wxss b/wechat_jiaxuan/components/disCase/index.wxss
index 21a13d7..247742c 100644
--- a/wechat_jiaxuan/components/disCase/index.wxss
+++ b/wechat_jiaxuan/components/disCase/index.wxss
@@ -20,17 +20,21 @@
.main_content {
height: calc(100% - 120rpx);
}
+.main_content .query_wrap_scroll {
+ width: 670rpx;
+ padding: 0 40rpx;
+}
.main_content .query_wrap {
display: flex;
- padding: 0 16rpx;
}
.main_content .query_wrap .item {
+ margin-right: 36rpx;
height: 88rpx;
display: flex;
+ flex-shrink: 0;
align-items: center;
justify-content: center;
color: #666666;
- flex: 1;
}
.main_content .query_wrap .item .name {
margin-right: 6rpx;
diff --git a/wechat_jiaxuan/components/disProduct/index.js b/wechat_jiaxuan/components/disProduct/index.js
index ecc66a4..273d6e0 100644
--- a/wechat_jiaxuan/components/disProduct/index.js
+++ b/wechat_jiaxuan/components/disProduct/index.js
@@ -1,4 +1,4 @@
-// components/disProduct/index.js
+import { getCatalogList, getZhongTaiProductPage } from '../../api/index'
Component({
/**
* 缁勪欢鐨勫睘鎬у垪琛�
@@ -13,12 +13,62 @@
data: {
showOne: false,
showTwo: false,
- activeStatus: '0'
+
+ cateList: [],
+ datalist: [],
+ pageNum: 1,
+ pageSize: 10,
+ search: '',
+ sortType: 'NORMAL',
+ catalogCode: ""
+ },
+ attached() {
+ this.getCatelist()
},
methods: {
+ getCatelist(){
+ getCatalogList({
+ catalogCode: 'product_intro'
+ }).then(res => {
+ if(res.data && res.data.length > 0){
+ this.setData({
+ catalogCode: res.data[0].code,
+ cateList: res.data
+ })
+ setTimeout(() => {
+ this.getList()
+ }, 300)
+ }
+ })
+ },
+ bindblur() {
+ this.getList()
+ },
+ getList() {
+ const { catalogCode, pageNum, pageSize, sortType, search } = this.data
+ getZhongTaiProductPage({
+ catalogCode,pageNum,pageSize,sortType,search
+ }).then(res => {
+ this.setData({
+ datalist: [...this.data.datalist, ...res.data.records],
+ total: res.data.total
+ })
+ })
+ },
+ cateClick(e) {
+ const catalogCode = e.currentTarget.dataset.code
+ this.setData({ catalogCode })
+ this.getList()
+ },
+ statusChange(e) {
+ const sortType = e.currentTarget.dataset.status
+ this.setData({sortType})
+ this.getList()
+ },
handleDetail(e) {
+ const id = e.currentTarget.dataset.id
wx.navigateTo({
- url: '/pages/detailDis/product',
+ url: '/pages/detailDis/product?id=' + id,
})
},
changeOne(){
@@ -31,9 +81,5 @@
this.setData({showTwo})
this.setData({showOne: false})
},
- statusChange(e) {
- const activeStatus = e.currentTarget.dataset.status
- this.setData({activeStatus})
- }
}
})
diff --git a/wechat_jiaxuan/components/disProduct/index.less b/wechat_jiaxuan/components/disProduct/index.less
index e3a87fb..de08cd3 100644
--- a/wechat_jiaxuan/components/disProduct/index.less
+++ b/wechat_jiaxuan/components/disProduct/index.less
@@ -131,17 +131,16 @@
justify-content: space-between;
padding: 12rpx 40rpx;
.item{
+ width: 50%;
flex-shrink: 0;
margin-bottom: 32rpx;
.img_wrap{
width: 242rpx;
- height: 136rpx;
border-radius: 8rpx;
overflow: hidden;
position: relative;
.img{
width: 100%;
- height: 100%;
}
.new{
width: 72rpx;
@@ -153,6 +152,10 @@
}
.name{
margin: 12rpx 0 8rpx;
+ display: -webkit-box;//灏嗙洅瀛愯浆鎹负寮规�х洅瀛�
+ -webkit-box-orient: vertical;//鏂囨湰鏄剧ず鏂瑰紡锛岄粯璁ゆ按骞�
+ -webkit-line-clamp: 1;//璁剧疆鏄剧ず澶氬皯琛�
+ overflow: hidden;
}
.info{
display: flex;
diff --git a/wechat_jiaxuan/components/disProduct/index.wxml b/wechat_jiaxuan/components/disProduct/index.wxml
index d9ce151..c03500f 100644
--- a/wechat_jiaxuan/components/disProduct/index.wxml
+++ b/wechat_jiaxuan/components/disProduct/index.wxml
@@ -1,25 +1,11 @@
<view class="app">
<view class="search_wrap">
<image src="../../static/icon/ic_search@2x.png" mode="widthFix"></image>
- <input type="text" placeholder="鎼滅储浜у搧鍚嶇О" />
+ <input bindblur="bindblur" model:value="{{ search }}" type="text" placeholder="鎼滅储浜у搧鍚嶇О" />
</view>
<view class="main_content">
<view class="main_left">
- <view class="item active">鍏ㄥ眿瀹氬埗</view>
- <view class="item">鍏ㄥ眿瀹氬埗</view>
- <view class="item">鍏ㄥ眿瀹氬埗</view>
- <view class="item">鍏ㄥ眿瀹氬埗</view>
- <view class="item">鍏ㄥ眿瀹氬埗</view>
- <view class="item">鍏ㄥ眿瀹氬埗</view>
- <view class="item">鍏ㄥ眿瀹氬埗</view>
- <view class="item">鍏ㄥ眿瀹氬埗</view>
- <view class="item">鍏ㄥ眿瀹氬埗</view>
- <view class="item">鍏ㄥ眿瀹氬埗</view>
- <view class="item">鍏ㄥ眿瀹氬埗</view>
- <view class="item">鍏ㄥ眿瀹氬埗</view>
- <view class="item">鍏ㄥ眿瀹氬埗</view>
- <view class="item">鍏ㄥ眿瀹氬埗</view>
- <view class="item">鍏ㄥ眿瀹氬埗</view>
+ <view data-code="{{item.code}}" bindtap="cateClick" wx:for="{{cateList}}" class="item {{ catalogCode == item.code ? 'active' : '' }}">{{ item.name }}</view>
</view>
<view class="main_right">
<view class="query_wrap">
@@ -59,53 +45,25 @@
</view>
</view>
<view class="status">
- <view class="item {{ activeStatus == '0' ? 'active' : '' }}" data-status="0" bindtap="statusChange">榛樿</view>
+ <view class="item {{ sortType == 'NORMAL' ? 'active' : '' }}" data-status="NORMAL" bindtap="statusChange">榛樿</view>
<view class="separate"></view>
- <view class="item {{ activeStatus == '1' ? 'active' : '' }}" data-status="1" bindtap="statusChange">鏈�鐑�</view>
+ <view class="item {{ sortType == 'HOT' ? 'active' : '' }}" data-status="HOT" bindtap="statusChange">鏈�鐑�</view>
<view class="separate"></view>
- <view class="item {{ activeStatus == '2' ? 'active' : '' }}" data-status="2" bindtap="statusChange">鏈�鏂�</view>
+ <view class="item {{ sortType == 'LATEST' ? 'active' : '' }}" data-status="LATEST" bindtap="statusChange">鏈�鏂�</view>
</view>
<view class="goods_list">
- <view class="item" bindtap="handleDetail">
+ <view wx:for="{{ datalist }}" data-id="{{item.id}}" class="item" bindtap="handleDetail">
<view class="img_wrap">
- <image src="../../static/icon/test.png" class="img"></image>
+ <image src="{{ item.coverImage }}" class="img" mode="widthFix"></image>
<image wx:if="{{ true }}" class="new" src="../../static/icon/chanpin_ic_new@2x.png" mode="widthFix"></image>
</view>
- <view class="name">閽㈢惔鏇�</view>
+ <view class="name">{{ item.title }}</view>
<view class="info">
<image wx:if="{{ false }}" class="icon" src="../../static/icon/detail_nav_collect.png" mode="widthFix"></image>
<image wx:else="" class="icon" src="../../static/icon/detail_nav_collected.png" mode="widthFix"></image>
- <text class="num {{true ? 'primary' : ''}}">34</text>
+ <text class="num {{true ? 'primary' : ''}}">{{ item.favoriteCount }}</text>
<image class="icon" src="../../static/icon/zixun_ic_liulan.png" mode="widthFix"></image>
- <text>1000</text>
- </view>
- </view>
- <view class="item">
- <view class="img_wrap">
- <image src="../../static/icon/test.png" class="img"></image>
- <image wx:if="{{ true }}" class="new" src="../../static/icon/chanpin_ic_new@2x.png" mode="widthFix"></image>
- </view>
- <view class="name">閽㈢惔鏇�</view>
- <view class="info">
- <image wx:if="{{ false }}" class="icon" src="../../static/icon/detail_nav_collect.png" mode="widthFix"></image>
- <image wx:else="" class="icon" src="../../static/icon/detail_nav_collected.png" mode="widthFix"></image>
- <text class="num {{true ? 'primary' : ''}}">34</text>
- <image class="icon" src="../../static/icon/zixun_ic_liulan.png" mode="widthFix"></image>
- <text>1000</text>
- </view>
- </view>
- <view class="item">
- <view class="img_wrap">
- <image src="../../static/icon/test.png" class="img"></image>
- <image wx:if="{{ true }}" class="new" src="../../static/icon/chanpin_ic_new@2x.png" mode="widthFix"></image>
- </view>
- <view class="name">閽㈢惔鏇�</view>
- <view class="info">
- <image wx:if="{{ false }}" class="icon" src="../../static/icon/detail_nav_collect.png" mode="widthFix"></image>
- <image wx:else="" class="icon" src="../../static/icon/detail_nav_collected.png" mode="widthFix"></image>
- <text class="num {{true ? 'primary' : ''}}">34</text>
- <image class="icon" src="../../static/icon/zixun_ic_liulan.png" mode="widthFix"></image>
- <text>1000</text>
+ <text>{{ item.readCount }}</text>
</view>
</view>
</view>
diff --git a/wechat_jiaxuan/components/disProduct/index.wxss b/wechat_jiaxuan/components/disProduct/index.wxss
index e67a710..3a5d0b9 100644
--- a/wechat_jiaxuan/components/disProduct/index.wxss
+++ b/wechat_jiaxuan/components/disProduct/index.wxss
@@ -133,19 +133,18 @@
padding: 12rpx 40rpx;
}
.main_content .main_right .goods_list .item {
+ width: 50%;
flex-shrink: 0;
margin-bottom: 32rpx;
}
.main_content .main_right .goods_list .item .img_wrap {
width: 242rpx;
- height: 136rpx;
border-radius: 8rpx;
overflow: hidden;
position: relative;
}
.main_content .main_right .goods_list .item .img_wrap .img {
width: 100%;
- height: 100%;
}
.main_content .main_right .goods_list .item .img_wrap .new {
width: 72rpx;
@@ -156,6 +155,10 @@
}
.main_content .main_right .goods_list .item .name {
margin: 12rpx 0 8rpx;
+ display: -webkit-box;
+ -webkit-box-orient: vertical;
+ -webkit-line-clamp: 1;
+ overflow: hidden;
}
.main_content .main_right .goods_list .item .info {
display: flex;
diff --git a/wechat_jiaxuan/package-lock.json b/wechat_jiaxuan/package-lock.json
index 39858ba..ca54ef1 100644
--- a/wechat_jiaxuan/package-lock.json
+++ b/wechat_jiaxuan/package-lock.json
@@ -1,13 +1,39 @@
{
"name": "party",
"version": "1.0.0",
- "lockfileVersion": 1,
+ "lockfileVersion": 3,
"requires": true,
- "dependencies": {
- "@vant/weapp": {
+ "packages": {
+ "": {
+ "name": "party",
+ "version": "1.0.0",
+ "license": "ISC",
+ "dependencies": {
+ "@vant/area-data": "^1.1.3",
+ "@vant/weapp": "^1.11.6",
+ "mp-html": "^2.5.0",
+ "vant-weapp": "^0.5.28"
+ }
+ },
+ "node_modules/@vant/area-data": {
+ "version": "1.5.1",
+ "resolved": "https://registry.npmjs.org/@vant/area-data/-/area-data-1.5.1.tgz",
+ "integrity": "sha512-gR5TPEzTbxN1cTK1aDhCoyikSCLX7DAacxyXoKyI4SAsYYTZrDl/nLgQFIm9vLsvWzlPIda8xV8/U3x7M9k6ww=="
+ },
+ "node_modules/@vant/weapp": {
"version": "1.11.6",
"resolved": "https://registry.npmjs.org/@vant/weapp/-/weapp-1.11.6.tgz",
"integrity": "sha512-a3heReWYT2gNdsyj6x1hBwsM8V8NrjcPAmle86NH2CD2V/i/h0le75piW6KntSfOPCwekVWMBKhysNrBpJeKdw=="
+ },
+ "node_modules/mp-html": {
+ "version": "2.5.0",
+ "resolved": "https://registry.npmjs.org/mp-html/-/mp-html-2.5.0.tgz",
+ "integrity": "sha512-uvBH5tIaDIlj8qaxsvNXU3RKX0jvXOo3J6FAi/notUv/ds6j79UUTE82aDkxxUk0eLUU0CiCqMrR7WWnytk30Q=="
+ },
+ "node_modules/vant-weapp": {
+ "version": "0.5.29",
+ "resolved": "https://registry.npmjs.org/vant-weapp/-/vant-weapp-0.5.29.tgz",
+ "integrity": "sha512-RMc0Ga914XFwspw2WuOMU8bOHlIkua8X1DoQ/KPnGQzjwT1uEL4S7W186EmaHF1wN2krB9BVd0LdRRt39dGh6Q=="
}
}
}
diff --git a/wechat_jiaxuan/package.json b/wechat_jiaxuan/package.json
index a9273e4..0c407fb 100644
--- a/wechat_jiaxuan/package.json
+++ b/wechat_jiaxuan/package.json
@@ -5,6 +5,7 @@
"dependencies": {
"@vant/area-data": "^1.1.3",
"@vant/weapp": "^1.11.6",
+ "mp-html": "^2.5.0",
"vant-weapp": "^0.5.28"
},
"scripts": {
diff --git a/wechat_jiaxuan/pages/auth/auth.js b/wechat_jiaxuan/pages/auth/auth.js
index 15defe7..e95273d 100644
--- a/wechat_jiaxuan/pages/auth/auth.js
+++ b/wechat_jiaxuan/pages/auth/auth.js
@@ -4,7 +4,6 @@
binDingPhone
} from '../../api/index'
Page({
-
/**
* 椤甸潰鐨勫垵濮嬫暟鎹�
*/
diff --git a/wechat_jiaxuan/pages/consult/consult.js b/wechat_jiaxuan/pages/consult/consult.js
index 22a8ed7..52fb869 100644
--- a/wechat_jiaxuan/pages/consult/consult.js
+++ b/wechat_jiaxuan/pages/consult/consult.js
@@ -1,39 +1,55 @@
-// pages/consult/consult.js
+import { getZhongTaiProductNewsPage, getCatalogList } from '../../api/index'
Page({
/**
* 椤甸潰鐨勫垵濮嬫暟鎹�
*/
data: {
- category: ['鏂板搧涓婂競', '涓撳埄璇佷功', '澶х墝鎺堟潈','鏂板搧涓婂競', '涓撳埄璇佷功', '澶х墝鎺堟潈'],
+ category: [],
secondCategory: ['绾у垎绫�','绾у垎绫�','绾у垎绫�','绾у垎绫�','绾у垎绫�','绾у垎绫�'],
activeCate: '',
seActiveCate: '',
- dataList: []
- },
+ dataList: [],
+ total: 0,
+ pageNum: 1,
+ pageSize: 10,
+ },
+ onLoad(options) {
+ this.getCate()
+ this.getList()
+ },
+ getCate() {
+ getCatalogList({catalogCode: 'product_info'}).then(res => {
+ this.setData({ category: res.data })
+ })
+ },
itemClick(e) {
- const { id } = e.target.dataset
- console.log(e.target.dataset);
+ const { id } = e.currentTarget.dataset
wx.navigateTo({
- url: '/pages/consult/detail',
+ url: '/pages/consult/detail?id='+id,
+ })
+ },
+ getList() {
+ const { pageNum, pageSize, activeCate } = this.data
+ getZhongTaiProductNewsPage({
+ pageNum, pageSize, catalogCode: activeCate
+ }).then(res => {
+ if(res.data){
+ this.setData({ dataList: res.data.records,total: res.data.records.total })
+ }
+
})
},
cateClick(e) {
- const { index } = e.target.dataset
- console.log(index);
+ const { code } = e.currentTarget.dataset
+ this.setData({ activeCate: code })
+ this.getList()
},
seCateClick(e) {
- const { index } = e.target.dataset
+ const { index } = e.currentTarget.dataset
console.log(index);
},
- onLoad(options) {
-
- },
-
- /**
- * 鐢熷懡鍛ㄦ湡鍑芥暟--鐩戝惉椤甸潰鍒濇娓叉煋瀹屾垚
- */
onReady() {
},
diff --git a/wechat_jiaxuan/pages/consult/consult.json b/wechat_jiaxuan/pages/consult/consult.json
index 41f4720..541da3d 100644
--- a/wechat_jiaxuan/pages/consult/consult.json
+++ b/wechat_jiaxuan/pages/consult/consult.json
@@ -1,4 +1,3 @@
{
- "navigationStyle": "custom",
- "navigationBarTextStyle": "white"
+ "navigationBarTitleText": "璧勮"
}
\ No newline at end of file
diff --git a/wechat_jiaxuan/pages/consult/consult.less b/wechat_jiaxuan/pages/consult/consult.less
index 2661717..89e55d3 100644
--- a/wechat_jiaxuan/pages/consult/consult.less
+++ b/wechat_jiaxuan/pages/consult/consult.less
@@ -1,7 +1,21 @@
.container {
background-color: #fff;
}
-
+.search_wrap{
+ width: 670rpx;
+ height: 72rpx;
+ margin: 0rpx auto 24rpx;
+ background: #F7F7F7;
+ border-radius: 8rpx;
+ padding: 0 40rpx;
+ display: flex;
+ align-items: center;
+ background-color: #F7F7F7;
+ image{
+ width: 28rpx;
+ margin-right: 16rpx;
+ }
+}
.scroll_cate {
display: flex;
align-items: center;
@@ -42,6 +56,7 @@
.content{
padding: 0 40rpx 40rpx;
.item{
+ margin-bottom: 60rpx;
.img{
width: 100%;
}
diff --git a/wechat_jiaxuan/pages/consult/consult.wxml b/wechat_jiaxuan/pages/consult/consult.wxml
index b9ee156..6d99493 100644
--- a/wechat_jiaxuan/pages/consult/consult.wxml
+++ b/wechat_jiaxuan/pages/consult/consult.wxml
@@ -1,10 +1,13 @@
<view class="container">
- <navBar showBack="{{ false }}" title="鍜ㄨ"></navBar>
+ <view class="search_wrap">
+ <image src="../../static/icon/ic_search@2x.png" mode="widthFix"></image>
+ <input type="text" placeholder="鎼滅储鍜ㄨ鏍囬" />
+ </view>
<!-- 鍒嗙被 -->
<view>
<scroll-view scroll-x="true" style="weight: 710rpx;margin-bottom: 30rpx;">
<view class="scroll_cate">
- <view bindtap="cateClick" data-index="{{index}}" wx:for="{{ category }}" class="item {{ index == 0 ? 'active': '' }}">{{ item }}</view>
+ <view bindtap="cateClick" data-code="{{item.code}}" wx:for="{{ category }}" class="item {{ activeCate == item.code ? 'active': '' }}">{{ item.name }}</view>
</view>
</scroll-view>
<scroll-view scroll-x="true" style="weight: 710rpx;margin-bottom: 28rpx;">
@@ -15,14 +18,14 @@
</view>
<!-- content -->
<view class="content">
- <view class="item" bindtap="itemClick" data-abg="qwe">
- <image class="img" src="../../static/icon/test.png" mode="widthFix"></image>
- <view class="title">鍚婄伅瀹炵敤鐗硅緫 | 涓�姝ュ浼氱悊鎯冲厜褰卞竷灞�</view>
+ <view wx:for="{{ dataList }}" class="item" bindtap="itemClick" data-id="{{item.id}}">
+ <image class="img" src="{{ item.coverImage }}" mode="widthFix"></image>
+ <view class="title">{{ item.title }}</view>
<view class="df_sb static">
- <view>{{ '2021-08-21 12:00:00' }}</view>
+ <view>{{ item.publishDt || '' }}</view>
<view class="df_sb">
<image class="liulan" src="../../static/icon/zixun_ic_liulan.png" mode="widthFix"></image>
- <text>1000</text>
+ <text>{{ item.viewCount }}</text>
</view>
</view>
</view>
diff --git a/wechat_jiaxuan/pages/consult/consult.wxss b/wechat_jiaxuan/pages/consult/consult.wxss
index 34de519..726cbf0 100644
--- a/wechat_jiaxuan/pages/consult/consult.wxss
+++ b/wechat_jiaxuan/pages/consult/consult.wxss
@@ -1,6 +1,21 @@
.container {
background-color: #fff;
}
+.search_wrap {
+ width: 670rpx;
+ height: 72rpx;
+ margin: 0rpx auto 24rpx;
+ background: #F7F7F7;
+ border-radius: 8rpx;
+ padding: 0 40rpx;
+ display: flex;
+ align-items: center;
+ background-color: #F7F7F7;
+}
+.search_wrap image {
+ width: 28rpx;
+ margin-right: 16rpx;
+}
.scroll_cate {
display: flex;
align-items: center;
@@ -37,6 +52,9 @@
.content {
padding: 0 40rpx 40rpx;
}
+.content .item {
+ margin-bottom: 60rpx;
+}
.content .item .img {
width: 100%;
}
diff --git a/wechat_jiaxuan/pages/consult/detail.js b/wechat_jiaxuan/pages/consult/detail.js
index 0042f46..c1b46f0 100644
--- a/wechat_jiaxuan/pages/consult/detail.js
+++ b/wechat_jiaxuan/pages/consult/detail.js
@@ -1,12 +1,14 @@
-// pages/consult/detail.js
+import { shareContent, getProductNewsInfo } from '../../api/index'
Page({
/**
* 椤甸潰鐨勫垵濮嬫暟鎹�
*/
data: {
- navTitle: '璇︽儏',
- bottomLift: 0
+ bottomLift: 0,
+ info: {},
+
+ showShare: false
},
/**
@@ -17,25 +19,30 @@
this.setData({
bottomLift: app.bottomLift
})
+ this.getDetail(options.id)
},
-
- /**
- * 鐢熷懡鍛ㄦ湡鍑芥暟--鐩戝惉椤甸潰鍒濇娓叉煋瀹屾垚
- */
- onReady() {
-
+ getDetail(id) {
+ getProductNewsInfo({ id }).then(res => {
+ this.setData({ detail: res.data })
+ })
},
-
- /**
- * 鐢熷懡鍛ㄦ湡鍑芥暟--鐩戝惉椤甸潰鏄剧ず
- */
- onShow() {
-
+ openShare() {
+ this.setData({showShare: true})
},
-
- /**
- * 鐢熷懡鍛ㄦ湡鍑芥暟--鐩戝惉椤甸潰闅愯棌
- */
+ handleShare() {
+ console.log('鐐瑰嚮浜嗗垎浜�');
+ shareContent(this.data.info.id)
+ },
+ // onShareAppMessage: function () {
+ // // let { productDetail, userInfo } = this.data
+ // return {
+ // title: productDetail.title,
+ // path: '/pages/index/index?id=' + productDetail.id + '&shareuserid=' + userInfo.id + '&type=0'
+ // }
+ // },
+ onClose() {
+ this.setData({showShare: false})
+ },
onHide() {
},
diff --git a/wechat_jiaxuan/pages/consult/detail.json b/wechat_jiaxuan/pages/consult/detail.json
index 8835af0..4ec2949 100644
--- a/wechat_jiaxuan/pages/consult/detail.json
+++ b/wechat_jiaxuan/pages/consult/detail.json
@@ -1,3 +1,6 @@
{
- "usingComponents": {}
+ "usingComponents": {
+ "van-popup": "@vant/weapp/popup/index"
+ },
+ "navigationBarTitleText": "璇︽儏"
}
\ No newline at end of file
diff --git a/wechat_jiaxuan/pages/consult/detail.less b/wechat_jiaxuan/pages/consult/detail.less
index 1556ec7..c56eb09 100644
--- a/wechat_jiaxuan/pages/consult/detail.less
+++ b/wechat_jiaxuan/pages/consult/detail.less
@@ -46,6 +46,7 @@
}
}
.item {
+ margin-top: 18rpx;
display: flex;
flex-direction: column;
justify-content: center;
@@ -58,4 +59,34 @@
width: 44rpx;
}
}
+}
+.share_modal{
+ .btns{
+ display: flex;
+ min-height: 320rpx;
+ display: flex;
+ align-items: center;
+ .item{
+ display: flex;
+ flex-direction: column;
+ justify-content: center;
+ align-items: center;
+ flex: 1;
+ font-size: 26rpx;
+ background-color: #fff;
+ image{
+ width: 80rpx;
+ height: 80rpx;
+ margin-bottom: 10rpx;
+ }
+ }
+ }
+ .cancel{
+ height: 80rpx;
+ width: 100%;
+ display: flex;
+ justify-content: center;
+ align-items: center;
+ border: 1rpx solid #e5e5e5;
+ }
}
\ No newline at end of file
diff --git a/wechat_jiaxuan/pages/consult/detail.wxml b/wechat_jiaxuan/pages/consult/detail.wxml
index d12b417..28d7894 100644
--- a/wechat_jiaxuan/pages/consult/detail.wxml
+++ b/wechat_jiaxuan/pages/consult/detail.wxml
@@ -1,5 +1,5 @@
<view>
- <navBar title="{{ navTitle }}"></navBar>
+ <!-- <navBar title="{{ navTitle }}"></navBar> -->
<view class="main_content">
<view class="main_title">涓夌缇庡ソ鐜勫叧锛岃繘灞嬬灛闂村嵏杞界柌鎯�</view>
<view class="datetime">鍙戝竷鏃堕棿锛�2021-08-21 10:0</view>
@@ -11,18 +11,34 @@
<!-- footer -->
<view class="footer" style="padding-bottom: {{bottomLift}}px;">
<view class="btns">
- <view class="item">
+ <!-- <view class="item">
<image class="icon" src="../../static/icon/detail_nav_collected.png" mode="widthFix"></image>
<view class="name">鏀惰棌</view>
- </view>
- <view class="item">
+ </view> -->
+ <button open-type="share" class="item" bindtap="handleShare">
<image class="icon" src="../../static/icon/detail_nav_share.png" mode="widthFix"></image>
<view class="name">鍒嗕韩</view>
- </view>
+ </button>
<view class="sub_btn">
<image class="sheji" src="../../static/icon/ic_sheji.png" mode="widthFix"></image>
<view>鍏嶈垂棰勭害涓撳睘璁捐</view>
</view>
</view>
</view>
+ <!-- -->
+ <van-popup position="bottom" show="{{ showShare }}" bind:close="onClose">
+ <view class="share_modal">
+ <view class="btns">
+ <button open-type="share" class="item" bindtap="handleShare">
+ <image src="../../static/icon/wechat.png"></image>
+ <view>鍙戦�佸ソ鍙�</view>
+ </button>
+ <button class="item">
+ <image src="../../static/icon/download.png"></image>
+ <view>涓嬭浇娴锋姤</view>
+ </button>
+ </view>
+ <view bindtap="onClose" class="cancel">鍙栨秷</view>
+ </view>
+ </van-popup>
</view>
\ No newline at end of file
diff --git a/wechat_jiaxuan/pages/consult/detail.wxss b/wechat_jiaxuan/pages/consult/detail.wxss
index ec44c9d..463d76f 100644
--- a/wechat_jiaxuan/pages/consult/detail.wxss
+++ b/wechat_jiaxuan/pages/consult/detail.wxss
@@ -44,6 +44,7 @@
margin-right: 8rpx;
}
.footer .item {
+ margin-top: 18rpx;
display: flex;
flex-direction: column;
justify-content: center;
@@ -55,3 +56,30 @@
.footer .item .icon {
width: 44rpx;
}
+.share_modal .btns {
+ min-height: 320rpx;
+ display: flex;
+ align-items: center;
+}
+.share_modal .btns .item {
+ display: flex;
+ flex-direction: column;
+ justify-content: center;
+ align-items: center;
+ flex: 1;
+ font-size: 26rpx;
+ background-color: #fff;
+}
+.share_modal .btns .item image {
+ width: 80rpx;
+ height: 80rpx;
+ margin-bottom: 10rpx;
+}
+.share_modal .cancel {
+ height: 80rpx;
+ width: 100%;
+ display: flex;
+ justify-content: center;
+ align-items: center;
+ border: 1rpx solid #e5e5e5;
+}
diff --git a/wechat_jiaxuan/pages/design/design.js b/wechat_jiaxuan/pages/design/design.js
index 8b24073..0679de0 100644
--- a/wechat_jiaxuan/pages/design/design.js
+++ b/wechat_jiaxuan/pages/design/design.js
@@ -1,5 +1,6 @@
import {
getDictData,
+ getArea,
saveFreeCustomizationApply
} from '../../api/index'
Page({
@@ -14,6 +15,8 @@
showAreaList: false,
areaList: [],
+ cascaderValue: '',
+
DESIGN_BANNER: '',
WechatIMG558: '',
},
@@ -47,6 +50,7 @@
// 鏄剧ず鍒囨崲鍩庡競寮圭獥
chooseCity () {
this.setData({ showAreaList: !this.data.showAreaList })
+ console.log('chooseCity', chooseCity);
},
// 鍒囨崲鍩庡競
confirmChange(e) {
@@ -64,7 +68,19 @@
this.getShopList()
this.chooseCity()
},
+ onFinish() {
+
+ },
+ onClose() {
+ this.setData({ showAreaList: false })
+ },
initData() {
+ getArea({
+ "level": "",
+ "pid": ""
+ }).then(res => {
+ this.setData({areaList: res.data})
+ })
getDictData({
code: 'WEIXIN_DEFAULT_IMGS',
label: 'DESIGN_BANNER'
diff --git a/wechat_jiaxuan/pages/design/design.json b/wechat_jiaxuan/pages/design/design.json
index c1710c5..4b74636 100644
--- a/wechat_jiaxuan/pages/design/design.json
+++ b/wechat_jiaxuan/pages/design/design.json
@@ -1,7 +1,7 @@
{
"usingComponents": {
"van-field": "@vant/weapp/field/index",
- "van-area": "@vant/weapp/area/index",
+ "van-cascader": "@vant/weapp/cascader/index",
"van-popup": "@vant/weapp/popup/index"
},
"navigationBarTitleText": "0鍏冨厤璐硅璁�"
diff --git a/wechat_jiaxuan/pages/design/design.wxml b/wechat_jiaxuan/pages/design/design.wxml
index 636ac06..17c3b9a 100644
--- a/wechat_jiaxuan/pages/design/design.wxml
+++ b/wechat_jiaxuan/pages/design/design.wxml
@@ -19,7 +19,5 @@
</view>
<image class="banner" src="{{ WechatIMG558 }}" mode="widthFix"></image>
<!-- -->
- <van-popup show="{{ showAreaList }}" position="bottom" round>
- <van-area class="area-list" area-list="{{ areaList }}" bind:confirm="confirmChange" bind:cancel="chooseCity" />
- </van-popup>
+ <van-cascader wx:if="{{ showAreaList }}" value="{{ cascaderValue }}" title="璇烽�夋嫨鎵�鍦ㄥ湴鍖�" options="{{ areaList }}" bind:close="onClose" bind:finish="onFinish" />
</view>
\ No newline at end of file
diff --git a/wechat_jiaxuan/pages/detailDis/case.js b/wechat_jiaxuan/pages/detailDis/case.js
index 8adf1e3..63bb98a 100644
--- a/wechat_jiaxuan/pages/detailDis/case.js
+++ b/wechat_jiaxuan/pages/detailDis/case.js
@@ -1,11 +1,12 @@
-// pages/detailDis/case.js
+import { shareContent } from '../../api/index'
Page({
/**
* 椤甸潰鐨勫垵濮嬫暟鎹�
*/
data: {
- bottomLift: 0
+ bottomLift: 0,
+ showShare: false
},
/**
@@ -18,11 +19,22 @@
})
},
- /**
- * 鐢熷懡鍛ㄦ湡鍑芥暟--鐩戝惉椤甸潰鍒濇娓叉煋瀹屾垚
- */
- onReady() {
-
+ openShare() {
+ this.setData({showShare: true})
+ },
+ handleShare() {
+ console.log('鐐瑰嚮浜嗗垎浜�');
+ shareContent(this.data.info.id)
+ },
+ // onShareAppMessage: function () {
+ // // let { productDetail, userInfo } = this.data
+ // return {
+ // title: productDetail.title,
+ // path: '/pages/index/index?id=' + productDetail.id + '&shareuserid=' + userInfo.id + '&type=0'
+ // }
+ // },
+ onClose() {
+ this.setData({showShare: false})
},
/**
diff --git a/wechat_jiaxuan/pages/detailDis/case.json b/wechat_jiaxuan/pages/detailDis/case.json
index 69c292b..45a3118 100644
--- a/wechat_jiaxuan/pages/detailDis/case.json
+++ b/wechat_jiaxuan/pages/detailDis/case.json
@@ -1,4 +1,6 @@
{
- "usingComponents": {},
- "navigationBarTitleText": "妗堜緥璇︽儏"
+ "usingComponents": {
+ "van-popup": "@vant/weapp/popup/index"
+ },
+ "navigationBarTitleText": ""
}
\ No newline at end of file
diff --git a/wechat_jiaxuan/pages/detailDis/case.less b/wechat_jiaxuan/pages/detailDis/case.less
index e77c3dd..2fd009f 100644
--- a/wechat_jiaxuan/pages/detailDis/case.less
+++ b/wechat_jiaxuan/pages/detailDis/case.less
@@ -58,6 +58,20 @@
}
}
+.spaceList{
+ .item{
+ margin-bottom: 60rpx;
+ .name{
+ font-weight: 600;
+ font-size: 36rpx;
+ color: #111111;
+ }
+ .img{
+ width: 100%;
+ border-radius: 8rpx;
+ }
+ }
+}
.footer {
position: fixed;
box-shadow: 0rpx -1rpx 0rpx 0rpx #EEEEEE;
@@ -100,4 +114,34 @@
width: 44rpx;
}
}
+}
+.share_modal{
+ .btns{
+ display: flex;
+ min-height: 320rpx;
+ display: flex;
+ align-items: center;
+ .item{
+ display: flex;
+ flex-direction: column;
+ justify-content: center;
+ align-items: center;
+ flex: 1;
+ font-size: 26rpx;
+ background-color: #fff;
+ image{
+ width: 80rpx;
+ height: 80rpx;
+ margin-bottom: 10rpx;
+ }
+ }
+ }
+ .cancel{
+ height: 80rpx;
+ width: 100%;
+ display: flex;
+ justify-content: center;
+ align-items: center;
+ border: 1rpx solid #e5e5e5;
+ }
}
\ No newline at end of file
diff --git a/wechat_jiaxuan/pages/detailDis/case.wxml b/wechat_jiaxuan/pages/detailDis/case.wxml
index 67b4fbe..2b68332 100644
--- a/wechat_jiaxuan/pages/detailDis/case.wxml
+++ b/wechat_jiaxuan/pages/detailDis/case.wxml
@@ -34,7 +34,7 @@
<image class="icon" src="../../static/icon/detail_nav_collected.png" mode="widthFix"></image>
<view class="name">鏀惰棌</view>
</view>
- <view class="item">
+ <view class="item" bindtap="openShare">
<image class="icon" src="../../static/icon/detail_nav_share.png" mode="widthFix"></image>
<view class="name">鍒嗕韩</view>
</view>
diff --git a/wechat_jiaxuan/pages/detailDis/case.wxss b/wechat_jiaxuan/pages/detailDis/case.wxss
index 837f098..542fd62 100644
--- a/wechat_jiaxuan/pages/detailDis/case.wxss
+++ b/wechat_jiaxuan/pages/detailDis/case.wxss
@@ -45,6 +45,18 @@
font-size: 28rpx;
color: #333333;
}
+.spaceList .item {
+ margin-bottom: 60rpx;
+}
+.spaceList .item .name {
+ font-weight: 600;
+ font-size: 36rpx;
+ color: #111111;
+}
+.spaceList .item .img {
+ width: 100%;
+ border-radius: 8rpx;
+}
.footer {
position: fixed;
box-shadow: 0rpx -1rpx 0rpx 0rpx #EEEEEE;
@@ -88,3 +100,30 @@
.footer .item .icon {
width: 44rpx;
}
+.share_modal .btns {
+ min-height: 320rpx;
+ display: flex;
+ align-items: center;
+}
+.share_modal .btns .item {
+ display: flex;
+ flex-direction: column;
+ justify-content: center;
+ align-items: center;
+ flex: 1;
+ font-size: 26rpx;
+ background-color: #fff;
+}
+.share_modal .btns .item image {
+ width: 80rpx;
+ height: 80rpx;
+ margin-bottom: 10rpx;
+}
+.share_modal .cancel {
+ height: 80rpx;
+ width: 100%;
+ display: flex;
+ justify-content: center;
+ align-items: center;
+ border: 1rpx solid #e5e5e5;
+}
diff --git a/wechat_jiaxuan/pages/detailDis/product.js b/wechat_jiaxuan/pages/detailDis/product.js
index 8f0de89..b7fe333 100644
--- a/wechat_jiaxuan/pages/detailDis/product.js
+++ b/wechat_jiaxuan/pages/detailDis/product.js
@@ -1,11 +1,15 @@
-// pages/detailDis/product.js
+import { shareContent, getProductInfo, actionDo } from '../../api/index'
Page({
/**
* 椤甸潰鐨勫垵濮嬫暟鎹�
*/
data: {
- bottomLift: 0
+ bottomLift: 0,
+ id: '',
+ info: {},
+ member: {},
+ showShare: false
},
/**
@@ -16,46 +20,116 @@
this.setData({
bottomLift: app.bottomLift
})
+ this.getDetail(options.id)
+ actionDo({
+ actionType: 'view',
+ id: options.id
+ })
+ const member = wx.getStorageSync('member')
+ this.setData({id: options.id, member})
},
-
- /**
- * 鐢熷懡鍛ㄦ湡鍑芥暟--鐩戝惉椤甸潰鍒濇娓叉煋瀹屾垚
- */
- onReady() {
-
+ handleAction(e){
+ const actionType = e.currentTarget.dataset.code
+ const { info } = this.data
+ actionDo({
+ actionType,
+ id: this.data.info.id
+ }).then(res => {
+ info.isCollection = info.isCollection || info.isCollection == 'true' ? 'false' : 'true'
+ this.setData({info})
+ })
},
-
- /**
- * 鐢熷懡鍛ㄦ湡鍑芥暟--鐩戝惉椤甸潰鏄剧ず
- */
- onShow() {
-
+ getDetail(id) {
+ getProductInfo({id}).then(res => {
+ this.setData({ info: res.data })
+ wx.setNavigationBarTitle({
+ title: res.data.title
+ })
+ })
},
-
- /**
- * 鐢熷懡鍛ㄦ湡鍑芥暟--鐩戝惉椤甸潰闅愯棌
- */
+ playVideo() {
+ wx.previewMedia({
+ sources: [{ url: this.data.info.video, type: 'video' }]
+ })
+ },
+ bannerbindload(e) {
+ const { height, width } = e.detail
+ let activeHeight = height * 670 / width
+ this.setData({
+ bannerHeight: activeHeight
+ })
+ },
+ handleDesign() {
+ wx.navigateTo({
+ url: '/pages/design/design',
+ })
+ },
+ openShare() {
+ this.setData({showShare: true})
+ },
+ handleShare() {
+ console.log('鐐瑰嚮浜嗗垎浜�');
+ actionDo({ actionType: 'share', id: this.data.info.id })
+ // shareContent({id: this.data.info.id || this.data.id}).then(res => {
+ // this.setData({showShare: false})
+ // })
+ },
+ // onShareAppMessage: function () {
+ // // let { productDetail, userInfo } = this.data
+ // return {
+ // title: productDetail.title,
+ // path: '/pages/index/index?id=' + productDetail.id + '&shareuserid=' + userInfo.id + '&type=0'
+ // }
+ // },
+ onClose() {
+ this.setData({showShare: false})
+ },
+ handleDown() {
+ let { info } = this.data
+ wx.showToast({
+ title: '涓嬭浇涓�',
+ icon: 'loading'
+ })
+ console.log('info.picUrls', info)
+ wx.downloadFile({
+ url: info.picUrls,
+ success (res) {
+ // console.log(res)
+ wx.saveImageToPhotosAlbum({
+ filePath: res.tempFilePath,
+ success(data) {
+ that.toSaveCaseShare()
+ wx.showToast({
+ title: '涓嬭浇鎴愬姛',
+ })
+ },
+ fail(error) {
+ console.log(error)
+ wx.showToast({
+ title: '涓嬭浇澶辫触',
+ icon: 'error'
+ })
+ }
+ })
+ },
+ fail (err) {
+ console.log(err.errMsg)
+ wx.showToast({
+ title: '涓嬭浇澶辫触',
+ icon: 'error'
+ })
+ }
+ })
+ },
onHide() {
},
-
- /**
- * 鐢熷懡鍛ㄦ湡鍑芥暟--鐩戝惉椤甸潰鍗歌浇
- */
onUnload() {
},
-
- /**
- * 椤甸潰鐩稿叧浜嬩欢澶勭悊鍑芥暟--鐩戝惉鐢ㄦ埛涓嬫媺鍔ㄤ綔
- */
onPullDownRefresh() {
},
-
- /**
- * 椤甸潰涓婃媺瑙﹀簳浜嬩欢鐨勫鐞嗗嚱鏁�
- */
onReachBottom() {
},
diff --git a/wechat_jiaxuan/pages/detailDis/product.json b/wechat_jiaxuan/pages/detailDis/product.json
index 8835af0..afd9776 100644
--- a/wechat_jiaxuan/pages/detailDis/product.json
+++ b/wechat_jiaxuan/pages/detailDis/product.json
@@ -1,3 +1,8 @@
{
- "usingComponents": {}
+ "usingComponents": {
+ "van-popup": "@vant/weapp/popup/index",
+ "authCard": "/components/authCard/authCard",
+ "mp-html": "mp-html"
+ },
+ "navigationBarTitleText": ""
}
\ No newline at end of file
diff --git a/wechat_jiaxuan/pages/detailDis/product.less b/wechat_jiaxuan/pages/detailDis/product.less
index c088474..fc3fb1c 100644
--- a/wechat_jiaxuan/pages/detailDis/product.less
+++ b/wechat_jiaxuan/pages/detailDis/product.less
@@ -44,22 +44,26 @@
page {
background-color: #f7f7f7;
}
+.banner_swiper{
+ image{
+ width: 100%;
+ }
+}
.main_content {
padding: 52rpx 40rpx 40rpx;
border-radius: 16rpx 16rpx 0rpx 0rpx;
background-color: #fff;
margin-bottom: 20rpx;
-
.title {
font-weight: 500;
font-size: 36rpx;
+ margin-bottom: 16rpx;
}
-
.desc {
font-size: 26rpx;
color: #555555;
- margin: 16rpx 0 26rpx;
+ margin-bottom: 26rpx;
}
.text {
@@ -68,7 +72,18 @@
margin-bottom: 40rpx;
}
}
-
+.spaceList{
+ .item{
+ .name{
+ font-weight: 600;
+ font-size: 36rpx;
+ color: #111111;
+ }
+ .img{
+ width: 100%;
+ }
+ }
+}
.counselor {
width: 670rpx;
padding: 0 0 0 30rpx;
@@ -121,11 +136,27 @@
font-size: 36rpx;
margin-bottom: 32rpx;
}
-
- video {
+ .img_wrap{
width: 100%;
- border: 1px solid;
border-radius: 8rpx;
+ position: relative;
+ .img{
+ width: 100%;
+ }
+ .play{
+ position: absolute;
+ top: 50%;
+ left: 50%;
+ transform: translate(-50%, -50%);
+ width: 136rpx;
+ height: 58rpx;
+ line-height: 56rpx;
+ text-align: center;
+ background: rgba(0,0,0,0.54);
+ border-radius: 30rpx;
+ font-size: 26rpx;
+ color: rgba(255,255,255,0.8);
+ }
}
}
@@ -141,15 +172,17 @@
.line {
display: flex;
- height: 62rpx;
+ height: 32rpx;
margin-bottom: 24rpx;
.label {
+ width: 120rpx;
font-size: 24rpx;
color: #666666;
}
.val {
+ flex: 1;
font-size: 24rpx;
color: #333333;
}
@@ -167,6 +200,10 @@
display: flex;
align-items: center;
height: 100rpx;
+ .btn{
+ padding: 0;
+ margin-top: 16rpx;
+ }
}
.sub_btn {
display: flex;
@@ -197,4 +234,34 @@
width: 44rpx;
}
}
+}
+.share_modal{
+ .btns{
+ display: flex;
+ min-height: 320rpx;
+ display: flex;
+ align-items: center;
+ .item{
+ display: flex;
+ flex-direction: column;
+ justify-content: center;
+ align-items: center;
+ flex: 1;
+ font-size: 26rpx;
+ background-color: #fff;
+ image{
+ width: 80rpx;
+ height: 80rpx;
+ margin-bottom: 10rpx;
+ }
+ }
+ }
+ .cancel{
+ height: 80rpx;
+ width: 100%;
+ display: flex;
+ justify-content: center;
+ align-items: center;
+ border: 1rpx solid #e5e5e5;
+ }
}
\ No newline at end of file
diff --git a/wechat_jiaxuan/pages/detailDis/product.wxml b/wechat_jiaxuan/pages/detailDis/product.wxml
index 244cdce..94280fd 100644
--- a/wechat_jiaxuan/pages/detailDis/product.wxml
+++ b/wechat_jiaxuan/pages/detailDis/product.wxml
@@ -1,5 +1,5 @@
<view>
- <view class="user">
+ <view class="user" wx:if="{{ false }}">
<view class="avatar"></view>
<view class="content">
<view class="name">涓佹鏋�</view>
@@ -7,55 +7,78 @@
</view>
<view class="btn">鑱旂郴TA</view>
</view>
+ <!-- banner杞挱 -->
+ <swiper class="banner_swiper" circular indicator-dots autoplay style="height:{{bannerHeight}}rpx" duration>
+ <block wx:for="{{ info.bannerImgList }}">
+ <swiper-item>
+ <image bindload="bannerbindload" mode="widthFix" src="{{ item }}"></image>
+ </swiper-item>
+ </block>
+ </swiper>
<view class="main_content">
- <view class="title">鑾タ鍋囨棩-椁愬巺</view>
- <view class="desc">绠�娆ч鏍�</view>
- <view class="text">瀹跺眳椋庢牸涓嶅浛浜庡浐鏈夊舰寮忥紝鍘ㄦ埧鍔熻兘涓嶅眬闄愪簬涓�鏃ヤ笁椁愩��
- 鍏冪礌涓庢潗璐ㄧ鎾炲嚭鐨勪笉浠呮槸璁捐鎰燂紝鏇存槸涓�绉嶉矞鏄庣殑涓嶆嫎
- 涓�鏍肩殑鐜颁唬鎬佸害锛岃瀺鍚堝綋涓嬫祦琛岀編瀛︼紝鏋勮绌洪棿鐨勬棤椋庢牸
- 鍖栥��</view>
- <view class="user counselor">
- <view class="avatar_wrap">
- <image class="avatar" mode="widthFix" src="../../static/icon/home_ic_guwen@2x.png"></image>
- </view>
- <view class="content">
- <view class="name">鎮ㄧ殑涓撳睘瀹跺眳椤鹃棶</view>
- <view class="desc">鎮ㄨ韩杈圭殑鍏ㄥ眿璁捐涓撳</view>
- </view>
- <view class="btn">鍘荤湅鐪�</view>
- </view>
+ <view class="title">{{ info.title }}</view>
+ <view class="desc" wx:if="{{ info.subtitle }}">{{ info.subtitle }}</view>
+ <view class="text">{{ info.intro }}</view>
+ <authCard type="{{ member.authStatus }}" />
</view>
<!-- video -->
- <view class="video">
+ <view wx:if="{{ info.video }}" class="video">
<view class="title">浜у搧瑙嗛</view>
- <video src=""></video>
+ <view class="img_wrap">
+ <image class="img" src="{{ info.coverImage }}" mode="widthFix"></image>
+ <view bindtap="playVideo" class="play">鎾斁</view>
+ </view>
</view>
<view class="detail">
<view class="title">浜у搧璇︽儏</view>
- <view class="line">
- <view class="label">鍝佸悕锛�</view>
- <view class="val">鑾タ鍋囨棩-椁愬巺</view>
+ <view class="line" wx:for="{{ info.productParamList }}">
+ <view class="label">{{ item.paramName }}锛�</view>
+ <view class="val">{{ item.paramValue }}</view>
</view>
- <view class="line">
- <view class="label">宸ヨ壓锛�</view>
- <view class="val">鑾タ鍋囨棩-椁愬巺</view>
+ </view>
+ <!-- 瀵屾枃鏈� -->
+ <view>
+ <!-- <mp-html content="{{info.content}}"></mp-html> -->
+ </view>
+ <view class="spaceList">
+ <view class="item" wx:for="{{ info.spaceList }}">
+ <!-- <view class="name">{{ item.spaceName }}</view> -->
+ <image src="{{ item.spaceImg }}" mode="widthFix" class="img"></image>
+ <!-- <mp-html content="{{item.spaceContent}}"></mp-html> -->
</view>
</view>
<!-- footer -->
<view class="footer" style="padding-bottom: {{bottomLift}}px;">
<view class="btns">
- <view class="item">
- <image class="icon" src="../../static/icon/detail_nav_collected.png" mode="widthFix"></image>
+ <button class="item btn">
+ <image data-code="like_cancel" bindtap="handleAction" wx:if="{{ info.isCollection }}" class="icon" src="../../static/icon/detail_nav_collected.png" mode="widthFix"></image>
+ <image wx:else data-code="like" bindtap="handleAction" class="icon" src="../../static/icon/detail_nav_collect.png" mode="widthFix"></image>
<view class="name">鏀惰棌</view>
- </view>
- <view class="item">
+ </button>
+ <button open-type="share" class="item btn" bindtap="handleShare">
<image class="icon" src="../../static/icon/detail_nav_share.png" mode="widthFix"></image>
<view class="name">鍒嗕韩</view>
- </view>
- <view class="sub_btn">
+ </button>
+ <view class="sub_btn" bindtap="handleDesign">
<image class="sheji" src="../../static/icon/ic_sheji.png" mode="widthFix"></image>
<view>鍏嶈垂棰勭害涓撳睘璁捐</view>
</view>
</view>
</view>
+ <!-- -->
+ <van-popup position="bottom" show="{{ showShare }}" bind:close="onClose">
+ <view class="share_modal">
+ <view class="btns">
+ <button open-type="share" class="item" bindtap="handleShare">
+ <image src="../../static/icon/wechat.png"></image>
+ <view>鍙戦�佸ソ鍙�</view>
+ </button>
+ <button class="item" bindtap="handleDown">
+ <image src="../../static/icon/download.png"></image>
+ <view>涓嬭浇娴锋姤</view>
+ </button>
+ </view>
+ <view bindtap="onClose" class="cancel">鍙栨秷</view>
+ </view>
+ </van-popup>
</view>
\ No newline at end of file
diff --git a/wechat_jiaxuan/pages/detailDis/product.wxss b/wechat_jiaxuan/pages/detailDis/product.wxss
index 6226e87..e956d25 100644
--- a/wechat_jiaxuan/pages/detailDis/product.wxss
+++ b/wechat_jiaxuan/pages/detailDis/product.wxss
@@ -38,6 +38,9 @@
page {
background-color: #f7f7f7;
}
+.banner_swiper image {
+ width: 100%;
+}
.main_content {
padding: 52rpx 40rpx 40rpx;
border-radius: 16rpx 16rpx 0rpx 0rpx;
@@ -47,16 +50,25 @@
.main_content .title {
font-weight: 500;
font-size: 36rpx;
+ margin-bottom: 16rpx;
}
.main_content .desc {
font-size: 26rpx;
color: #555555;
- margin: 16rpx 0 26rpx;
+ margin-bottom: 26rpx;
}
.main_content .text {
font-size: 26rpx;
color: #555555;
margin-bottom: 40rpx;
+}
+.spaceList .item .name {
+ font-weight: 600;
+ font-size: 36rpx;
+ color: #111111;
+}
+.spaceList .item .img {
+ width: 100%;
}
.counselor {
width: 670rpx;
@@ -102,10 +114,27 @@
font-size: 36rpx;
margin-bottom: 32rpx;
}
-.video video {
+.video .img_wrap {
width: 100%;
- border: 1px solid;
border-radius: 8rpx;
+ position: relative;
+}
+.video .img_wrap .img {
+ width: 100%;
+}
+.video .img_wrap .play {
+ position: absolute;
+ top: 50%;
+ left: 50%;
+ transform: translate(-50%, -50%);
+ width: 136rpx;
+ height: 58rpx;
+ line-height: 56rpx;
+ text-align: center;
+ background: rgba(0, 0, 0, 0.54);
+ border-radius: 30rpx;
+ font-size: 26rpx;
+ color: rgba(255, 255, 255, 0.8);
}
.detail {
padding: 52rpx 40rpx 40rpx;
@@ -118,14 +147,16 @@
}
.detail .line {
display: flex;
- height: 62rpx;
+ height: 32rpx;
margin-bottom: 24rpx;
}
.detail .line .label {
+ width: 120rpx;
font-size: 24rpx;
color: #666666;
}
.detail .line .val {
+ flex: 1;
font-size: 24rpx;
color: #333333;
}
@@ -142,6 +173,10 @@
display: flex;
align-items: center;
height: 100rpx;
+}
+.footer .btns .btn {
+ padding: 0;
+ margin-top: 16rpx;
}
.footer .sub_btn {
display: flex;
@@ -172,3 +207,30 @@
.footer .item .icon {
width: 44rpx;
}
+.share_modal .btns {
+ min-height: 320rpx;
+ display: flex;
+ align-items: center;
+}
+.share_modal .btns .item {
+ display: flex;
+ flex-direction: column;
+ justify-content: center;
+ align-items: center;
+ flex: 1;
+ font-size: 26rpx;
+ background-color: #fff;
+}
+.share_modal .btns .item image {
+ width: 80rpx;
+ height: 80rpx;
+ margin-bottom: 10rpx;
+}
+.share_modal .cancel {
+ height: 80rpx;
+ width: 100%;
+ display: flex;
+ justify-content: center;
+ align-items: center;
+ border: 1rpx solid #e5e5e5;
+}
diff --git a/wechat_jiaxuan/pages/detailDis/realpic.js b/wechat_jiaxuan/pages/detailDis/realpic.js
index 6016c13..ee99f77 100644
--- a/wechat_jiaxuan/pages/detailDis/realpic.js
+++ b/wechat_jiaxuan/pages/detailDis/realpic.js
@@ -1,11 +1,12 @@
-// pages/detailDis/realpic.js
+import { shareContent } from '../../api/index'
Page({
/**
* 椤甸潰鐨勫垵濮嬫暟鎹�
*/
data: {
- bottomLift: 0
+ bottomLift: 0,
+ showShare: false
},
/**
@@ -17,19 +18,22 @@
bottomLift: app.bottomLift
})
},
-
- /**
- * 鐢熷懡鍛ㄦ湡鍑芥暟--鐩戝惉椤甸潰鍒濇娓叉煋瀹屾垚
- */
- onReady() {
-
+ openShare() {
+ this.setData({showShare: true})
},
-
- /**
- * 鐢熷懡鍛ㄦ湡鍑芥暟--鐩戝惉椤甸潰鏄剧ず
- */
- onShow() {
-
+ handleShare() {
+ console.log('鐐瑰嚮浜嗗垎浜�');
+ shareContent(this.data.info.id)
+ },
+ // onShareAppMessage: function () {
+ // // let { productDetail, userInfo } = this.data
+ // return {
+ // title: productDetail.title,
+ // path: '/pages/index/index?id=' + productDetail.id + '&shareuserid=' + userInfo.id + '&type=0'
+ // }
+ // },
+ onClose() {
+ this.setData({showShare: false})
},
/**
diff --git a/wechat_jiaxuan/pages/detailDis/realpic.json b/wechat_jiaxuan/pages/detailDis/realpic.json
index d29e33b..45a3118 100644
--- a/wechat_jiaxuan/pages/detailDis/realpic.json
+++ b/wechat_jiaxuan/pages/detailDis/realpic.json
@@ -1,4 +1,6 @@
{
- "usingComponents": {},
- "navigationBarTitleText": "瀹炴櫙璇︽儏"
+ "usingComponents": {
+ "van-popup": "@vant/weapp/popup/index"
+ },
+ "navigationBarTitleText": ""
}
\ No newline at end of file
diff --git a/wechat_jiaxuan/pages/detailDis/realpic.less b/wechat_jiaxuan/pages/detailDis/realpic.less
index 6a65d1b..fc06f14 100644
--- a/wechat_jiaxuan/pages/detailDis/realpic.less
+++ b/wechat_jiaxuan/pages/detailDis/realpic.less
@@ -70,4 +70,34 @@
width: 44rpx;
}
}
+}
+.share_modal{
+ .btns{
+ display: flex;
+ min-height: 320rpx;
+ display: flex;
+ align-items: center;
+ .item{
+ display: flex;
+ flex-direction: column;
+ justify-content: center;
+ align-items: center;
+ flex: 1;
+ font-size: 26rpx;
+ background-color: #fff;
+ image{
+ width: 80rpx;
+ height: 80rpx;
+ margin-bottom: 10rpx;
+ }
+ }
+ }
+ .cancel{
+ height: 80rpx;
+ width: 100%;
+ display: flex;
+ justify-content: center;
+ align-items: center;
+ border: 1rpx solid #e5e5e5;
+ }
}
\ No newline at end of file
diff --git a/wechat_jiaxuan/pages/detailDis/realpic.wxml b/wechat_jiaxuan/pages/detailDis/realpic.wxml
index 9938b5f..952bec0 100644
--- a/wechat_jiaxuan/pages/detailDis/realpic.wxml
+++ b/wechat_jiaxuan/pages/detailDis/realpic.wxml
@@ -22,7 +22,7 @@
<image class="icon" src="../../static/icon/detail_nav_collected.png" mode="widthFix"></image>
<view class="name">鏀惰棌</view>
</view>
- <view class="item">
+ <view class="item" bindtap="openShare">
<image class="icon" src="../../static/icon/detail_nav_share.png" mode="widthFix"></image>
<view class="name">鍒嗕韩</view>
</view>
diff --git a/wechat_jiaxuan/pages/detailDis/realpic.wxss b/wechat_jiaxuan/pages/detailDis/realpic.wxss
index 9148934..009fb51 100644
--- a/wechat_jiaxuan/pages/detailDis/realpic.wxss
+++ b/wechat_jiaxuan/pages/detailDis/realpic.wxss
@@ -64,3 +64,30 @@
.footer .item .icon {
width: 44rpx;
}
+.share_modal .btns {
+ min-height: 320rpx;
+ display: flex;
+ align-items: center;
+}
+.share_modal .btns .item {
+ display: flex;
+ flex-direction: column;
+ justify-content: center;
+ align-items: center;
+ flex: 1;
+ font-size: 26rpx;
+ background-color: #fff;
+}
+.share_modal .btns .item image {
+ width: 80rpx;
+ height: 80rpx;
+ margin-bottom: 10rpx;
+}
+.share_modal .cancel {
+ height: 80rpx;
+ width: 100%;
+ display: flex;
+ justify-content: center;
+ align-items: center;
+ border: 1rpx solid #e5e5e5;
+}
diff --git a/wechat_jiaxuan/pages/discover/discover.js b/wechat_jiaxuan/pages/discover/discover.js
index 9e16cde..2d78164 100644
--- a/wechat_jiaxuan/pages/discover/discover.js
+++ b/wechat_jiaxuan/pages/discover/discover.js
@@ -1,4 +1,4 @@
-// pages/discover/discover.js
+import { getCataLogTagList, getCatalogList } from '../../api/index'
Page({
/**
@@ -6,20 +6,15 @@
*/
data: {
menuButtonInfo: {},
- activeTabs: '0'
+ catalogCode: "whole_case"
},
-
- /**
- * 鐢熷懡鍛ㄦ湡鍑芥暟--鐩戝惉椤甸潰鍔犺浇
- */
onLoad(options) {
let menuButtonInfo = wx.getMenuButtonBoundingClientRect();
this.setData({menuButtonInfo})
- console.log('WindowInfo', menuButtonInfo);
},
tabsClick(e) {
- const activeTabs = e.currentTarget.dataset.tab
- this.setData({activeTabs})
+ const catalogCode = e.currentTarget.dataset.code
+ this.setData({catalogCode})
},
/**
* 鐢熷懡鍛ㄦ湡鍑芥暟--鐩戝惉椤甸潰鍒濇娓叉煋瀹屾垚
diff --git a/wechat_jiaxuan/pages/discover/discover.wxml b/wechat_jiaxuan/pages/discover/discover.wxml
index 9a877da..8bfe2e7 100644
--- a/wechat_jiaxuan/pages/discover/discover.wxml
+++ b/wechat_jiaxuan/pages/discover/discover.wxml
@@ -1,23 +1,23 @@
<view class="container">
<view style="height: {{ menuButtonInfo.top }}px;"></view>
<view class="main_tab">
- <view class="item {{ activeTabs == '0' ? 'active' : '' }}" data-tab="0" bindtap="tabsClick">
+ <view class="item {{ catalogCode == 'product_intro' ? 'active' : '' }}" data-code="product_intro" bindtap="tabsClick">
<view class="name">浜у搧</view>
<view class="border"></view>
</view>
- <view class="item {{ activeTabs == '1' ? 'active' : '' }}" data-tab="1" bindtap="tabsClick">
+ <view class="item {{ catalogCode == 'whole_case' ? 'active' : '' }}" data-code="whole_case" bindtap="tabsClick">
<view class="name">妗堜緥</view>
<view class="border"></view>
</view>
- <view class="item {{ activeTabs == '2' ? 'active' : '' }}" data-tab="2" bindtap="tabsClick">
+ <view class="item {{ catalogCode == 'real_case' ? 'active' : '' }}" data-code="real_case" bindtap="tabsClick">
<view class="name">瀹炴櫙</view>
<view class="border"></view>
</view>
</view>
<!-- -->
<view class="main_content" style="height: calc( 100vh - {{menuButtonInfo.top}}px - 88rpx )">
- <disProduct wx:if="{{ activeTabs == '0' }}" />
- <disCase wx:if="{{ activeTabs == '1' }}" />
- <disRealpic wx:if="{{ activeTabs == '2' }}" />
+ <disProduct wx:if="{{ catalogCode == 'product_intro' }}" />
+ <disCase wx:if="{{ catalogCode == 'whole_case' }}" />
+ <disRealpic wx:if="{{ catalogCode == 'real_case' }}" />
</view>
</view>
\ No newline at end of file
diff --git a/wechat_jiaxuan/pages/homeId/index.js b/wechat_jiaxuan/pages/homeId/index.js
index 22a8ed7..4b5c569 100644
--- a/wechat_jiaxuan/pages/homeId/index.js
+++ b/wechat_jiaxuan/pages/homeId/index.js
@@ -1,17 +1,27 @@
-// pages/consult/consult.js
+import { getCataLogTagList, pageZSZXContentList } from '../../api/index'
Page({
/**
* 椤甸潰鐨勫垵濮嬫暟鎹�
*/
data: {
- category: ['鏂板搧涓婂競', '涓撳埄璇佷功', '澶х墝鎺堟潈','鏂板搧涓婂競', '涓撳埄璇佷功', '澶х墝鎺堟潈'],
- secondCategory: ['绾у垎绫�','绾у垎绫�','绾у垎绫�','绾у垎绫�','绾у垎绫�','绾у垎绫�'],
+ tagList: [],
activeCate: '',
- seActiveCate: '',
- dataList: []
- },
+ dataList: [],
+ pageNum: 1,
+ pageSize: 10,
+ code: '',
+ tagCodes: ''
+ },
+ onLoad(options) {
+ wx.setNavigationBarTitle({
+ title: options.name
+ })
+ this.setData({ code: options.code})
+ this.getTabList()
+ this.getList()
+ },
itemClick(e) {
const { id } = e.target.dataset
console.log(e.target.dataset);
@@ -20,20 +30,42 @@
})
},
cateClick(e) {
- const { index } = e.target.dataset
- console.log(index);
+ const { code } = e.target.dataset
+ this.setData({
+ tagCodes: code,
+ pageNum: 1,
+ dataList: []
+ })
+ this.getList()
},
- seCateClick(e) {
- const { index } = e.target.dataset
- console.log(index);
+ getTabList() {
+ getCataLogTagList({
+ catalogCode: this.data.code
+ }).then(res => {
+ if(res && res.data && res.data.length > 0){
+ this.setData({
+ tagList: res.data[0].valueVos
+ })
+ }
+
+ })
},
- onLoad(options) {
+ getList(){
+ const { code, tagCodes, pageSize, pageNum } = this.data
+ pageZSZXContentList({
+ catalogCode: code,
+ tagCodes,
+ pageSize,
+ pageNum
+ }).then(res => {
+ this.setData({
+ dataList: [ ...this.data.dataList, ...res.data.records ]
+ })
+ })
+ },
+ onReachBottom() {
},
-
- /**
- * 鐢熷懡鍛ㄦ湡鍑芥暟--鐩戝惉椤甸潰鍒濇娓叉煋瀹屾垚
- */
onReady() {
},
diff --git a/wechat_jiaxuan/pages/homeId/index.json b/wechat_jiaxuan/pages/homeId/index.json
index 87306f3..2303215 100644
--- a/wechat_jiaxuan/pages/homeId/index.json
+++ b/wechat_jiaxuan/pages/homeId/index.json
@@ -1,3 +1,3 @@
{
- "navigationBarTitleText": "瀹剁殑ID"
+ "navigationBarTitleText": ""
}
\ No newline at end of file
diff --git a/wechat_jiaxuan/pages/homeId/index.less b/wechat_jiaxuan/pages/homeId/index.less
index aff0800..5f5ffb0 100644
--- a/wechat_jiaxuan/pages/homeId/index.less
+++ b/wechat_jiaxuan/pages/homeId/index.less
@@ -56,10 +56,15 @@
.content{
padding: 0 40rpx 40rpx;
.item{
+ margin-bottom: 60rpx;
.img{
width: 100%;
}
.title{
+ width: 100%;
+ white-space: nowrap;
+ overflow: hidden;
+ text-overflow: ellipsis;
font-size: 30rpx;
color: #111111;
margin: 24rpx 0 12rpx;
diff --git a/wechat_jiaxuan/pages/homeId/index.wxml b/wechat_jiaxuan/pages/homeId/index.wxml
index 0df64fd..48b4dc2 100644
--- a/wechat_jiaxuan/pages/homeId/index.wxml
+++ b/wechat_jiaxuan/pages/homeId/index.wxml
@@ -4,20 +4,20 @@
<view>
<scroll-view scroll-x="true" style="weight: 710rpx;margin-bottom: 30rpx;">
<view class="scroll_cate">
- <view bindtap="cateClick" data-index="{{index}}" wx:for="{{ category }}" class="item {{ index == 0 ? 'active': '' }}">{{ item }}</view>
+ <view bindtap="cateClick" data-code="{{item.labelValueCode}}" wx:for="{{ tagList }}" class="item {{ tagCodes == item.labelValueCode ? 'active': '' }}">{{ item.labelValueName }}</view>
</view>
</scroll-view>
</view>
<!-- content -->
<view class="content">
- <view class="item" bindtap="itemClick" data-abg="qwe">
- <image class="img" src="../../static/icon/test.png" mode="widthFix"></image>
- <view class="title">鍚婄伅瀹炵敤鐗硅緫 | 涓�姝ュ浼氱悊鎯冲厜褰卞竷灞�</view>
+ <view wx:for="{{ dataList }}" class="item" bindtap="itemClick" data-abg="qwe">
+ <image class="img" src="{{ item.coverImage }}" mode="widthFix"></image>
+ <view class="title">{{ item.title }}</view>
<view class="df_sb static">
- <view>{{ '2021-08-21 12:00:00' }}</view>
+ <view>{{ item.publishDt }}</view>
<view class="df_sb">
<image class="liulan" src="../../static/icon/zixun_ic_liulan.png" mode="widthFix"></image>
- <text>1000</text>
+ <text>{{ item.viewCount || 0 }}</text>
</view>
</view>
</view>
diff --git a/wechat_jiaxuan/pages/homeId/index.wxss b/wechat_jiaxuan/pages/homeId/index.wxss
index 5d130e2..af963fb 100644
--- a/wechat_jiaxuan/pages/homeId/index.wxss
+++ b/wechat_jiaxuan/pages/homeId/index.wxss
@@ -52,10 +52,17 @@
.content {
padding: 0 40rpx 40rpx;
}
+.content .item {
+ margin-bottom: 60rpx;
+}
.content .item .img {
width: 100%;
}
.content .item .title {
+ width: 100%;
+ white-space: nowrap;
+ overflow: hidden;
+ text-overflow: ellipsis;
font-size: 30rpx;
color: #111111;
margin: 24rpx 0 12rpx;
diff --git a/wechat_jiaxuan/pages/index/index.js b/wechat_jiaxuan/pages/index/index.js
index ea13e96..a4a5087 100644
--- a/wechat_jiaxuan/pages/index/index.js
+++ b/wechat_jiaxuan/pages/index/index.js
@@ -1,4 +1,13 @@
-import { getDictData, getMemberInfo } from '../../api/index'
+import {
+ getDictData,
+ getMemberInfo,
+ getZSZXCatalogs,
+ getCustomizedNewsList,
+ getHomeBanner,
+ getHomeBannerDetail,
+ getZhongTaiVideoPage,
+ getZhongTaiProductNewsPage
+} from '../../api/index'
Page({
/**
@@ -7,17 +16,20 @@
data: {
// 椤堕儴nav
topHeadStyle: 1,
- showWhiteHead: true,
+ top: 0,
+ font_color: '#ffffff',
+ ZSZXCata: {},
+
+ showWhiteHead: false,
topHeadBorder: false,
member: {},
- bannerList: [
- {imgurl: ''},
- {imgurl: 'adsa.png'},
- {imgurl: 'adsa.png'},
- {imgurl: 'adsa.png'},
- ],
+ bannerList: [],
+ bannerImgHeight: 0,
+ consultList: [],
+ consultImgHeight: 0,
+ productVideo: {},
bannerSwiperOption: {
indicatorDots: true,
vertical: false,
@@ -25,31 +37,35 @@
interval: 3000,
duration: 500
},
+ serviceList: [],
+ testUrl: '',
HOME_CLASS_A: '',
HOME_CLASS_B: '',
HOME_CLASS_B2: '',
HOME_CLASS_C: '',
},
-
- toSearch() {},
onShow() {
- getMemberInfo().then(res => {
- this.setData({member: res.data})
- })
+ const member = wx.getStorageSync('member')
+ if(member && (member.authStatus == '1' || member.authStatus == '2')){
+ getMemberInfo().then(res => {
+ this.setData({member: res.data})
+ })
+ }else{
+ this.setData({member})
+ }
},
onLoad(options) {
this.initData()
},
changePath(e) {
let index = e.currentTarget.dataset.type
- console.log(index);
switch (index) {
case '0':
wx.navigateTo({
url: '/pages/webView/index',
success: function (res) {
// 閫氳繃eventChannel鍚戣鎵撳紑椤甸潰浼犻�佹暟鎹�
- res.eventChannel.emit('acceptDataFromOpenerPage', { link: 'https://m.zbom.com/mobile/styleTest.html?type=1' })
+ res.eventChannel.emit('acceptDataFromOpenerPage', { link: this.data.testUrl })
// saveBehavior({ type: 1 })
}
})
@@ -79,7 +95,47 @@
break;
}
},
+ changeStrategy(e) {
+ let item = e.currentTarget.dataset.item
+ wx.navigateTo({
+ url: `/pages/homeId/index?code=${item.code}&name=${item.name}` ,
+ })
+ },
initData() {
+ // 杞挱
+ getHomeBanner().then(res => {
+ this.setData({ bannerList: res.data })
+ })
+ // 浜у搧瑙嗛
+ getZhongTaiVideoPage({ pageSize: 1, pageNum: 1 }).then(res => {
+ if(res.data.records && res.data.records.length > 0){
+ this.setData({ productVideo: res.data.records })
+ }
+ })
+ getZSZXCatalogs().then(res => { //蹇楄瑁呬慨
+ this.setData({
+ ZSZXCata: res.data || {}
+ })
+ })
+ // 璧勮
+ getZhongTaiProductNewsPage({
+ catalogCode: 'product_info',
+ pageSize: 5, pageNum: 1
+ }).then(res => {
+ if(res.data){
+ this.setData({ consultList: res.data.records })
+ }
+ })
+ getCustomizedNewsList().then(res => { // 瀹氬埗鏈嶅姟
+ this.setData({serviceList: res.data || []})
+ })
+ // 椋庢牸娴嬭瘯
+ getDictData({
+ code: 'WX_MINI_CONFIG',
+ label: 'ZBOM_STYLE_TEST_URL'
+ }).then(res => {
+ this.setData({ testUrl: res.data.code })
+ })
getDictData({
code: 'WEIXIN_DEFAULT_IMGS',
label: 'HOME_CLASS_A'
@@ -110,10 +166,47 @@
url: '/pages/productVideo/index',
})
},
- jumpProKefu() {
- wx.navigateTo({
- url: '/pages/kefu/index',
+ videoClick(e) {
+ const { videourl } = e.currentTarget.dataset
+ wx.previewMedia({
+ sources: [{ url: videourl, type: 'video' }]
})
+ },
+ goserHeight:function (e) {
+ const serviceHeight = e.detail.height
+ this.setData({
+ serviceHeight: serviceHeight
+ })
+ },
+ bannerbindload(e) {
+ const height = e.detail.height
+ this.setData({
+ bannerImgHeight: height
+ })
+ },
+ consultbindload(e) {
+ const { height, width } = e.detail
+ let activeHeight = height * 670 / width
+ this.setData({
+ consultImgHeight: activeHeight
+ })
+ },
+ bannerClick(e) {
+ const { id } = e.currentTarget.dataset
+ getHomeBannerDetail({id})
+ },
+ seriveClick(e) {
+ const { id, title } = e.currentTarget.dataset
+ if(title === '涓撳睘瀹㈡湇'){
+ wx.navigateTo({
+ url: `/pages/kefu/index?title=${title}&id=${id}`,
+ })
+ }else{
+ wx.navigateTo({
+ url: `/pages/kefu/service?title=${title}&id=${id}`,
+ })
+ }
+
},
jumpProConsult() {
wx.switchTab({
@@ -126,7 +219,36 @@
onReady() {
},
-
+ onPageScroll(e) {
+ let scrollTop = e.scrollTop / 100
+ if (scrollTop <= 0.1) {
+ this.setData({ font_color: '#ffffff' })
+ } else if (scrollTop >= 0.1 && scrollTop < 0.2) {
+ this.setData({ font_color: '#d0d0d0' })
+ } else if (scrollTop >= 0.2 && scrollTop < 0.3) {
+ this.setData({ font_color: '#bdbdbd' })
+ } else if (scrollTop >= 0.3 && scrollTop < 0.4) {
+ this.setData({ font_color: '#a1a1a1' })
+ } else if (scrollTop >= 0.4 && scrollTop < 0.5) {
+ this.setData({ font_color: '#878787' })
+ } else if (scrollTop >= 0.5 && scrollTop < 0.6) {
+ this.setData({ font_color: '#6d6d6d' })
+ } else if (scrollTop >= 0.6 && scrollTop < 0.7) {
+ this.setData({ font_color: '#535353' })
+ } else if (scrollTop >= 0.7 && scrollTop < 0.8) {
+ this.setData({ font_color: '#3b3b3b' })
+ } else if (scrollTop >= 0.8 && scrollTop < 0.9) {
+ this.setData({ font_color: '#282828' })
+ } else if (scrollTop >= 0.9) {
+ this.setData({ font_color: '#000000' })
+ }
+ if (scrollTop > 0) {
+ this.setData({ showWhiteHead: true })
+ } else{
+ this.setData({ showWhiteHead: false })
+ }
+ this.setData({ topHeadStyle: scrollTop, top: scrollTop })
+ },
/**
* 鐢熷懡鍛ㄦ湡鍑芥暟--鐩戝惉椤甸潰闅愯棌
*/
diff --git a/wechat_jiaxuan/pages/index/index.less b/wechat_jiaxuan/pages/index/index.less
index 8b5fbdd..563571a 100644
--- a/wechat_jiaxuan/pages/index/index.less
+++ b/wechat_jiaxuan/pages/index/index.less
@@ -1,7 +1,8 @@
.container {
background-color: #f7f7f7;
overflow-y: auto;
- height: 100vh;
+ min-height: 100vh;
+
.banner_swiper {
height: 600rpx;
width: 100%;
@@ -14,13 +15,9 @@
}
.consult_swiper {
- height: 420rpx;
width: 100%;
-
image {
width: 100%;
- height: 100%;
- display: block;
}
}
@@ -31,6 +28,7 @@
align-items: center;
padding: 60rpx 0;
background-color: #fff;
+
.logo {
width: 246rpx;
}
@@ -87,20 +85,47 @@
padding: 72rpx 40rpx;
background-color: #fff;
- video {
+ .video_wrap {
width: 670rpx;
- height: 300rpx;
- border: 1px solid;
+ position: relative;
+
+ .play {
+ width: 60rpx;
+ position: absolute;
+ top: 50%;
+ left: 50%;
+ transform: translate(-50%, -50%);
+ z-index: 1;
+ }
+
+ .img {
+ width: 100%;
+ }
}
+
}
.strategy {
padding: 80rpx 40rpx;
background: #F7F7F7;
- image {
- width: 100%;
- height: 100%;
+ .item {
+ position: relative;
+
+ image {
+ width: 100%;
+ height: 100%;
+ position: absolute;
+ }
+
+ text {
+ color: #fff;
+ position: absolute;
+ bottom: 40rpx;
+ left: 40rpx;
+ font-size: 32rpx;
+ font-weight: 500;
+ }
}
.line {
@@ -180,4 +205,19 @@
}
}
+}
+
+.top-head-transparent {
+ background-color: transparent !important;
+
+ .van-nav-bar__title {
+ /* color: #fff; */
+ width: calc(100% - 80rpx);
+ max-width: 100%;
+ padding: 0 40rpx;
+ text-align: left;
+ color: #fff;
+ font-weight: bold;
+ font-size: 40rpx;
+ }
}
\ No newline at end of file
diff --git a/wechat_jiaxuan/pages/index/index.wxml b/wechat_jiaxuan/pages/index/index.wxml
index 34d82b2..9e35072 100644
--- a/wechat_jiaxuan/pages/index/index.wxml
+++ b/wechat_jiaxuan/pages/index/index.wxml
@@ -1,18 +1,23 @@
<!-- 椤堕儴nav -->
<view class="container">
<van-nav-bar wx:if="{{ showWhiteHead }}" border="{{ topHeadBorder }}" custom-class="top-head" fixed custom-style="opacity: {{ topHeadStyle }}">
- <view slot="left" class="flex-cc search" bindtap="toSearch">
- <text>蹇楅偊瀹堕��</text>
+ <view slot="left" class="flex-cc search">
+ <text style="color: {{font_color}};">蹇楅偊瀹堕��</text>
<van-icon name="search" size="23px" color="#fff" />
<!-- <image src="/static/icon/home_ic_search_black.png" mode="widthFix"></image> -->
<!-- <text>鎼滅储</text> -->
</view>
</van-nav-bar>
+ <van-nav-bar wx:else border="{{ topHeadBorder }}" custom-class="top-head-transparent" fixed>
+ <view slot="left" class="flex-cc search">
+ <text style="color: {{font_color}};">蹇楅偊瀹堕��</text>
+ </view>
+ </van-nav-bar>
<!-- banner杞挱 -->
- <swiper class="banner_swiper" circular indicator-dots="{{ bannerSwiperOption.indicatorDots }}" autoplay="{{ bannerSwiperOption.autoplay }}" interval="{{ bannerSwiperOption.interval }}" duration="{{ bannerSwiperOption.duration }}">
+ <swiper class="banner_swiper" circular indicator-dots="{{ bannerSwiperOption.indicatorDots }}" autoplay="{{ bannerSwiperOption.autoplay }}" interval="{{ bannerSwiperOption.interval }}" style="height:{{bannerImgHeight}}rpx" duration="{{ bannerSwiperOption.duration }}">
<block wx:for="{{ bannerList }}" wx:key="index">
<swiper-item>
- <image mode="aspectFill" src="../../static/icon/test.png"></image>
+ <image data-id="{{ item.id }}" bindtap="bannerClick" bindload="bannerbindload" mode="widthFix" src="{{ item.coverImage }}"></image>
</swiper-item>
</block>
</swiper>
@@ -36,9 +41,10 @@
</view>
<!-- -->
<authCard type="{{ member.authStatus }}" />
+ <!-- <authCard type="1" /> -->
<!-- 浜у搧瑙嗛 -->
- <view class="product_video" bindtap="jumpProVideo">
- <view class="com_header">
+ <view class="product_video">
+ <view bindtap="jumpProVideo" class="com_header">
<view class="left">
<view class="name">
<image class="icon" src="../../static/icon/home_ic_zhutihuodong.png"></image>
@@ -48,7 +54,10 @@
</view>
<image class="ar_right" src="../../static/icon/home_ar@2x.png"></image>
</view>
- <video controls class="main_video" src="https://vdept3.bdstatic.com/mda-njed6187hpegim0d/cae_h264/1665826435448713448/mda-njed6187hpegim0d.mp4?v_from_s=hkapp-haokan-hbe&auth_key=1720440602-0-0-f249e56273037ad05b8f7066fd0973ca&bcevod_channel=searchbox_feed&pd=1&cr=0&cd=0&pt=3&logid=0601949156&vid=646246476325419292&klogid=0601949156&abtest=101830_1-17451_2"></video>
+ <view class="video_wrap">
+ <image class="img" src="{{ productVideo[0].coverImage }}" mode="widthFix"></image>
+ <image bindtap="videoClick" data-videourl="{{ productVideo[0].videoUrl }}" class="play" src="../../static/icon/ic_play.png" mode="widthFix"></image>
+ </view>
</view>
<!-- 鏀荤暐 -->
<view class="strategy">
@@ -62,16 +71,24 @@
</view>
</view>
<view class="line">
- <view class="line_left">
+ <view class="line_left item" data-item="{{ ZSZXCata.jdId }}" bindtap="changeStrategy">
<image src="{{HOME_CLASS_A}}"></image>
+ <text>{{ ZSZXCata.jdId.name }}</text>
</view>
<view class="line_right">
- <view class="item"><image src="{{ HOME_CLASS_B }}"></image></view>
- <view class="item"><image src="{{ HOME_CLASS_B2 }}"></image></view>
+ <view class="item" data-item="{{ ZSZXCata.cfsj }}" bindtap="changeStrategy">
+ <image src="{{ HOME_CLASS_B }}"></image>
+ <text>{{ ZSZXCata.cfsj.name }}</text>
+ </view>
+ <view class="item" data-item="{{ ZSZXCata.snsj }}" bindtap="changeStrategy">
+ <image src="{{ HOME_CLASS_B2 }}"></image>
+ <text>{{ ZSZXCata.snsj.name }}</text>
+ </view>
</view>
</view>
- <view class="home_id">
+ <view data-item="{{ ZSZXCata.qwsj.code }}" bindtap="changeStrategy" class="home_id item">
<image src="{{HOME_CLASS_C}}"></image>
+ <text>{{ ZSZXCata.qwsj.name }}</text>
</view>
</view>
<!-- 鍜ㄨ -->
@@ -86,16 +103,16 @@
</view>
<image class="ar_right" src="../../static/icon/home_ar@2x.png"></image>
</view>
- <swiper class="consult_swiper" circular indicator-dots="{{ bannerSwiperOption.indicatorDots }}" autoplay="{{ bannerSwiperOption.autoplay }}" interval="{{ bannerSwiperOption.interval }}" duration="{{ bannerSwiperOption.duration }}">
- <block wx:for="{{ bannerList }}" wx:key="index">
+ <swiper class="consult_swiper" circular indicator-dots="{{ bannerSwiperOption.indicatorDots }}" autoplay="{{ bannerSwiperOption.autoplay }}" interval="{{ bannerSwiperOption.interval }}" style="height:{{consultImgHeight}}rpx" duration="{{ bannerSwiperOption.duration }}">
+ <block wx:for="{{ consultList }}" wx:key="index">
<swiper-item>
- <image mode="aspectFill" src="../../static/icon/test.png"></image>
+ <image bindload="consultbindload" mode="widthFix" src="{{ item.coverImage }}"></image>
</swiper-item>
</block>
</swiper>
</view>
<!-- service -->
- <view class="consult" bindtap="jumpProKefu">
+ <view class="consult">
<view class="com_header">
<view class="left">
<view class="name">
@@ -105,10 +122,10 @@
<view class="desc">璁捐韩澶勫湴涓轰綘鎬濊檻鏇村锛岄櫔浼翠綘鐨勭編濂界敓娲�</view>
</view>
</view>
- <swiper class="consult_swiper" circular indicator-dots="{{ bannerSwiperOption.indicatorDots }}" autoplay="{{ bannerSwiperOption.autoplay }}" interval="{{ bannerSwiperOption.interval }}" duration="{{ bannerSwiperOption.duration }}">
- <block wx:for="{{ bannerList }}" wx:key="index">
+ <swiper class="consult_swiper" circular indicator-dots="{{ bannerSwiperOption.indicatorDots }}" autoplay="{{ bannerSwiperOption.autoplay }}" interval="{{ bannerSwiperOption.interval }}" style="height:{{serviceHeight}}rpx" duration="{{ bannerSwiperOption.duration }}">
+ <block wx:for="{{ serviceList }}" wx:key="index">
<swiper-item>
- <image mode="aspectFill" src="../../static/icon/test.png"></image>
+ <image bindload='goserHeight' data-id="{{ item.id }}" data-title="{{item.title}}" bindtap="seriveClick" mode="widthFix" src="{{ item.fileList[0].fileurlFull }}"></image>
</swiper-item>
</block>
</swiper>
diff --git a/wechat_jiaxuan/pages/index/index.wxss b/wechat_jiaxuan/pages/index/index.wxss
index 81dce26..add8175 100644
--- a/wechat_jiaxuan/pages/index/index.wxss
+++ b/wechat_jiaxuan/pages/index/index.wxss
@@ -1,7 +1,7 @@
.container {
background-color: #f7f7f7;
overflow-y: auto;
- height: 100vh;
+ min-height: 100vh;
}
.container .banner_swiper {
height: 600rpx;
@@ -13,13 +13,10 @@
display: block;
}
.container .consult_swiper {
- height: 420rpx;
width: 100%;
}
.container .consult_swiper image {
width: 100%;
- height: 100%;
- display: block;
}
.container .logo_wrap {
width: 100%;
@@ -75,18 +72,40 @@
padding: 72rpx 40rpx;
background-color: #fff;
}
-.container .product_video video {
+.container .product_video .video_wrap {
width: 670rpx;
- height: 300rpx;
- border: 1px solid;
+ position: relative;
+}
+.container .product_video .video_wrap .play {
+ width: 60rpx;
+ position: absolute;
+ top: 50%;
+ left: 50%;
+ transform: translate(-50%, -50%);
+ z-index: 1;
+}
+.container .product_video .video_wrap .img {
+ width: 100%;
}
.container .strategy {
padding: 80rpx 40rpx;
background: #F7F7F7;
}
-.container .strategy image {
+.container .strategy .item {
+ position: relative;
+}
+.container .strategy .item image {
width: 100%;
height: 100%;
+ position: absolute;
+}
+.container .strategy .item text {
+ color: #fff;
+ position: absolute;
+ bottom: 40rpx;
+ left: 40rpx;
+ font-size: 32rpx;
+ font-weight: 500;
}
.container .strategy .line {
display: flex;
@@ -148,3 +167,16 @@
width: 44rpx;
height: 44rpx;
}
+.top-head-transparent {
+ background-color: transparent !important;
+}
+.top-head-transparent .van-nav-bar__title {
+ /* color: #fff; */
+ width: calc(100% - 80rpx);
+ max-width: 100%;
+ padding: 0 40rpx;
+ text-align: left;
+ color: #fff;
+ font-weight: bold;
+ font-size: 40rpx;
+}
diff --git a/wechat_jiaxuan/pages/kefu/index.js b/wechat_jiaxuan/pages/kefu/index.js
index f5f894b..026490f 100644
--- a/wechat_jiaxuan/pages/kefu/index.js
+++ b/wechat_jiaxuan/pages/kefu/index.js
@@ -1,11 +1,12 @@
-// pages/kefu/index.js
+import { getCustomizedNewsDetail } from '../../api/index'
Page({
/**
* 椤甸潰鐨勫垵濮嬫暟鎹�
*/
data: {
- bottomLift: 0
+ bottomLift: 0,
+ info: {}
},
/**
@@ -16,11 +17,17 @@
this.setData({
bottomLift: app.bottomLift
})
+ if(options && options.id){
+ this.getDetail(options.id)
+ }
},
-
- /**
- * 鐢熷懡鍛ㄦ湡鍑芥暟--鐩戝惉椤甸潰鍒濇娓叉煋瀹屾垚
- */
+ getDetail(id) {
+ getCustomizedNewsDetail({id}).then(res => {
+ this.setData({
+ info: { ...res.data }
+ })
+ })
+ },
onReady() {
},
diff --git a/wechat_jiaxuan/pages/kefu/index.json b/wechat_jiaxuan/pages/kefu/index.json
index a6c246b..3254174 100644
--- a/wechat_jiaxuan/pages/kefu/index.json
+++ b/wechat_jiaxuan/pages/kefu/index.json
@@ -1,4 +1,6 @@
{
- "usingComponents": {},
+ "usingComponents": {
+ "mp-html": "mp-html"
+ },
"navigationBarTitleText": "涓撳睘瀹㈡湇"
}
\ No newline at end of file
diff --git a/wechat_jiaxuan/pages/kefu/index.less b/wechat_jiaxuan/pages/kefu/index.less
index 0ad7523..efd9488 100644
--- a/wechat_jiaxuan/pages/kefu/index.less
+++ b/wechat_jiaxuan/pages/kefu/index.less
@@ -42,4 +42,4 @@
width: 44rpx;
}
}
-}
\ No newline at end of file
+}
diff --git a/wechat_jiaxuan/pages/kefu/index.wxml b/wechat_jiaxuan/pages/kefu/index.wxml
index bdcdd46..f2bfe6d 100644
--- a/wechat_jiaxuan/pages/kefu/index.wxml
+++ b/wechat_jiaxuan/pages/kefu/index.wxml
@@ -1,4 +1,8 @@
<view class="container">
+ <view>
+ <!-- <rich-text nodes="{{ info.content }}"></rich-text> -->
+ <mp-html content="{{info.content}}"></mp-html>
+ </view>
<!-- footer -->
<view class="footer" style="padding-bottom: {{bottomLift}}px;">
<view class="btns">
diff --git a/wechat_jiaxuan/pages/kefu/service.js b/wechat_jiaxuan/pages/kefu/service.js
new file mode 100644
index 0000000..dcc7549
--- /dev/null
+++ b/wechat_jiaxuan/pages/kefu/service.js
@@ -0,0 +1,74 @@
+import { getCustomizedNewsDetail } from '../../api/index'
+Page({
+
+ /**
+ * 椤甸潰鐨勫垵濮嬫暟鎹�
+ */
+ data: {
+ info: {}
+ },
+
+ /**
+ * 鐢熷懡鍛ㄦ湡鍑芥暟--鐩戝惉椤甸潰鍔犺浇
+ */
+ onLoad(options) {
+ if(options && options.id){
+ this.getDetail(options.id)
+ }
+ wx.setNavigationBarTitle({
+ title: options.title
+ })
+ },
+ getDetail(id) {
+ getCustomizedNewsDetail({id}).then(res => {
+ this.setData({
+ info: { ...res.data }
+ })
+ })
+ },
+ onReady() {
+
+ },
+
+ /**
+ * 鐢熷懡鍛ㄦ湡鍑芥暟--鐩戝惉椤甸潰鏄剧ず
+ */
+ onShow() {
+
+ },
+
+ /**
+ * 鐢熷懡鍛ㄦ湡鍑芥暟--鐩戝惉椤甸潰闅愯棌
+ */
+ onHide() {
+
+ },
+
+ /**
+ * 鐢熷懡鍛ㄦ湡鍑芥暟--鐩戝惉椤甸潰鍗歌浇
+ */
+ onUnload() {
+
+ },
+
+ /**
+ * 椤甸潰鐩稿叧浜嬩欢澶勭悊鍑芥暟--鐩戝惉鐢ㄦ埛涓嬫媺鍔ㄤ綔
+ */
+ onPullDownRefresh() {
+
+ },
+
+ /**
+ * 椤甸潰涓婃媺瑙﹀簳浜嬩欢鐨勫鐞嗗嚱鏁�
+ */
+ onReachBottom() {
+
+ },
+
+ /**
+ * 鐢ㄦ埛鐐瑰嚮鍙充笂瑙掑垎浜�
+ */
+ onShareAppMessage() {
+
+ }
+})
\ No newline at end of file
diff --git a/wechat_jiaxuan/pages/kefu/service.json b/wechat_jiaxuan/pages/kefu/service.json
new file mode 100644
index 0000000..0ec25df
--- /dev/null
+++ b/wechat_jiaxuan/pages/kefu/service.json
@@ -0,0 +1,6 @@
+{
+ "usingComponents": {
+ "mp-html": "mp-html"
+ },
+ "navigationBarTitleText": ""
+}
\ No newline at end of file
diff --git a/wechat_jiaxuan/pages/kefu/service.wxml b/wechat_jiaxuan/pages/kefu/service.wxml
new file mode 100644
index 0000000..446eeb9
--- /dev/null
+++ b/wechat_jiaxuan/pages/kefu/service.wxml
@@ -0,0 +1,3 @@
+<view class="container">
+ <mp-html content="{{info.content}}"></mp-html>
+</view>
\ No newline at end of file
diff --git a/wechat_jiaxuan/pages/kefu/service.wxss b/wechat_jiaxuan/pages/kefu/service.wxss
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/wechat_jiaxuan/pages/kefu/service.wxss
diff --git a/wechat_jiaxuan/pages/productVideo/index.js b/wechat_jiaxuan/pages/productVideo/index.js
index 22a8ed7..640bda1 100644
--- a/wechat_jiaxuan/pages/productVideo/index.js
+++ b/wechat_jiaxuan/pages/productVideo/index.js
@@ -1,22 +1,39 @@
-// pages/consult/consult.js
+import { getZhongTaiVideoPage, getCataLogTagList } from '../../api/index'
Page({
/**
* 椤甸潰鐨勫垵濮嬫暟鎹�
*/
data: {
- category: ['鏂板搧涓婂競', '涓撳埄璇佷功', '澶х墝鎺堟潈','鏂板搧涓婂競', '涓撳埄璇佷功', '澶х墝鎺堟潈'],
- secondCategory: ['绾у垎绫�','绾у垎绫�','绾у垎绫�','绾у垎绫�','绾у垎绫�','绾у垎绫�'],
+ category: [],
activeCate: '',
seActiveCate: '',
- dataList: []
- },
+ dataList: [],
+ total: 0,
+ pageSize: 10,
+ pageNum: 1,
+
+ },
+ getList() {
+ const { pageSize, pageNum } = this.data
+ getZhongTaiVideoPage({
+ pageSize,pageNum
+ }).then(res => {
+ this.setData({ dataList: res.data.records })
+ })
+ },
+ getTagList() {
+ getCataLogTagList({
+ catalogCode: 'video_rec'
+ }).then(res => {
+ this.setData({ category: res.data.valueVos })
+ })
+ },
itemClick(e) {
- const { id } = e.target.dataset
- console.log(e.target.dataset);
- wx.navigateTo({
- url: '/pages/consult/detail',
+ const { videourl } = e.currentTarget.dataset
+ wx.previewMedia({
+ sources: [{ url: videourl, type: 'video' }]
})
},
cateClick(e) {
@@ -28,7 +45,8 @@
console.log(index);
},
onLoad(options) {
-
+ this.getTagList()
+ this.getList()
},
/**
diff --git a/wechat_jiaxuan/pages/productVideo/index.less b/wechat_jiaxuan/pages/productVideo/index.less
index aff0800..9075a5d 100644
--- a/wechat_jiaxuan/pages/productVideo/index.less
+++ b/wechat_jiaxuan/pages/productVideo/index.less
@@ -56,8 +56,22 @@
.content{
padding: 0 40rpx 40rpx;
.item{
- .img{
+ margin-bottom: 60rpx;
+ position: relative;
+ .play{
+ width: 60rpx;
+ position: absolute;
+ top: 50%;
+ left: 50%;
+ transform: translate(-50%, -50%);
+ z-index: 1;
+ }
+ .img_wrap{
width: 100%;
+ position: relative;
+ .img{
+ width: 100%;
+ }
}
.title{
font-size: 30rpx;
diff --git a/wechat_jiaxuan/pages/productVideo/index.wxml b/wechat_jiaxuan/pages/productVideo/index.wxml
index 48cffa5..af7be5b 100644
--- a/wechat_jiaxuan/pages/productVideo/index.wxml
+++ b/wechat_jiaxuan/pages/productVideo/index.wxml
@@ -1,8 +1,4 @@
<view class="container">
- <view class="search_wrap">
- <image src="../../static/icon/ic_search@2x.png" mode="widthFix"></image>
- <input type="text" placeholder="鎼滅储鍜ㄨ鏍囬" />
- </view>
<!-- 鍒嗙被 -->
<view>
<scroll-view scroll-x="true" style="weight: 710rpx;margin-bottom: 30rpx;">
@@ -10,22 +6,26 @@
<view bindtap="cateClick" data-index="{{index}}" wx:for="{{ category }}" class="item {{ index == 0 ? 'active': '' }}">{{ item }}</view>
</view>
</scroll-view>
- <scroll-view scroll-x="true" style="weight: 710rpx;margin-bottom: 28rpx;">
+ <!-- <scroll-view scroll-x="true" style="weight: 710rpx;margin-bottom: 28rpx;">
<view class="scroll_cate second_list">
<view bindtap="seCateClick" data-index="{{index}}" wx:for="{{ secondCategory }}" class="item {{ index == 0 ? 'active': '' }}">{{ index }}{{ item }}</view>
</view>
- </scroll-view>
+ </scroll-view> -->
</view>
<!-- content -->
<view class="content">
- <view class="item" bindtap="itemClick" data-abg="qwe">
- <image class="img" src="../../static/icon/test.png" mode="widthFix"></image>
- <view class="title">鍚婄伅瀹炵敤鐗硅緫 | 涓�姝ュ浼氱悊鎯冲厜褰卞竷灞�</view>
+ <view wx:for="{{ dataList }}" class="item">
+ <view class="img_wrap">
+ <image class="img" src="{{ item.coverImage }}" mode="widthFix"></image>
+ <image bindtap="itemClick" data-videourl="{{ item.videoUrl }}" class="play" src="../../static/icon/ic_play.png" mode="widthFix"></image>
+ </view>
+
+ <view class="title">{{ item.title }}</view>
<view class="df_sb static">
- <view>{{ '2021-08-21 12:00:00' }}</view>
+ <view>{{ item.publishDt }}</view>
<view class="df_sb">
<image class="liulan" src="../../static/icon/zixun_ic_liulan.png" mode="widthFix"></image>
- <text>1000</text>
+ <text>{{ item.viewCount }}</text>
</view>
</view>
</view>
diff --git a/wechat_jiaxuan/pages/productVideo/index.wxss b/wechat_jiaxuan/pages/productVideo/index.wxss
index 5d130e2..bf63316 100644
--- a/wechat_jiaxuan/pages/productVideo/index.wxss
+++ b/wechat_jiaxuan/pages/productVideo/index.wxss
@@ -52,7 +52,23 @@
.content {
padding: 0 40rpx 40rpx;
}
-.content .item .img {
+.content .item {
+ margin-bottom: 60rpx;
+ position: relative;
+}
+.content .item .play {
+ width: 60rpx;
+ position: absolute;
+ top: 50%;
+ left: 50%;
+ transform: translate(-50%, -50%);
+ z-index: 1;
+}
+.content .item .img_wrap {
+ width: 100%;
+ position: relative;
+}
+.content .item .img_wrap .img {
width: 100%;
}
.content .item .title {
diff --git a/wechat_jiaxuan/pages/store/info.js b/wechat_jiaxuan/pages/store/info.js
index f999bbb..08cb80c 100644
--- a/wechat_jiaxuan/pages/store/info.js
+++ b/wechat_jiaxuan/pages/store/info.js
@@ -1,26 +1,64 @@
-// pages/store/info.js
+import {
+ getShopDetail
+} from '../../api/index'
Page({
/**
* 椤甸潰鐨勫垵濮嬫暟鎹�
*/
data: {
- bottomLift: 0
+ bottomLift: 0,
+ clientHeight: 0,
+ clientTop: 0,
},
/**
* 鐢熷懡鍛ㄦ湡鍑芥暟--鐩戝惉椤甸潰鍔犺浇
*/
onLoad(options) {
+ this.getDetail(options.id)
var app = getApp().globalData
this.setData({
bottomLift: app.bottomLift
})
+ const res = wx.getMenuButtonBoundingClientRect()
+ this.setData({clientHeight: res.height})
+ this.setData({clientTop: res.top})
+
},
-
- /**
- * 鐢熷懡鍛ㄦ湡鍑芥暟--鐩戝惉椤甸潰鍒濇娓叉煋瀹屾垚
- */
+ navback() {
+ wx.navigateBack()
+ },
+ makePhone(e) {
+ const { linkPhone } = this.data.info
+ wx.makePhoneCall({ phoneNumber: linkPhone })
+ },
+ handleDetail(e) {
+ const id = e.currentTarget.dataset.id
+ wx.navigateTo({
+ url: '/pages/store/staff?id=' + id,
+ })
+ },
+ handleNavigation() {
+ wx.getLocation({
+ type: 'gcj02', //杩斿洖鍙互鐢ㄤ簬wx.openLocation鐨勭粡绾害
+ success (res) {
+ const latitude = res.latitude
+ const longitude = res.longitude
+ wx.openLocation({
+ latitude,
+ longitude,
+ scale: 18
+ })
+ }
+ })
+ },
+ getDetail(id) {
+ getShopDetail({shopId: id}).then(res => {
+ this.setData({ info: res.data })
+ })
+ },
+
onReady() {
},
diff --git a/wechat_jiaxuan/pages/store/info.json b/wechat_jiaxuan/pages/store/info.json
index 8835af0..965b8e8 100644
--- a/wechat_jiaxuan/pages/store/info.json
+++ b/wechat_jiaxuan/pages/store/info.json
@@ -1,3 +1,4 @@
{
- "usingComponents": {}
+ "usingComponents": {},
+ "navigationStyle": "custom"
}
\ No newline at end of file
diff --git a/wechat_jiaxuan/pages/store/info.less b/wechat_jiaxuan/pages/store/info.less
index fdff4f7..0073ca2 100644
--- a/wechat_jiaxuan/pages/store/info.less
+++ b/wechat_jiaxuan/pages/store/info.less
@@ -1,7 +1,9 @@
.header {
+ position: relative;
+ z-index: 999;
width: 670rpx;
margin: 40rpx auto 48rpx;
- height: 224rpx;
+ height: 170rpx;
background: #FFFFFF;
box-shadow: 0rpx 4rpx 16rpx 0rpx rgba(176, 135, 113, 0.2);
border-radius: 8rpx;
@@ -10,18 +12,25 @@
.name {
font-weight: 500;
font-size: 36rpx;
+ margin-bottom: 16rpx;
}
.desc {
font-size: 26rpx;
color: #666666;
- margin: 16rpx 0 24rpx;
+ margin-bottom: 24rpx;
}
.addr {
font-size: 26rpx;
color: #888888;
}
+}
+.navback{
+ padding-left: 30rpx;
+ font-weight: 600;
+ font-size: 38rpx;
+ color: #FFFFFF;
}
.bg_wrap{
width: 750rpx;
@@ -33,14 +42,16 @@
z-index: -1;
}
.main_content {
+ position: relative;
+ bottom: 80rpx;
padding: 0 40rpx 40rpx;
-
+ background-color: #fff;
+ padding-top: 80rpx;
.title {
font-weight: 600;
font-size: 36rpx;
margin-bottom: 38rpx;
}
-
.list {
.item {
width: 670rpx;
diff --git a/wechat_jiaxuan/pages/store/info.wxml b/wechat_jiaxuan/pages/store/info.wxml
index 4e7f6cf..fae06da 100644
--- a/wechat_jiaxuan/pages/store/info.wxml
+++ b/wechat_jiaxuan/pages/store/info.wxml
@@ -1,36 +1,23 @@
<view>
- <navBar title=""></navBar>
- <view class="bg_wrap"></view>
+ <!-- <view class="bg_wrap"></view> -->
+ <image class="bg_wrap" src="../../static/images/mendian_bg.png" mode="widthFix"></image>
+ <view class="navback" style="padding-top: {{ clientTop }}px;height: {{clientHeight + clientTop}}px;">
+ <van-icon bindtap="navback" name="arrow-left" />
+ </view>
<view class="container">
<view class="header">
- <view class="name">鍚堣偉鏂规灄搴�</view>
- <view class="desc">鍏ㄥ眿瀹氬埗銆佹暣浣撳帹鎴裤�佹湪闂ㄥ鏉裤�佸崼闃冲畾鍒�</view>
- <view class="addr">2.4km锝滃悎鑲ュ競閲戝璺惀鐝�浜旂幆鍥介檯A搴�</view>
+ <view class="name">{{ info.name }}</view>
+ <!-- <view class="desc">鍏ㄥ眿瀹氬埗銆佹暣浣撳帹鎴裤�佹湪闂ㄥ鏉裤�佸崼闃冲畾鍒�</view> -->
+ <view class="addr">2.4锝渰{ info.address || '--' }}</view>
</view>
<view class="main_content">
<view class="title">闂ㄥ簵瀵艰喘</view>
<view class="list">
- <view class="item">
- <view class="avatar"></view>
+ <view class="item" data-id="{{ item.iamId }}" bindtap="handleDetail" wx:for="{{ info.usersList }}">
+ <image src="{{ item.imgurlFull }}" class="avatar"></image>
<view class="content">
- <view class="name">涓佹鏋�</view>
- <view class="desc">瀵艰喘锝�5骞寸粡楠�</view>
- </view>
- <view class="btn">鑱旂郴TA</view>
- </view>
- <view class="item">
- <view class="avatar"></view>
- <view class="content">
- <view class="name">涓佹鏋�</view>
- <view class="desc">瀵艰喘锝�5骞寸粡楠�</view>
- </view>
- <view class="btn">鑱旂郴TA</view>
- </view>
- <view class="item">
- <view class="avatar"></view>
- <view class="content">
- <view class="name">涓佹鏋�</view>
- <view class="desc">瀵艰喘锝�5骞寸粡楠�</view>
+ <view class="name">{{ item.name }}</view>
+ <view class="desc">瀵艰喘锝渰{ info.jobDate || '-'}}骞寸粡楠�</view>
</view>
<view class="btn">鑱旂郴TA</view>
</view>
@@ -39,11 +26,11 @@
</view>
<!-- footer -->
<view class="footer" style="bottom: {{bottomLift}}px;">
- <view class="btn">
+ <view bindtap="handleNavigation" class="btn">
<image src="../../static/icon/mendian_ic_daohang@2x.png" mode="widthFix"></image>
<view>瀵艰埅</view>
</view>
- <view class="btn phone">
+ <view bindtap="makePhone" class="btn phone">
<image src="../../static/icon/call.png" mode="widthFix"></image>
<view>闂ㄥ簵鐢佃瘽</view>
</view>
diff --git a/wechat_jiaxuan/pages/store/info.wxss b/wechat_jiaxuan/pages/store/info.wxss
index 6723b44..0157781 100644
--- a/wechat_jiaxuan/pages/store/info.wxss
+++ b/wechat_jiaxuan/pages/store/info.wxss
@@ -1,7 +1,9 @@
.header {
+ position: relative;
+ z-index: 999;
width: 670rpx;
margin: 40rpx auto 48rpx;
- height: 224rpx;
+ height: 170rpx;
background: #FFFFFF;
box-shadow: 0rpx 4rpx 16rpx 0rpx rgba(176, 135, 113, 0.2);
border-radius: 8rpx;
@@ -10,15 +12,22 @@
.header .name {
font-weight: 500;
font-size: 36rpx;
+ margin-bottom: 16rpx;
}
.header .desc {
font-size: 26rpx;
color: #666666;
- margin: 16rpx 0 24rpx;
+ margin-bottom: 24rpx;
}
.header .addr {
font-size: 26rpx;
color: #888888;
+}
+.navback {
+ padding-left: 30rpx;
+ font-weight: 600;
+ font-size: 38rpx;
+ color: #FFFFFF;
}
.bg_wrap {
width: 750rpx;
@@ -30,7 +39,11 @@
z-index: -1;
}
.main_content {
+ position: relative;
+ bottom: 80rpx;
padding: 0 40rpx 40rpx;
+ background-color: #fff;
+ padding-top: 80rpx;
}
.main_content .title {
font-weight: 600;
diff --git a/wechat_jiaxuan/pages/store/staff.js b/wechat_jiaxuan/pages/store/staff.js
index c951641..bb08c95 100644
--- a/wechat_jiaxuan/pages/store/staff.js
+++ b/wechat_jiaxuan/pages/store/staff.js
@@ -1,4 +1,4 @@
-// pages/store/staff.js
+import { usersDetailByIamId } from '../../api/index'
Page({
/**
@@ -6,7 +6,9 @@
*/
data: {
bottomLift: 0,
- isShow: false
+ isShow: false,
+
+ info: {}
},
/**
@@ -17,6 +19,16 @@
this.setData({
bottomLift: app.bottomLift
})
+ this.getDetail(options.id)
+ wx.showShareMenu({
+ withShareTicket: true,
+ menus: ['shareAppMessage', 'shareTimeline']
+ })
+ },
+ getDetail(id) {
+ usersDetailByIamId({iamId: id}).then(res => {
+ this.setData({ info: res.data })
+ })
},
openModal() {
this.setData({isShow: true})
@@ -24,6 +36,7 @@
onClose() {
this.setData({isShow: false})
},
+
/**
* 鐢熷懡鍛ㄦ湡鍑芥暟--鐩戝惉椤甸潰鍒濇娓叉煋瀹屾垚
diff --git a/wechat_jiaxuan/pages/store/staff.less b/wechat_jiaxuan/pages/store/staff.less
index 7986de4..37e60ba 100644
--- a/wechat_jiaxuan/pages/store/staff.less
+++ b/wechat_jiaxuan/pages/store/staff.less
@@ -78,16 +78,23 @@
display: flex;
justify-content: space-between;
margin-bottom: 60rpx;
-
.card {
width: 320rpx;
height: 156rpx;
padding: 28rpx 40rpx;
- background-color: #f7f7f7;
border-radius: 8rpx;
font-size: 26rpx;
color: #333333;
+ position: relative;
+ .bg{
+ width: 100%;
+ height: 100%;
+ position: absolute;
+ z-index: -1;
+ top: 0;
+ left: 0;
+ }
.num {
color: var(--themeColor);
margin-top: 8rpx;
diff --git a/wechat_jiaxuan/pages/store/staff.wxml b/wechat_jiaxuan/pages/store/staff.wxml
index 3af0d01..9afdc2c 100644
--- a/wechat_jiaxuan/pages/store/staff.wxml
+++ b/wechat_jiaxuan/pages/store/staff.wxml
@@ -2,28 +2,31 @@
<!-- <navBar></navBar> -->
<image src="../../static/images/design_banner@2x.png" mode="widthFix" class="bg_wrap"></image>
<view class="container">
- <image class="avatar" src=""></image>
+ <image class="avatar" src="{{ info.imgurlFull }}"></image>
<view class="name_wrap">
<view class="left">
- <view class="name">濮撳悕</view>
+ <view class="name">{{ info.name }}</view>
<view class="tag">瀵艰喘</view>
- <view class="tag">5骞寸粡楠�</view>
+ <!-- <view class="tag">{{ info.jobDate || '-' }}骞寸粡楠�</view> -->
</view>
- <image class="qrcode" src="../../static/icon/mingpian_erweima@2x.png" mode="widthFix"></image>
+ <image bindtap="openModal" class="qrcode" src="../../static/icon/mingpian_erweima@2x.png" mode="widthFix"></image>
</view>
<view class="desc">
<image src="../../static/icon/mingpian_ic_edit@2x.png" mode="widthFix"></image>
- <view>鐢ㄥ績鏈嶅姟姣忎竴浣嶉【瀹�</view>
+ <view>{{ info.slogans }}</view>
<view class="icon"></view>
</view>
<view class="static">
<view class="card">
+ <image src="../../static/images/mingpian_bg_nianxian.png" class="bg"></image>
<view>浠庝笟骞撮檺</view>
- <view class="num">5</view>
+ <view class="num">{{ info.jobDate || '-' }}</view>
</view>
<view class="card">
+ <image src="../../static/images/mingpian_bg_kehu.png" class="bg"></image>
<view>鏈嶅姟瀹㈡埛</view>
- <view class="num">500+</view>
+ <view class="num" wx:if="{{ info.costomerNum || info.costomerNum == 0 }}">{{ info.costomerNum || '-' }}+</view>
+ <view wx:else class="num">--</view>
</view>
</view>
<view class="guide">
@@ -31,38 +34,38 @@
<view class="line">
<image class="icon" src="../../static/icon/mingpian_ic_phone@2x.png" mode="widthFix"></image>
<text class="label">鑱旂郴鐢佃瘽</text>
- <text class="val">1888888888888</text>
+ <text class="val">{{ info.phone }}</text>
</view>
<view class="line">
<image class="icon" src="../../static/icon/mingpian_ic_mendian@2x.png" mode="widthFix"></image>
<text class="label">闂ㄥ簵鍚嶇О</text>
- <text class="val">1888888888888</text>
+ <text class="val">{{ info.shopName }}</text>
</view>
<view class="line">
<image class="icon" src="../../static/icon/mingpian_ic_dizhi@2x.png" mode="widthFix"></image>
<text class="label">闂ㄥ簵鍦板潃</text>
- <text class="val">1888888888888</text>
+ <text class="val">{{ info.shopAddress }}</text>
</view>
</view>
</view>
<!-- footer -->
- <view class="footer" style="bottom: {{bottomLift}}px;">
+ <view bindtap="openModal" class="footer" style="bottom: {{bottomLift}}px;">
<view class="btn">
<image src="../../static/icon/call.png" mode="widthFix"></image>
- <view bindtap="openModal">鑱旂郴TA</view>
+ <view>鑱旂郴TA</view>
</view>
</view>
<!-- 璇︽儏 -->
<van-popup show="{{ isShow }}" closeable round bind:close="onClose">
<view class="modal">
<view class="header">
- <image class="avatar" src=""></image>
+ <image class="avatar" src="{{ info.imgurlFull }}"></image>
<view class="content">
- <view class="name">濮撳悕</view>
- <view class="desc">瀵艰喘 锝� 5骞寸粡楠�</view>
+ <view class="name">{{ info.name }}</view>
+ <view class="desc">瀵艰喘 锝� {{ info.jobDate || '--' }}骞寸粡楠�</view>
</view>
</view>
- <image class="qrcode" src=""></image>
+ <image class="qrcode" src="{{ info.qrcodeImgFull }}"></image>
<view class="text">闀挎寜鍥剧墖璇嗗埆浜岀淮鐮�</view>
</view>
</van-popup>
diff --git a/wechat_jiaxuan/pages/store/staff.wxss b/wechat_jiaxuan/pages/store/staff.wxss
index 5b174a1..8b4f773 100644
--- a/wechat_jiaxuan/pages/store/staff.wxss
+++ b/wechat_jiaxuan/pages/store/staff.wxss
@@ -75,10 +75,18 @@
width: 320rpx;
height: 156rpx;
padding: 28rpx 40rpx;
- background-color: #f7f7f7;
border-radius: 8rpx;
font-size: 26rpx;
color: #333333;
+ position: relative;
+}
+.static .card .bg {
+ width: 100%;
+ height: 100%;
+ position: absolute;
+ z-index: -1;
+ top: 0;
+ left: 0;
}
.static .card .num {
color: var(--themeColor);
diff --git a/wechat_jiaxuan/pages/store/staffList.js b/wechat_jiaxuan/pages/store/staffList.js
index af08ea9..ff533d9 100644
--- a/wechat_jiaxuan/pages/store/staffList.js
+++ b/wechat_jiaxuan/pages/store/staffList.js
@@ -1,20 +1,36 @@
-// pages/store/staffList.js
+import { myUserPage } from '../../api/index'
Page({
/**
* 椤甸潰鐨勫垵濮嬫暟鎹�
*/
data: {
-
+ dataList: '',
+ capacity: 10,
+ page: 1,
},
/**
* 鐢熷懡鍛ㄦ湡鍑芥暟--鐩戝惉椤甸潰鍔犺浇
*/
onLoad(options) {
-
+ this.getList()
},
-
+ handleDetail(e) {
+ const id = e.currentTarget.dataset.iamId
+ wx.navigateTo({
+ url: '/pages/store/staff?id=' + id,
+ })
+ },
+ getList() {
+ const { page, capacity } = this.data
+ myUserPage({
+ model: {},
+ page,capacity
+ }).then(res => {
+ this.setData({ dataList: res.data.records, total: res.data.total })
+ })
+ },
/**
* 鐢熷懡鍛ㄦ湡鍑芥暟--鐩戝惉椤甸潰鍒濇娓叉煋瀹屾垚
*/
diff --git a/wechat_jiaxuan/pages/store/staffList.json b/wechat_jiaxuan/pages/store/staffList.json
index 8835af0..bc7ade2 100644
--- a/wechat_jiaxuan/pages/store/staffList.json
+++ b/wechat_jiaxuan/pages/store/staffList.json
@@ -1,3 +1,4 @@
{
- "usingComponents": {}
+ "usingComponents": {},
+ "navigationBarTitleText": "瀵艰喘鍒楄〃"
}
\ No newline at end of file
diff --git a/wechat_jiaxuan/pages/store/staffList.less b/wechat_jiaxuan/pages/store/staffList.less
index 111ac98..dce1f91 100644
--- a/wechat_jiaxuan/pages/store/staffList.less
+++ b/wechat_jiaxuan/pages/store/staffList.less
@@ -49,7 +49,6 @@
width: 88rpx;
height: 88rpx;
border-radius: 50%;
- border: 1rpx solid #cccccc;
margin-right: 24rpx;
}
diff --git a/wechat_jiaxuan/pages/store/staffList.wxml b/wechat_jiaxuan/pages/store/staffList.wxml
index 14d5c45..6fab76e 100644
--- a/wechat_jiaxuan/pages/store/staffList.wxml
+++ b/wechat_jiaxuan/pages/store/staffList.wxml
@@ -1,5 +1,4 @@
<view>
- <navBar title="瀵艰喘鍒楄〃" />
<view class="header">
<view class="line">
<image src="../../static/icon/home_ic_guwen@2x.png" mode="widthFix"></image>
@@ -8,29 +7,13 @@
<view class="desc">鎮ㄨ韩杈圭殑鍏ㄥ眿璁捐涓撳锝�</view>
</view>
<view class="list">
- <view class="item">
- <view class="avatar"></view>
- <view class="content">
- <view class="name">涓佹鏋�</view>
- <view class="desc">瀵艰喘锝�5骞寸粡楠�</view>
- </view>
- <view class="btn">鑱旂郴TA</view>
- </view>
- <view class="item">
- <view class="avatar"></view>
- <view class="content">
- <view class="name">涓佹鏋�</view>
- <view class="desc">瀵艰喘锝�5骞寸粡楠�</view>
- </view>
- <view class="btn">鑱旂郴TA</view>
- </view>
- <view class="item">
- <view class="avatar"></view>
- <view class="content">
- <view class="name">涓佹鏋�</view>
- <view class="desc">瀵艰喘锝�5骞寸粡楠�</view>
- </view>
- <view class="btn">鑱旂郴TA</view>
- </view>
+ <view wx:for="{{ dataList }}" class="item">
+ <image class="avatar" src="{{ item.imgurlFull ? imgurlFull : '../../static/images/default_avatar.png' }}"></image>
+ <view class="content">
+ <view class="name">{{ item.name || '' }}</view>
+ <view class="desc">瀵艰喘锝渰{ item.jobDate || '--' }}骞寸粡楠�</view>
</view>
+ <view data-iamId="{{ item.iamId }}" bindtap="handleDetail" class="btn">鑱旂郴TA</view>
+ </view>
+ </view>
</view>
\ No newline at end of file
diff --git a/wechat_jiaxuan/pages/store/staffList.wxss b/wechat_jiaxuan/pages/store/staffList.wxss
index 901473f..73d2e1a 100644
--- a/wechat_jiaxuan/pages/store/staffList.wxss
+++ b/wechat_jiaxuan/pages/store/staffList.wxss
@@ -49,7 +49,6 @@
width: 88rpx;
height: 88rpx;
border-radius: 50%;
- border: 1rpx solid #cccccc;
margin-right: 24rpx;
}
.list .item .btn {
diff --git a/wechat_jiaxuan/pages/store/store.js b/wechat_jiaxuan/pages/store/store.js
index cbbe687..f113fa2 100644
--- a/wechat_jiaxuan/pages/store/store.js
+++ b/wechat_jiaxuan/pages/store/store.js
@@ -1,32 +1,80 @@
-// pages/store/store.js
+import {
+ getShopPage
+} from '../../api/index'
+var QQMapWX = require('../../utils/qqmap-wx-jssdk.min');
+var qqmapsdk;
Page({
/**
* 椤甸潰鐨勫垵濮嬫暟鎹�
*/
data: {
-
+ shopList: [],
+ address: '',
+ latitude: '',
+ longitude: '',
},
selAddress() {
console.log('鐐瑰嚮浜�');
wx.chooseLocation({
type: 'wgs84',
- success: (res)=> {
+ success: (res) => {
this.setData({
- city: res.name
+ address: res.address,
+ latitude: res.latitude,
+ longitude: res.longitude,
})
- console.log('res', res);
}
})
},
onLoad(options) {
-
+ let that = this
+ qqmapsdk = new QQMapWX({
+ key: 'HIDBZ-2QXL4-TAWUD-XET6Q-EKTJE-CCBSQ'
+ });
+ qqmapsdk.reverseGeocoder({
+ success: (res) => {
+ console.log('res', res);
+ this.setData({
+ address: res.result.address,
+ latitude: res.result.latitude,
+ longitude: res.result.longitude,
+ })
+ }
+ })
+ wx.getLocation({
+ type: 'wgs84',
+ success(res) {
+ const latitude = res.latitude
+ const longitude = res.longitude
+ that.getShops(latitude, longitude)
+ }
+ })
},
-
- /**
- * 鐢熷懡鍛ㄦ湡鍑芥暟--鐩戝惉椤甸潰鍒濇娓叉煋瀹屾垚
- */
+ getShops(latitude, longitude) {
+ getShopPage({
+ model: {
+ longitude,
+ latitude
+ }
+ }).then(res => {
+ this.setData({
+ shopList: res.data.records
+ })
+ })
+ },
+ handleDetail(e) {
+ const id = e.currentTarget.dataset.id
+ wx.navigateTo({
+ url: `/pages/store/info?id=${id}`,
+ })
+ },
+ makePhone(e) {
+ console.log('e', e);
+ const phoneNumber = e.currentTarget.dataset.phone
+ wx.makePhoneCall({ phoneNumber })
+ },
onReady() {
},
diff --git a/wechat_jiaxuan/pages/store/store.less b/wechat_jiaxuan/pages/store/store.less
index 361f638..6f27aba 100644
--- a/wechat_jiaxuan/pages/store/store.less
+++ b/wechat_jiaxuan/pages/store/store.less
@@ -110,10 +110,15 @@
.avatar{
width: 72rpx;
height: 72rpx;
- border: 1px solid;
border-radius: 50%;
margin-right: 16rpx;
}
+ .name{
+ width: 120rpx;
+ overflow: hidden;
+ text-overflow: ellipsis; //鏂囨湰婧㈠嚭鏄剧ず鐪佺暐鍙�
+ white-space: nowrap; //鏂囨湰涓嶄細鎹㈣
+ }
.ex{
font-size: 24rpx;
color: #999999;
diff --git a/wechat_jiaxuan/pages/store/store.wxml b/wechat_jiaxuan/pages/store/store.wxml
index d9cb5c6..7fe1ed4 100644
--- a/wechat_jiaxuan/pages/store/store.wxml
+++ b/wechat_jiaxuan/pages/store/store.wxml
@@ -1,8 +1,8 @@
<view>
<view class="app_header">
<image class="location" src="../../static/icon/location.png" mode="widthFix"></image>
- <view bindtap="selAddress" class="add">{{ 111 }}闃垮ぇ浣垮ぇ璧涚殑闃垮ぇ浣垮ぇ璧涚殑闃垮ぇ浣垮ぇ璧涚殑闃垮ぇ浣垮ぇ璧涚殑</view>
- <view class="right">
+ <view class="add">{{ address }}</view>
+ <view bindtap="selAddress" class="right">
<image src="../../static/icon/ic_dingwei@2x.png" mode="widthFix"></image>
<text class="primary">閲嶆柊瀹氫綅</text>
</view>
@@ -10,50 +10,29 @@
<view class="main_content">
<view class="app_title">AI涓烘偍鎺ㄨ崘浠ヤ笅闂ㄥ簵锛�</view>
<view class="shops">
- <view class="shop">
+ <view class="shop" wx:for="{{ shopList }}">
<view class="header">
<view class="left">
- <view class="title">title</view>
- <view class="address">
- <text>1</text>
+ <view class="title" data-id="{{ item.id }}" bindtap="handleDetail">{{ item.name }}</view>
+ <view class="address" data-id="{{ item.id }}" bindtap="handleDetail">
+ <text wx:if="{{ item.distanceStr }}">{{ item.distanceStr }} | {{ item.address || '' }}</text>
+ <text wx:else>--</text>
<image src="../../static/icon/arrow_right.png" mode="widthFix"></image>
</view>
</view>
<view class="right">
- <image class="phone" src="../../static/icon/phone.png" mode="widthFix"></image>
+ <image data-phone="{{ item.phone }}" bindtap="makePhone" class="phone" src="../../static/icon/phone.png" mode="widthFix"></image>
<view>鐢佃瘽</view>
</view>
-
-
</view>
<scroll-view scroll-x style="width: 640rpx">
<view class="user_list">
- <view class="item">
+ <view class="item" wx:for="{{ item.usersList }}" wx:for-item="user">
<view class="info">
- <image class="avatar" src="" mode="widthFix"></image>
+ <image class="avatar" src="{{ user.imgurlFull }}" mode="widthFix"></image>
<view class="text">
- <view class="name">name</view>
- <view class="ex">5骞寸粡楠�</view>
- </view>
- </view>
- <view class="btn">鑱旂郴TA</view>
- </view>
- <view class="item">
- <view class="info">
- <image class="avatar" src="" mode="widthFix"></image>
- <view class="text">
- <view class="name">name</view>
- <view class="ex">5骞寸粡楠�</view>
- </view>
- </view>
- <view class="btn">鑱旂郴TA</view>
- </view>
- <view class="item">
- <view class="info">
- <image class="avatar" src="" mode="widthFix"></image>
- <view class="text">
- <view class="name">name</view>
- <view class="ex">5骞寸粡楠�</view>
+ <view class="name">{{ user.name }}</view>
+ <view class="ex" wx:if="{{user.jobDate}}">{{ user.jobDate }}骞寸粡楠�</view>
</view>
</view>
<view class="btn">鑱旂郴TA</view>
diff --git a/wechat_jiaxuan/pages/store/store.wxss b/wechat_jiaxuan/pages/store/store.wxss
index d003d29..8024eb6 100644
--- a/wechat_jiaxuan/pages/store/store.wxss
+++ b/wechat_jiaxuan/pages/store/store.wxss
@@ -109,10 +109,15 @@
.main_content .shops .shop .user_list .item .info .avatar {
width: 72rpx;
height: 72rpx;
- border: 1px solid;
border-radius: 50%;
margin-right: 16rpx;
}
+.main_content .shops .shop .user_list .item .info .name {
+ width: 120rpx;
+ overflow: hidden;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+}
.main_content .shops .shop .user_list .item .info .ex {
font-size: 24rpx;
color: #999999;
diff --git a/wechat_jiaxuan/pages/userinfo/mysub.js b/wechat_jiaxuan/pages/userinfo/mysub.js
index 881c772..49e9b87 100644
--- a/wechat_jiaxuan/pages/userinfo/mysub.js
+++ b/wechat_jiaxuan/pages/userinfo/mysub.js
@@ -1,18 +1,31 @@
-// pages/userinfo/mysub.js
+import { customerLogPage } from '../../api/index'
Page({
/**
* 椤甸潰鐨勫垵濮嬫暟鎹�
*/
data: {
- activeTabs: '0'
+ activeTabs: '0',
+
+ dataList: [],
+ total: 0,
+ page: 0,
+ capacity: 10,
},
/**
* 鐢熷懡鍛ㄦ湡鍑芥暟--鐩戝惉椤甸潰鍔犺浇
*/
onLoad(options) {
-
+ this.getList()
+ },
+ getList() {
+ const { page, capacity} = this.data
+ customerLogPage({
+ model: {},page,capacity
+ }).then(res => {
+ this.setData({ dataList: res.data.records })
+ })
},
tabsChange(e) {
const activeTabs = e.currentTarget.dataset.val
diff --git a/wechat_jiaxuan/pages/userinfo/mysub.wxml b/wechat_jiaxuan/pages/userinfo/mysub.wxml
index 1ddedff..54c8442 100644
--- a/wechat_jiaxuan/pages/userinfo/mysub.wxml
+++ b/wechat_jiaxuan/pages/userinfo/mysub.wxml
@@ -1,14 +1,14 @@
<view class="container">
<view class="tabs">
- <view class="item {{ activeTabs == '0' ? 'active' : '' }}" data-val="0" bindtap="tabsChange">
+ <!-- <view class="item {{ activeTabs == '0' ? 'active' : '' }}" data-val="0" bindtap="tabsChange">
<view class="name">闇�姹�</view>
<view class="border"></view>
- </view>
- <view class="item {{ activeTabs == '1' ? 'active' : '' }}" data-val="1" bindtap="tabsChange">
+ </view> -->
+ <view class="item {{ activeTabs == '0' ? 'active' : '' }}" data-val="1" bindtap="tabsChange">
<view class="name">棰勭害閲忓昂</view>
<view class="border"></view>
</view>
- <view class="item {{ activeTabs == '2' ? 'active' : '' }}" data-val="2" bindtap="tabsChange">
+ <view class="item {{ activeTabs == '1' ? 'active' : '' }}" data-val="2" bindtap="tabsChange">
<view class="name">棰勭畻</view>
<view class="border"></view>
</view>
diff --git a/wechat_jiaxuan/project.private.config.json b/wechat_jiaxuan/project.private.config.json
index 28a5ba8..d825a07 100644
--- a/wechat_jiaxuan/project.private.config.json
+++ b/wechat_jiaxuan/project.private.config.json
@@ -5,7 +5,7 @@
"urlCheck": false
},
"description": "椤圭洰绉佹湁閰嶇疆鏂囦欢銆傛鏂囦欢涓殑鍐呭灏嗚鐩� project.config.json 涓殑鐩稿悓瀛楁銆傞」鐩殑鏀瑰姩浼樺厛鍚屾鍒版鏂囦欢涓�傝瑙佹枃妗o細https://developers.weixin.qq.com/miniprogram/dev/devtools/projectconfig.html",
- "libVersion": "2.30.4",
+ "libVersion": "3.4.10",
"condition": {
"miniprogram": {
"list": [
@@ -39,7 +39,14 @@
},
{
"name": "",
- "pathName": "pages/auth/auth",
+ "pathName": "pages/store/staffList",
+ "query": "",
+ "launchMode": "default",
+ "scene": null
+ },
+ {
+ "name": "",
+ "pathName": "pages/discover/discover",
"query": "",
"launchMode": "default",
"scene": null
@@ -47,7 +54,7 @@
{
"name": "",
"pathName": "pages/store/store",
- "query": "",
+ "query": "code=zb_deco_jdid&name=瀹剁殑iD",
"launchMode": "default",
"scene": null
}
diff --git a/wechat_jiaxuan/static/icon/download.png b/wechat_jiaxuan/static/icon/download.png
new file mode 100644
index 0000000..03cef8c
--- /dev/null
+++ b/wechat_jiaxuan/static/icon/download.png
Binary files differ
diff --git a/wechat_jiaxuan/static/icon/ic_play.png b/wechat_jiaxuan/static/icon/ic_play.png
new file mode 100644
index 0000000..3e58dfa
--- /dev/null
+++ b/wechat_jiaxuan/static/icon/ic_play.png
Binary files differ
diff --git a/wechat_jiaxuan/static/icon/wechat.png b/wechat_jiaxuan/static/icon/wechat.png
new file mode 100644
index 0000000..574c715
--- /dev/null
+++ b/wechat_jiaxuan/static/icon/wechat.png
Binary files differ
diff --git a/wechat_jiaxuan/static/images/mendian_bg.png b/wechat_jiaxuan/static/images/mendian_bg.png
new file mode 100644
index 0000000..1f41351
--- /dev/null
+++ b/wechat_jiaxuan/static/images/mendian_bg.png
Binary files differ
diff --git a/wechat_jiaxuan/static/images/mingpian_bg_kehu.png b/wechat_jiaxuan/static/images/mingpian_bg_kehu.png
new file mode 100644
index 0000000..f79d284
--- /dev/null
+++ b/wechat_jiaxuan/static/images/mingpian_bg_kehu.png
Binary files differ
diff --git a/wechat_jiaxuan/static/images/mingpian_bg_nianxian.png b/wechat_jiaxuan/static/images/mingpian_bg_nianxian.png
new file mode 100644
index 0000000..21d0060
--- /dev/null
+++ b/wechat_jiaxuan/static/images/mingpian_bg_nianxian.png
Binary files differ
diff --git a/wechat_jiaxuan/utils/qqmap-wx-jssdk.min.js b/wechat_jiaxuan/utils/qqmap-wx-jssdk.min.js
new file mode 100644
index 0000000..8fa1477
--- /dev/null
+++ b/wechat_jiaxuan/utils/qqmap-wx-jssdk.min.js
@@ -0,0 +1 @@
+var ERROR_CONF = { KEY_ERR: 311, KEY_ERR_MSG: 'key鏍煎紡閿欒', PARAM_ERR: 310, PARAM_ERR_MSG: '璇锋眰鍙傛暟淇℃伅鏈夎', SYSTEM_ERR: 600, SYSTEM_ERR_MSG: '绯荤粺閿欒', WX_ERR_CODE: 1000, WX_OK_CODE: 200 }; var BASE_URL = 'https://apis.map.qq.com/ws/'; var URL_SEARCH = BASE_URL + 'place/v1/search'; var URL_SUGGESTION = BASE_URL + 'place/v1/suggestion'; var URL_GET_GEOCODER = BASE_URL + 'geocoder/v1/'; var URL_CITY_LIST = BASE_URL + 'district/v1/list'; var URL_AREA_LIST = BASE_URL + 'district/v1/getchildren'; var URL_DISTANCE = BASE_URL + 'distance/v1/'; var URL_DIRECTION = BASE_URL + 'direction/v1/'; var MODE = { driving: 'driving', transit: 'transit' }; var EARTH_RADIUS = 6378136.49; var Utils = { safeAdd(x, y) { var lsw = (x & 0xffff) + (y & 0xffff); var msw = (x >> 16) + (y >> 16) + (lsw >> 16); return (msw << 16) | (lsw & 0xffff) }, bitRotateLeft(num, cnt) { return (num << cnt) | (num >>> (32 - cnt)) }, md5cmn(q, a, b, x, s, t) { return this.safeAdd(this.bitRotateLeft(this.safeAdd(this.safeAdd(a, q), this.safeAdd(x, t)), s), b) }, md5ff(a, b, c, d, x, s, t) { return this.md5cmn((b & c) | (~b & d), a, b, x, s, t) }, md5gg(a, b, c, d, x, s, t) { return this.md5cmn((b & d) | (c & ~d), a, b, x, s, t) }, md5hh(a, b, c, d, x, s, t) { return this.md5cmn(b ^ c ^ d, a, b, x, s, t) }, md5ii(a, b, c, d, x, s, t) { return this.md5cmn(c ^ (b | ~d), a, b, x, s, t) }, binlMD5(x, len) { x[len >> 5] |= 0x80 << (len % 32); x[((len + 64) >>> 9 << 4) + 14] = len; var i; var olda; var oldb; var oldc; var oldd; var a = 1732584193; var b = -271733879; var c = -1732584194; var d = 271733878; for (i = 0; i < x.length; i += 16) { olda = a; oldb = b; oldc = c; oldd = d; a = this.md5ff(a, b, c, d, x[i], 7, -680876936); d = this.md5ff(d, a, b, c, x[i + 1], 12, -389564586); c = this.md5ff(c, d, a, b, x[i + 2], 17, 606105819); b = this.md5ff(b, c, d, a, x[i + 3], 22, -1044525330); a = this.md5ff(a, b, c, d, x[i + 4], 7, -176418897); d = this.md5ff(d, a, b, c, x[i + 5], 12, 1200080426); c = this.md5ff(c, d, a, b, x[i + 6], 17, -1473231341); b = this.md5ff(b, c, d, a, x[i + 7], 22, -45705983); a = this.md5ff(a, b, c, d, x[i + 8], 7, 1770035416); d = this.md5ff(d, a, b, c, x[i + 9], 12, -1958414417); c = this.md5ff(c, d, a, b, x[i + 10], 17, -42063); b = this.md5ff(b, c, d, a, x[i + 11], 22, -1990404162); a = this.md5ff(a, b, c, d, x[i + 12], 7, 1804603682); d = this.md5ff(d, a, b, c, x[i + 13], 12, -40341101); c = this.md5ff(c, d, a, b, x[i + 14], 17, -1502002290); b = this.md5ff(b, c, d, a, x[i + 15], 22, 1236535329); a = this.md5gg(a, b, c, d, x[i + 1], 5, -165796510); d = this.md5gg(d, a, b, c, x[i + 6], 9, -1069501632); c = this.md5gg(c, d, a, b, x[i + 11], 14, 643717713); b = this.md5gg(b, c, d, a, x[i], 20, -373897302); a = this.md5gg(a, b, c, d, x[i + 5], 5, -701558691); d = this.md5gg(d, a, b, c, x[i + 10], 9, 38016083); c = this.md5gg(c, d, a, b, x[i + 15], 14, -660478335); b = this.md5gg(b, c, d, a, x[i + 4], 20, -405537848); a = this.md5gg(a, b, c, d, x[i + 9], 5, 568446438); d = this.md5gg(d, a, b, c, x[i + 14], 9, -1019803690); c = this.md5gg(c, d, a, b, x[i + 3], 14, -187363961); b = this.md5gg(b, c, d, a, x[i + 8], 20, 1163531501); a = this.md5gg(a, b, c, d, x[i + 13], 5, -1444681467); d = this.md5gg(d, a, b, c, x[i + 2], 9, -51403784); c = this.md5gg(c, d, a, b, x[i + 7], 14, 1735328473); b = this.md5gg(b, c, d, a, x[i + 12], 20, -1926607734); a = this.md5hh(a, b, c, d, x[i + 5], 4, -378558); d = this.md5hh(d, a, b, c, x[i + 8], 11, -2022574463); c = this.md5hh(c, d, a, b, x[i + 11], 16, 1839030562); b = this.md5hh(b, c, d, a, x[i + 14], 23, -35309556); a = this.md5hh(a, b, c, d, x[i + 1], 4, -1530992060); d = this.md5hh(d, a, b, c, x[i + 4], 11, 1272893353); c = this.md5hh(c, d, a, b, x[i + 7], 16, -155497632); b = this.md5hh(b, c, d, a, x[i + 10], 23, -1094730640); a = this.md5hh(a, b, c, d, x[i + 13], 4, 681279174); d = this.md5hh(d, a, b, c, x[i], 11, -358537222); c = this.md5hh(c, d, a, b, x[i + 3], 16, -722521979); b = this.md5hh(b, c, d, a, x[i + 6], 23, 76029189); a = this.md5hh(a, b, c, d, x[i + 9], 4, -640364487); d = this.md5hh(d, a, b, c, x[i + 12], 11, -421815835); c = this.md5hh(c, d, a, b, x[i + 15], 16, 530742520); b = this.md5hh(b, c, d, a, x[i + 2], 23, -995338651); a = this.md5ii(a, b, c, d, x[i], 6, -198630844); d = this.md5ii(d, a, b, c, x[i + 7], 10, 1126891415); c = this.md5ii(c, d, a, b, x[i + 14], 15, -1416354905); b = this.md5ii(b, c, d, a, x[i + 5], 21, -57434055); a = this.md5ii(a, b, c, d, x[i + 12], 6, 1700485571); d = this.md5ii(d, a, b, c, x[i + 3], 10, -1894986606); c = this.md5ii(c, d, a, b, x[i + 10], 15, -1051523); b = this.md5ii(b, c, d, a, x[i + 1], 21, -2054922799); a = this.md5ii(a, b, c, d, x[i + 8], 6, 1873313359); d = this.md5ii(d, a, b, c, x[i + 15], 10, -30611744); c = this.md5ii(c, d, a, b, x[i + 6], 15, -1560198380); b = this.md5ii(b, c, d, a, x[i + 13], 21, 1309151649); a = this.md5ii(a, b, c, d, x[i + 4], 6, -145523070); d = this.md5ii(d, a, b, c, x[i + 11], 10, -1120210379); c = this.md5ii(c, d, a, b, x[i + 2], 15, 718787259); b = this.md5ii(b, c, d, a, x[i + 9], 21, -343485551); a = this.safeAdd(a, olda); b = this.safeAdd(b, oldb); c = this.safeAdd(c, oldc); d = this.safeAdd(d, oldd) } return [a, b, c, d] }, binl2rstr(input) { var i; var output = ''; var length32 = input.length * 32; for (i = 0; i < length32; i += 8) { output += String.fromCharCode((input[i >> 5] >>> (i % 32)) & 0xff) } return output }, rstr2binl(input) { var i; var output = []; output[(input.length >> 2) - 1] = undefined; for (i = 0; i < output.length; i += 1) { output[i] = 0 } var length8 = input.length * 8; for (i = 0; i < length8; i += 8) { output[i >> 5] |= (input.charCodeAt(i / 8) & 0xff) << (i % 32) } return output }, rstrMD5(s) { return this.binl2rstr(this.binlMD5(this.rstr2binl(s), s.length * 8)) }, rstrHMACMD5(key, data) { var i; var bkey = this.rstr2binl(key); var ipad = []; var opad = []; var hash; ipad[15] = opad[15] = undefined; if (bkey.length > 16) { bkey = this.binlMD5(bkey, key.length * 8) } for (i = 0; i < 16; i += 1) { ipad[i] = bkey[i] ^ 0x36363636; opad[i] = bkey[i] ^ 0x5c5c5c5c } hash = this.binlMD5(ipad.concat(this.rstr2binl(data)), 512 + data.length * 8); return this.binl2rstr(this.binlMD5(opad.concat(hash), 512 + 128)) }, rstr2hex(input) { var hexTab = '0123456789abcdef'; var output = ''; var x; var i; for (i = 0; i < input.length; i += 1) { x = input.charCodeAt(i); output += hexTab.charAt((x >>> 4) & 0x0f) + hexTab.charAt(x & 0x0f) } return output }, str2rstrUTF8(input) { return unescape(encodeURIComponent(input)) }, rawMD5(s) { return this.rstrMD5(this.str2rstrUTF8(s)) }, hexMD5(s) { return this.rstr2hex(this.rawMD5(s)) }, rawHMACMD5(k, d) { return this.rstrHMACMD5(this.str2rstrUTF8(k), str2rstrUTF8(d)) }, hexHMACMD5(k, d) { return this.rstr2hex(this.rawHMACMD5(k, d)) }, md5(string, key, raw) { if (!key) { if (!raw) { return this.hexMD5(string) } return this.rawMD5(string) } if (!raw) { return this.hexHMACMD5(key, string) } return this.rawHMACMD5(key, string) }, getSig(requestParam, sk, feature, mode) { var sig = null; var requestArr = []; Object.keys(requestParam).sort().forEach(function (key) { requestArr.push(key + '=' + requestParam[key]) }); if (feature == 'search') { sig = '/ws/place/v1/search?' + requestArr.join('&') + sk } if (feature == 'suggest') { sig = '/ws/place/v1/suggestion?' + requestArr.join('&') + sk } if (feature == 'reverseGeocoder') { sig = '/ws/geocoder/v1/?' + requestArr.join('&') + sk } if (feature == 'geocoder') { sig = '/ws/geocoder/v1/?' + requestArr.join('&') + sk } if (feature == 'getCityList') { sig = '/ws/district/v1/list?' + requestArr.join('&') + sk } if (feature == 'getDistrictByCityId') { sig = '/ws/district/v1/getchildren?' + requestArr.join('&') + sk } if (feature == 'calculateDistance') { sig = '/ws/distance/v1/?' + requestArr.join('&') + sk } if (feature == 'direction') { sig = '/ws/direction/v1/' + mode + '?' + requestArr.join('&') + sk } sig = this.md5(sig); return sig }, location2query(data) { if (typeof data == 'string') { return data } var query = ''; for (var i = 0; i < data.length; i++) { var d = data[i]; if (!!query) { query += ';' } if (d.location) { query = query + d.location.lat + ',' + d.location.lng } if (d.latitude && d.longitude) { query = query + d.latitude + ',' + d.longitude } } return query }, rad(d) { return d * Math.PI / 180.0 }, getEndLocation(location) { var to = location.split(';'); var endLocation = []; for (var i = 0; i < to.length; i++) { endLocation.push({ lat: parseFloat(to[i].split(',')[0]), lng: parseFloat(to[i].split(',')[1]) }) } return endLocation }, getDistance(latFrom, lngFrom, latTo, lngTo) { var radLatFrom = this.rad(latFrom); var radLatTo = this.rad(latTo); var a = radLatFrom - radLatTo; var b = this.rad(lngFrom) - this.rad(lngTo); var distance = 2 * Math.asin(Math.sqrt(Math.pow(Math.sin(a / 2), 2) + Math.cos(radLatFrom) * Math.cos(radLatTo) * Math.pow(Math.sin(b / 2), 2))); distance = distance * EARTH_RADIUS; distance = Math.round(distance * 10000) / 10000; return parseFloat(distance.toFixed(0)) }, getWXLocation(success, fail, complete) { wx.getLocation({ type: 'gcj02', success: success, fail: fail, complete: complete }) }, getLocationParam(location) { if (typeof location == 'string') { var locationArr = location.split(','); if (locationArr.length === 2) { location = { latitude: location.split(',')[0], longitude: location.split(',')[1] } } else { location = {} } } return location }, polyfillParam(param) { param.success = param.success || function () { }; param.fail = param.fail || function () { }; param.complete = param.complete || function () { } }, checkParamKeyEmpty(param, key) { if (!param[key]) { var errconf = this.buildErrorConfig(ERROR_CONF.PARAM_ERR, ERROR_CONF.PARAM_ERR_MSG + key + '鍙傛暟鏍煎紡鏈夎'); param.fail(errconf); param.complete(errconf); return true } return false }, checkKeyword(param) { return !this.checkParamKeyEmpty(param, 'keyword') }, checkLocation(param) { var location = this.getLocationParam(param.location); if (!location || !location.latitude || !location.longitude) { var errconf = this.buildErrorConfig(ERROR_CONF.PARAM_ERR, ERROR_CONF.PARAM_ERR_MSG + ' location鍙傛暟鏍煎紡鏈夎'); param.fail(errconf); param.complete(errconf); return false } return true }, buildErrorConfig(errCode, errMsg) { return { status: errCode, message: errMsg } }, handleData(param, data, feature) { if (feature == 'search') { var searchResult = data.data; var searchSimplify = []; for (var i = 0; i < searchResult.length; i++) { searchSimplify.push({ id: searchResult[i].id || null, title: searchResult[i].title || null, latitude: searchResult[i].location && searchResult[i].location.lat || null, longitude: searchResult[i].location && searchResult[i].location.lng || null, address: searchResult[i].address || null, category: searchResult[i].category || null, tel: searchResult[i].tel || null, adcode: searchResult[i].ad_info && searchResult[i].ad_info.adcode || null, city: searchResult[i].ad_info && searchResult[i].ad_info.city || null, district: searchResult[i].ad_info && searchResult[i].ad_info.district || null, province: searchResult[i].ad_info && searchResult[i].ad_info.province || null }) } param.success(data, { searchResult: searchResult, searchSimplify: searchSimplify }) } else if (feature == 'suggest') { var suggestResult = data.data; var suggestSimplify = []; for (var i = 0; i < suggestResult.length; i++) { suggestSimplify.push({ adcode: suggestResult[i].adcode || null, address: suggestResult[i].address || null, category: suggestResult[i].category || null, city: suggestResult[i].city || null, district: suggestResult[i].district || null, id: suggestResult[i].id || null, latitude: suggestResult[i].location && suggestResult[i].location.lat || null, longitude: suggestResult[i].location && suggestResult[i].location.lng || null, province: suggestResult[i].province || null, title: suggestResult[i].title || null, type: suggestResult[i].type || null }) } param.success(data, { suggestResult: suggestResult, suggestSimplify: suggestSimplify }) } else if (feature == 'reverseGeocoder') { var reverseGeocoderResult = data.result; var reverseGeocoderSimplify = { address: reverseGeocoderResult.address || null, latitude: reverseGeocoderResult.location && reverseGeocoderResult.location.lat || null, longitude: reverseGeocoderResult.location && reverseGeocoderResult.location.lng || null, adcode: reverseGeocoderResult.ad_info && reverseGeocoderResult.ad_info.adcode || null, city: reverseGeocoderResult.address_component && reverseGeocoderResult.address_component.city || null, district: reverseGeocoderResult.address_component && reverseGeocoderResult.address_component.district || null, nation: reverseGeocoderResult.address_component && reverseGeocoderResult.address_component.nation || null, province: reverseGeocoderResult.address_component && reverseGeocoderResult.address_component.province || null, street: reverseGeocoderResult.address_component && reverseGeocoderResult.address_component.street || null, street_number: reverseGeocoderResult.address_component && reverseGeocoderResult.address_component.street_number || null, recommend: reverseGeocoderResult.formatted_addresses && reverseGeocoderResult.formatted_addresses.recommend || null, rough: reverseGeocoderResult.formatted_addresses && reverseGeocoderResult.formatted_addresses.rough || null }; if (reverseGeocoderResult.pois) { var pois = reverseGeocoderResult.pois; var poisSimplify = []; for (var i = 0; i < pois.length; i++) { poisSimplify.push({ id: pois[i].id || null, title: pois[i].title || null, latitude: pois[i].location && pois[i].location.lat || null, longitude: pois[i].location && pois[i].location.lng || null, address: pois[i].address || null, category: pois[i].category || null, adcode: pois[i].ad_info && pois[i].ad_info.adcode || null, city: pois[i].ad_info && pois[i].ad_info.city || null, district: pois[i].ad_info && pois[i].ad_info.district || null, province: pois[i].ad_info && pois[i].ad_info.province || null }) } param.success(data, { reverseGeocoderResult: reverseGeocoderResult, reverseGeocoderSimplify: reverseGeocoderSimplify, pois: pois, poisSimplify: poisSimplify }) } else { param.success(data, { reverseGeocoderResult: reverseGeocoderResult, reverseGeocoderSimplify: reverseGeocoderSimplify }) } } else if (feature == 'geocoder') { var geocoderResult = data.result; var geocoderSimplify = { title: geocoderResult.title || null, latitude: geocoderResult.location && geocoderResult.location.lat || null, longitude: geocoderResult.location && geocoderResult.location.lng || null, adcode: geocoderResult.ad_info && geocoderResult.ad_info.adcode || null, province: geocoderResult.address_components && geocoderResult.address_components.province || null, city: geocoderResult.address_components && geocoderResult.address_components.city || null, district: geocoderResult.address_components && geocoderResult.address_components.district || null, street: geocoderResult.address_components && geocoderResult.address_components.street || null, street_number: geocoderResult.address_components && geocoderResult.address_components.street_number || null, level: geocoderResult.level || null }; param.success(data, { geocoderResult: geocoderResult, geocoderSimplify: geocoderSimplify }) } else if (feature == 'getCityList') { var provinceResult = data.result[0]; var cityResult = data.result[1]; var districtResult = data.result[2]; param.success(data, { provinceResult: provinceResult, cityResult: cityResult, districtResult: districtResult }) } else if (feature == 'getDistrictByCityId') { var districtByCity = data.result[0]; param.success(data, districtByCity) } else if (feature == 'calculateDistance') { var calculateDistanceResult = data.result.elements; var distance = []; for (var i = 0; i < calculateDistanceResult.length; i++) { distance.push(calculateDistanceResult[i].distance) } param.success(data, { calculateDistanceResult: calculateDistanceResult, distance: distance }) } else if (feature == 'direction') { var direction = data.result.routes; param.success(data, direction) } else { param.success(data) } }, buildWxRequestConfig(param, options, feature) { var that = this; options.header = { "content-type": "application/json" }; options.method = 'GET'; options.success = function (res) { var data = res.data; if (data.status === 0) { that.handleData(param, data, feature) } else { param.fail(data) } }; options.fail = function (res) { res.statusCode = ERROR_CONF.WX_ERR_CODE; param.fail(that.buildErrorConfig(ERROR_CONF.WX_ERR_CODE, res.errMsg)) }; options.complete = function (res) { var statusCode = +res.statusCode; switch (statusCode) { case ERROR_CONF.WX_ERR_CODE: { param.complete(that.buildErrorConfig(ERROR_CONF.WX_ERR_CODE, res.errMsg)); break } case ERROR_CONF.WX_OK_CODE: { var data = res.data; if (data.status === 0) { param.complete(data) } else { param.complete(that.buildErrorConfig(data.status, data.message)) } break } default: { param.complete(that.buildErrorConfig(ERROR_CONF.SYSTEM_ERR, ERROR_CONF.SYSTEM_ERR_MSG)) } } }; return options }, locationProcess(param, locationsuccess, locationfail, locationcomplete) { var that = this; locationfail = locationfail || function (res) { res.statusCode = ERROR_CONF.WX_ERR_CODE; param.fail(that.buildErrorConfig(ERROR_CONF.WX_ERR_CODE, res.errMsg)) }; locationcomplete = locationcomplete || function (res) { if (res.statusCode == ERROR_CONF.WX_ERR_CODE) { param.complete(that.buildErrorConfig(ERROR_CONF.WX_ERR_CODE, res.errMsg)) } }; if (!param.location) { that.getWXLocation(locationsuccess, locationfail, locationcomplete) } else if (that.checkLocation(param)) { var location = Utils.getLocationParam(param.location); locationsuccess(location) } } }; class QQMapWX { constructor(options) { if (!options.key) { throw Error('key鍊间笉鑳戒负绌�') } this.key = options.key }; search(options) { var that = this; options = options || {}; Utils.polyfillParam(options); if (!Utils.checkKeyword(options)) { return } var requestParam = { keyword: options.keyword, orderby: options.orderby || '_distance', page_size: options.page_size || 10, page_index: options.page_index || 1, output: 'json', key: that.key }; if (options.address_format) { requestParam.address_format = options.address_format } if (options.filter) { requestParam.filter = options.filter } var distance = options.distance || "1000"; var auto_extend = options.auto_extend || 1; var region = null; var rectangle = null; if (options.region) { region = options.region } if (options.rectangle) { rectangle = options.rectangle } var locationsuccess = function (result) { if (region && !rectangle) { requestParam.boundary = "region(" + region + "," + auto_extend + "," + result.latitude + "," + result.longitude + ")"; if (options.sig) { requestParam.sig = Utils.getSig(requestParam, options.sig, 'search') } } else if (rectangle && !region) { requestParam.boundary = "rectangle(" + rectangle + ")"; if (options.sig) { requestParam.sig = Utils.getSig(requestParam, options.sig, 'search') } } else { requestParam.boundary = "nearby(" + result.latitude + "," + result.longitude + "," + distance + "," + auto_extend + ")"; if (options.sig) { requestParam.sig = Utils.getSig(requestParam, options.sig, 'search') } } wx.request(Utils.buildWxRequestConfig(options, { url: URL_SEARCH, data: requestParam }, 'search')) }; Utils.locationProcess(options, locationsuccess) }; getSuggestion(options) { var that = this; options = options || {}; Utils.polyfillParam(options); if (!Utils.checkKeyword(options)) { return } var requestParam = { keyword: options.keyword, region: options.region || '鍏ㄥ浗', region_fix: options.region_fix || 0, policy: options.policy || 0, page_size: options.page_size || 10, page_index: options.page_index || 1, get_subpois: options.get_subpois || 0, output: 'json', key: that.key }; if (options.address_format) { requestParam.address_format = options.address_format } if (options.filter) { requestParam.filter = options.filter } if (options.location) { var locationsuccess = function (result) { requestParam.location = result.latitude + ',' + result.longitude; if (options.sig) { requestParam.sig = Utils.getSig(requestParam, options.sig, 'suggest') } wx.request(Utils.buildWxRequestConfig(options, { url: URL_SUGGESTION, data: requestParam }, "suggest")) }; Utils.locationProcess(options, locationsuccess) } else { if (options.sig) { requestParam.sig = Utils.getSig(requestParam, options.sig, 'suggest') } wx.request(Utils.buildWxRequestConfig(options, { url: URL_SUGGESTION, data: requestParam }, "suggest")) } }; reverseGeocoder(options) { var that = this; options = options || {}; Utils.polyfillParam(options); var requestParam = { coord_type: options.coord_type || 5, get_poi: options.get_poi || 0, output: 'json', key: that.key }; if (options.poi_options) { requestParam.poi_options = options.poi_options } var locationsuccess = function (result) { requestParam.location = result.latitude + ',' + result.longitude; if (options.sig) { requestParam.sig = Utils.getSig(requestParam, options.sig, 'reverseGeocoder') } wx.request(Utils.buildWxRequestConfig(options, { url: URL_GET_GEOCODER, data: requestParam }, 'reverseGeocoder')) }; Utils.locationProcess(options, locationsuccess) }; geocoder(options) { var that = this; options = options || {}; Utils.polyfillParam(options); if (Utils.checkParamKeyEmpty(options, 'address')) { return } var requestParam = { address: options.address, output: 'json', key: that.key }; if (options.region) { requestParam.region = options.region } if (options.sig) { requestParam.sig = Utils.getSig(requestParam, options.sig, 'geocoder') } wx.request(Utils.buildWxRequestConfig(options, { url: URL_GET_GEOCODER, data: requestParam }, 'geocoder')) }; getCityList(options) { var that = this; options = options || {}; Utils.polyfillParam(options); var requestParam = { output: 'json', key: that.key }; if (options.sig) { requestParam.sig = Utils.getSig(requestParam, options.sig, 'getCityList') } wx.request(Utils.buildWxRequestConfig(options, { url: URL_CITY_LIST, data: requestParam }, 'getCityList')) }; getDistrictByCityId(options) { var that = this; options = options || {}; Utils.polyfillParam(options); if (Utils.checkParamKeyEmpty(options, 'id')) { return } var requestParam = { id: options.id || '', output: 'json', key: that.key }; if (options.sig) { requestParam.sig = Utils.getSig(requestParam, options.sig, 'getDistrictByCityId') } wx.request(Utils.buildWxRequestConfig(options, { url: URL_AREA_LIST, data: requestParam }, 'getDistrictByCityId')) }; calculateDistance(options) { var that = this; options = options || {}; Utils.polyfillParam(options); if (Utils.checkParamKeyEmpty(options, 'to')) { return } var requestParam = { mode: options.mode || 'walking', to: Utils.location2query(options.to), output: 'json', key: that.key }; if (options.from) { options.location = options.from } if (requestParam.mode == 'straight') { var locationsuccess = function (result) { var locationTo = Utils.getEndLocation(requestParam.to); var data = { message: "query ok", result: { elements: [] }, status: 0 }; for (var i = 0; i < locationTo.length; i++) { data.result.elements.push({ distance: Utils.getDistance(result.latitude, result.longitude, locationTo[i].lat, locationTo[i].lng), duration: 0, from: { lat: result.latitude, lng: result.longitude }, to: { lat: locationTo[i].lat, lng: locationTo[i].lng } }) } var calculateResult = data.result.elements; var distanceResult = []; for (var i = 0; i < calculateResult.length; i++) { distanceResult.push(calculateResult[i].distance) } return options.success(data, { calculateResult: calculateResult, distanceResult: distanceResult }) }; Utils.locationProcess(options, locationsuccess) } else { var locationsuccess = function (result) { requestParam.from = result.latitude + ',' + result.longitude; if (options.sig) { requestParam.sig = Utils.getSig(requestParam, options.sig, 'calculateDistance') } wx.request(Utils.buildWxRequestConfig(options, { url: URL_DISTANCE, data: requestParam }, 'calculateDistance')) }; Utils.locationProcess(options, locationsuccess) } }; direction(options) { var that = this; options = options || {}; Utils.polyfillParam(options); if (Utils.checkParamKeyEmpty(options, 'to')) { return } var requestParam = { output: 'json', key: that.key }; if (typeof options.to == 'string') { requestParam.to = options.to } else { requestParam.to = options.to.latitude + ',' + options.to.longitude } var SET_URL_DIRECTION = null; options.mode = options.mode || MODE.driving; SET_URL_DIRECTION = URL_DIRECTION + options.mode; if (options.from) { options.location = options.from } if (options.mode == MODE.driving) { if (options.from_poi) { requestParam.from_poi = options.from_poi } if (options.heading) { requestParam.heading = options.heading } if (options.speed) { requestParam.speed = options.speed } if (options.accuracy) { requestParam.accuracy = options.accuracy } if (options.road_type) { requestParam.road_type = options.road_type } if (options.to_poi) { requestParam.to_poi = options.to_poi } if (options.from_track) { requestParam.from_track = options.from_track } if (options.waypoints) { requestParam.waypoints = options.waypoints } if (options.policy) { requestParam.policy = options.policy } if (options.plate_number) { requestParam.plate_number = options.plate_number } } if (options.mode == MODE.transit) { if (options.departure_time) { requestParam.departure_time = options.departure_time } if (options.policy) { requestParam.policy = options.policy } } var locationsuccess = function (result) { requestParam.from = result.latitude + ',' + result.longitude; if (options.sig) { requestParam.sig = Utils.getSig(requestParam, options.sig, 'direction', options.mode) } wx.request(Utils.buildWxRequestConfig(options, { url: SET_URL_DIRECTION, data: requestParam }, 'direction')) }; Utils.locationProcess(options, locationsuccess) } }; module.exports = QQMapWX;
\ No newline at end of file
diff --git a/wechat_jiaxuan/utils/request.js b/wechat_jiaxuan/utils/request.js
index 7d34329..b58d028 100644
--- a/wechat_jiaxuan/utils/request.js
+++ b/wechat_jiaxuan/utils/request.js
@@ -19,7 +19,7 @@
if (res.data.code === 200) {
resolve(res.data || true)
} else {
- if(res.data.code && res.data.code == 5112){
+ if(res.data.code == 5111 && res.data.code == 5112){
wx.navigateTo({
url: '/pages/auth/auth',
})
diff --git a/wechat_staff/api/index.js b/wechat_staff/api/index.js
index 982312f..2c30b26 100644
--- a/wechat_staff/api/index.js
+++ b/wechat_staff/api/index.js
@@ -2,10 +2,24 @@
import { baseUrl } from '../utils/config'
export const uploadUrl = baseUrl + '/public/upload'
-// 灏忕▼搴忕櫥褰�
+// 灏忕▼搴� 榛樿鐧诲綍
export const wxLoginCustomer = (data) => {
return request({
- url: '/web/customer/wxLoginCustomer',
+ url: '/web/personnel/loginByWx',
+ data
+ })
+}
+// 楠岃瘉鐮佺櫥褰�
+export const loginByPhone = (data) => {
+ return request({
+ url: '/web/personnel/loginByPhone',
+ data
+ })
+}
+// 鍙戦�侀獙璇佺爜
+export const sendSms = (data) => {
+ return request({
+ url: '/web/personnel/sendSms',
data
})
}
@@ -36,7 +50,53 @@
// 鑾峰彇浼氬憳淇℃伅
export const getMemberInfo = () => {
return request({
- url: '/web/customer/getMemberInfo',
+ url: '/web/personnel/getUserDetail',
+ })
+}
+// 棣栭〉 姣忔棩涓婃柊
+export const getDailyUpdates = (data) => {
+ return request({
+ url: '/web/customer/getDailyUpdates',
+ data
+ })
+}
+// 棣栭〉 鎺ㄥ箍鍜ㄨ鍒嗛〉
+export const newsPage = (data) => {
+ return request({
+ url: '/web/customer/newsPage',
+ data,
+ method: "POST"
+ })
+}
+// 棣栭〉 蹇楄瑁呬慨
+export const getZSZXCatalogs = () => {
+ return request({
+ url: '/web/customer/getZSZXCatalogs',
+ method: "POST"
+ })
+}
+// 蹇楄瑁呬慨 鏍囩
+export const getCataLogTagList = (data) => {
+ return request({
+ url: '/web/customer/getCataLogTagList',
+ method: "POST",
+ data
+ })
+}
+// 涓嘲 鍒嗙被鏁版嵁
+export const getCatalogList = (data) => {
+ return request({
+ url: '/web/customer/getCatalogList',
+ method: "POST",
+ data
+ })
+}
+// 蹇楄瑁呬慨 鍐呭
+export const pageZSZXContentList = (data) => {
+ return request({
+ url: '/web/customer/pageContentList',
+ method: "POST",
+ data
})
}
// 鑾峰彇闂ㄥ簵鍒楄〃
diff --git a/wechat_staff/app.js b/wechat_staff/app.js
index 3dc96bb..238768a 100644
--- a/wechat_staff/app.js
+++ b/wechat_staff/app.js
@@ -1,4 +1,4 @@
-// app.js
+import { wxLoginCustomer } from './api/index'
App({
globalData: {
primary: '#B08771',
@@ -11,6 +11,38 @@
this.globalData.bottomLift = WindowInfo.screenHeight - WindowInfo.safeArea.bottom;
}
//
- // let menuButtonInfo = wx.getMenuButtonBoundingClientRect();
+ return
+ const res = wx.getStorageSync('member')
+ if (res) {
+ this.globalData.userInfo = res
+ } else {
+ // 鐧诲綍
+ wx.login({
+ timeout: 5000,
+ success(res) {
+ if (res.code) {
+ //鍙戣捣缃戠粶璇锋眰
+ wxLoginCustomer({
+ code: res.code
+ }).then(res => {
+ console.log(res)
+ if (res && res.data.member) {
+ wx.setStorageSync('member', res.data.member)
+ wx.setStorageSync('openid', res.data.member.openid)
+ wx.setStorageSync('sessionKey', res.data.sessionKey)
+ wx.setStorageSync('token', res.data.token)
+ } else {
+ console.log('鐧诲綍澶辫触锛�')
+ }
+ })
+ } else {
+ console.log('鐧诲綍澶辫触锛�' + res)
+ }
+ },
+ fail(err) {
+ console.log(err)
+ }
+ })
+ }
}
})
diff --git a/wechat_staff/pages/homeId/index.js b/wechat_staff/pages/homeId/index.js
index 22a8ed7..4b5c569 100644
--- a/wechat_staff/pages/homeId/index.js
+++ b/wechat_staff/pages/homeId/index.js
@@ -1,17 +1,27 @@
-// pages/consult/consult.js
+import { getCataLogTagList, pageZSZXContentList } from '../../api/index'
Page({
/**
* 椤甸潰鐨勫垵濮嬫暟鎹�
*/
data: {
- category: ['鏂板搧涓婂競', '涓撳埄璇佷功', '澶х墝鎺堟潈','鏂板搧涓婂競', '涓撳埄璇佷功', '澶х墝鎺堟潈'],
- secondCategory: ['绾у垎绫�','绾у垎绫�','绾у垎绫�','绾у垎绫�','绾у垎绫�','绾у垎绫�'],
+ tagList: [],
activeCate: '',
- seActiveCate: '',
- dataList: []
- },
+ dataList: [],
+ pageNum: 1,
+ pageSize: 10,
+ code: '',
+ tagCodes: ''
+ },
+ onLoad(options) {
+ wx.setNavigationBarTitle({
+ title: options.name
+ })
+ this.setData({ code: options.code})
+ this.getTabList()
+ this.getList()
+ },
itemClick(e) {
const { id } = e.target.dataset
console.log(e.target.dataset);
@@ -20,20 +30,42 @@
})
},
cateClick(e) {
- const { index } = e.target.dataset
- console.log(index);
+ const { code } = e.target.dataset
+ this.setData({
+ tagCodes: code,
+ pageNum: 1,
+ dataList: []
+ })
+ this.getList()
},
- seCateClick(e) {
- const { index } = e.target.dataset
- console.log(index);
+ getTabList() {
+ getCataLogTagList({
+ catalogCode: this.data.code
+ }).then(res => {
+ if(res && res.data && res.data.length > 0){
+ this.setData({
+ tagList: res.data[0].valueVos
+ })
+ }
+
+ })
},
- onLoad(options) {
+ getList(){
+ const { code, tagCodes, pageSize, pageNum } = this.data
+ pageZSZXContentList({
+ catalogCode: code,
+ tagCodes,
+ pageSize,
+ pageNum
+ }).then(res => {
+ this.setData({
+ dataList: [ ...this.data.dataList, ...res.data.records ]
+ })
+ })
+ },
+ onReachBottom() {
},
-
- /**
- * 鐢熷懡鍛ㄦ湡鍑芥暟--鐩戝惉椤甸潰鍒濇娓叉煋瀹屾垚
- */
onReady() {
},
diff --git a/wechat_staff/pages/homeId/index.json b/wechat_staff/pages/homeId/index.json
index 87306f3..2303215 100644
--- a/wechat_staff/pages/homeId/index.json
+++ b/wechat_staff/pages/homeId/index.json
@@ -1,3 +1,3 @@
{
- "navigationBarTitleText": "瀹剁殑ID"
+ "navigationBarTitleText": ""
}
\ No newline at end of file
diff --git a/wechat_staff/pages/homeId/index.wxml b/wechat_staff/pages/homeId/index.wxml
index 0df64fd..cbab1ae 100644
--- a/wechat_staff/pages/homeId/index.wxml
+++ b/wechat_staff/pages/homeId/index.wxml
@@ -1,25 +1,25 @@
<view class="container">
- <!-- 鍒嗙被 -->
- <view>
- <scroll-view scroll-x="true" style="weight: 710rpx;margin-bottom: 30rpx;">
- <view class="scroll_cate">
- <view bindtap="cateClick" data-index="{{index}}" wx:for="{{ category }}" class="item {{ index == 0 ? 'active': '' }}">{{ item }}</view>
- </view>
- </scroll-view>
- </view>
- <!-- content -->
- <view class="content">
- <view class="item" bindtap="itemClick" data-abg="qwe">
- <image class="img" src="../../static/icon/test.png" mode="widthFix"></image>
- <view class="title">鍚婄伅瀹炵敤鐗硅緫 | 涓�姝ュ浼氱悊鎯冲厜褰卞竷灞�</view>
- <view class="df_sb static">
- <view>{{ '2021-08-21 12:00:00' }}</view>
- <view class="df_sb">
- <image class="liulan" src="../../static/icon/zixun_ic_liulan.png" mode="widthFix"></image>
- <text>1000</text>
- </view>
+<!-- 鍒嗙被 -->
+<view>
+ <scroll-view scroll-x="true" style="weight: 710rpx;margin-bottom: 30rpx;">
+ <view class="scroll_cate">
+ <view bindtap="cateClick" data-code="{{item.labelValueCode}}" wx:for="{{ tagList }}" class="item {{ tagCodes == item.labelValueCode ? 'active': '' }}">{{ item.labelValueName }}</view>
+ </view>
+ </scroll-view>
+</view>
+<!-- content -->
+<view class="content">
+ <view wx:for="{{ dataList }}" class="item" bindtap="itemClick" data-abg="qwe">
+ <image class="img" src="{{ item.coverImage }}" mode="widthFix"></image>
+ <view class="title">{{ item.title }}</view>
+ <view class="df_sb static">
+ <view>{{ item.publishDate }}</view>
+ <view class="df_sb">
+ <image class="liulan" src="../../static/icon/zixun_ic_liulan.png" mode="widthFix"></image>
+ <text>{{ item.readCount }}</text>
</view>
</view>
</view>
+</view>
</view>
\ No newline at end of file
diff --git a/wechat_staff/pages/index/index.js b/wechat_staff/pages/index/index.js
index 1f8cb47..4d44bd6 100644
--- a/wechat_staff/pages/index/index.js
+++ b/wechat_staff/pages/index/index.js
@@ -1,10 +1,12 @@
-// index.js
+import { getDictData, getDailyUpdates, getZSZXCatalogs } from '../../api/index'
Page({
data: {
searchValue: '',
clientHeight: 0,
clientTop: 0,
+ DailyUpdates: {}, //姣忔棩涓婃柊
+ everydayTop: ['../../static/ic_top1@2x.png', '../../static/ic_top2@2x.png', '../../static/ic_top3@2x.png'],
bannerList: [
{imgurl: ''},
{imgurl: 'adsa.png'},
@@ -24,5 +26,50 @@
const res = wx.getMenuButtonBoundingClientRect()
this.setData({clientHeight: res.height})
this.setData({clientTop: res.top})
- }
+
+ this.initData()
+ },
+ initData() {
+ // 姣忔棩涓婃柊
+ getDailyUpdates({
+ fileType: '0'
+ }).then(res => {
+ this.setData({ DailyUpdates: res.data })
+ })
+ getZSZXCatalogs().then(res => { //蹇楄瑁呬慨
+ this.setData({
+ ZSZXCata: res.data || {}
+ })
+ })
+ getDictData({
+ code: 'WEIXIN_DEFAULT_IMGS',
+ label: 'HOME_CLASS_A'
+ }).then(res => {
+ this.setData({ HOME_CLASS_A: res.data.code })
+ })
+ getDictData({
+ code: 'WEIXIN_DEFAULT_IMGS',
+ label: 'HOME_CLASS_B'
+ }).then(res => {
+ this.setData({ HOME_CLASS_B: res.data.code })
+ })
+ getDictData({
+ code: 'WEIXIN_DEFAULT_IMGS',
+ label: 'HOME_CLASS_B2'
+ }).then(res => {
+ this.setData({ HOME_CLASS_B2: res.data.code })
+ })
+ getDictData({
+ code: 'WEIXIN_DEFAULT_IMGS',
+ label: 'HOME_CLASS_C'
+ }).then(res => {
+ this.setData({ HOME_CLASS_C: res.data.code })
+ })
+ },
+ changeStrategy(e) {
+ let item = e.currentTarget.dataset.item
+ wx.navigateTo({
+ url: `/pages/homeId/index?code=${item.code}&name=${item.name}` ,
+ })
+ },
})
diff --git a/wechat_staff/pages/index/index.less b/wechat_staff/pages/index/index.less
index 8471951..9ba6c5e 100644
--- a/wechat_staff/pages/index/index.less
+++ b/wechat_staff/pages/index/index.less
@@ -72,7 +72,7 @@
width: 192rpx;
height: 280rpx;
border-radius: 8rpx;
- border: 1px solid;
+ overflow: hidden;
position: relative;
.img{
width: 100%;
@@ -101,7 +101,6 @@
image{
width: 88rpx;
height: 88rpx;
- border: 1px solid;
}
.text{
font-size: 26rpx;
@@ -124,10 +123,21 @@
.strategy {
padding: 80rpx 40rpx;
background: #F7F7F7;
-
- image {
- width: 100%;
- height: 100%;
+ .item{
+ position: relative;
+ image {
+ width: 100%;
+ height: 100%;
+ position: absolute;
+ }
+ text{
+ color: #fff;
+ position: absolute;
+ bottom: 40rpx;
+ left: 40rpx;
+ font-size: 32rpx;
+ font-weight: 500;
+ }
}
.line {
diff --git a/wechat_staff/pages/index/index.wxml b/wechat_staff/pages/index/index.wxml
index ddac59b..0ba4ce2 100644
--- a/wechat_staff/pages/index/index.wxml
+++ b/wechat_staff/pages/index/index.wxml
@@ -15,41 +15,33 @@
<view class="desc">
<view class="left">
<text>浠婃棩涓婃柊锛�</text>
- <text class="num">5</text>
+ <text class="num">{{ DailyUpdates.dailyUpdateNum }}</text>
<text>鏉�</text>
</view>
- <view class="right">1w鍔犲凡杞彂</view>
+ <view class="right">{{ DailyUpdates.shareNum }}w鍔犲凡杞彂</view>
</view>
<view class="imgs">
- <view class="img_wrap">
- <image class="img" mode="widthFix" src=""></image>
- <image class="icon" src="../../static/ic_top1@2x.png" mode="widthFix"></image>
- </view>
- <view class="img_wrap">
- <image class="img" mode="widthFix" src=""></image>
- <image class="icon" src="../../static/ic_top2@2x.png" mode="widthFix"></image>
- </view>
- <view class="img_wrap">
- <image class="img" mode="widthFix" src=""></image>
- <image class="icon" src="../../static/ic_top3@2x.png" mode="widthFix"></image>
+ <view wx:for="{{ DailyUpdates.newsList}}" class="img_wrap">
+ <image class="img" src="{{ item.fileList[0].fileurlFull }}" mode="widthFix"></image>
+ <image class="icon" src="{{everydayTop[index]}}" mode="widthFix"></image>
</view>
</view>
</view>
<!-- -->
<view class="func_lsit">
<view class="item">
- <image></image>
+ <image src="../../static/icon/home_ic_chanpin@2x 2.png"></image>
<view class="text">浜у搧</view>
</view>
<view class="item">
- <image></image>
+ <image src="../../static/icon/home_ic_anli@2x 2.png"></image>
<view class="text">妗堜緥</view>
</view>
<view class="item">
- <image></image>
+ <image src="../../static/icon/home_ic_shijing@2x 2.png"></image>
<view class="text">瀹炴櫙</view>
</view><view class="item">
- <image></image>
+ <image src="../../static/icon/home_ic_zixun.png"></image>
<view class="text">璧勮</view>
</view>
@@ -74,23 +66,31 @@
<view class="com_header">
<view class="left">
<view class="name">
- <image class="icon" src="../../static/home_ic_zhuangxiu@2x.png"></image>
+ <image class="icon" src="../../static/icon/home_ic_zhuangxiu@2x.png"></image>
<view>蹇楄瑁呬慨</view>
</view>
<view class="desc">鏈�鍏ㄧ殑瑁呬慨鏀荤暐鏉ヤ簡锛屽揩鏉et璧锋潵</view>
</view>
</view>
<view class="line">
- <view class="line_left">
- <image src="../../static/images/home_class_a@2x.png"></image>
+ <view class="line_left item" data-item="{{ ZSZXCata.jdId }}" bindtap="changeStrategy">
+ <image src="{{HOME_CLASS_A}}"></image>
+ <text>{{ ZSZXCata.jdId.name }}</text>
</view>
<view class="line_right">
- <view class="item"><image src="../../static/images/home_class_b@2x.png"></image></view>
- <view class="item"><image src="../../static/images/home_class_b2@2x.png"></image></view>
+ <view class="item" data-item="{{ ZSZXCata.cfsj }}" bindtap="changeStrategy">
+ <image src="{{ HOME_CLASS_B }}"></image>
+ <text>{{ ZSZXCata.cfsj.name }}</text>
+ </view>
+ <view class="item" data-item="{{ ZSZXCata.snsj }}" bindtap="changeStrategy">
+ <image src="{{ HOME_CLASS_B2 }}"></image>
+ <text>{{ ZSZXCata.snsj.name }}</text>
+ </view>
</view>
</view>
- <view class="home_id">
- <image src="../../static/images/home_class_c@2x.png"></image>
+ <view data-item="{{ ZSZXCata.qwsj.code }}" bindtap="changeStrategy" class="home_id item">
+ <image src="{{HOME_CLASS_C}}"></image>
+ <text>{{ ZSZXCata.qwsj.name }}</text>
</view>
</view>
<!-- service -->
diff --git a/wechat_staff/pages/index/index.wxss b/wechat_staff/pages/index/index.wxss
index 9279d9d..8ffab5f 100644
--- a/wechat_staff/pages/index/index.wxss
+++ b/wechat_staff/pages/index/index.wxss
@@ -65,7 +65,7 @@
width: 192rpx;
height: 280rpx;
border-radius: 8rpx;
- border: 1px solid;
+ overflow: hidden;
position: relative;
}
.everyday .imgs .img_wrap .img {
@@ -93,7 +93,6 @@
.func_lsit .item image {
width: 88rpx;
height: 88rpx;
- border: 1px solid;
}
.func_lsit .item .text {
font-size: 26rpx;
@@ -112,9 +111,21 @@
padding: 80rpx 40rpx;
background: #F7F7F7;
}
-.strategy image {
+.strategy .item {
+ position: relative;
+}
+.strategy .item image {
width: 100%;
height: 100%;
+ position: absolute;
+}
+.strategy .item text {
+ color: #fff;
+ position: absolute;
+ bottom: 40rpx;
+ left: 40rpx;
+ font-size: 32rpx;
+ font-weight: 500;
}
.strategy .line {
display: flex;
diff --git a/wechat_staff/pages/login/index.js b/wechat_staff/pages/login/index.js
index a578bb5..15689ba 100644
--- a/wechat_staff/pages/login/index.js
+++ b/wechat_staff/pages/login/index.js
@@ -1,4 +1,4 @@
-// pages/auth/auth.js
+import { sendSms,loginByPhone, getDictData } from '../../api/index'
Page({
/**
@@ -9,21 +9,65 @@
primary: '',
status: '0', // 鏍囪瘑
countDown: 0,
- phone: '',
- password: '',
+ phone: '13663966099',
+ code: '',
+
+ showModal: false,
+ activeHtml: '',
},
getCode() {
let countDown = this.data.countDown
if(countDown > 0) return
- this.setData({ countDown: 60 })
- let timer = setInterval(() => {
- let countDown = this.data.countDown
- if(countDown === 0){
- return clearInterval(timer)
- }
- countDown --
- this.setData({ countDown })
- }, 1000)
+ const { phone } = this.data
+ if(!phone || phone.length != 11){
+ return wx.showToast({
+ title: '璇疯緭鍏ユ纭殑鎵嬫満鍙�',
+ icon: 'none'
+ })
+ }
+ sendSms({
+ phone
+ }).then(res => {
+ wx.showToast({
+ title: '楠岃瘉鐮佸彂閫佹垚鍔�',
+ icon: 'none'
+ })
+ this.setData({ countDown: 60 })
+ let timer = setInterval(() => {
+ let countDown = this.data.countDown
+ if(countDown === 0){
+ return clearInterval(timer)
+ }
+ countDown --
+ this.setData({ countDown })
+ }, 1000)
+ })
+ },
+ loginPhone() {
+ const { code, phone } = this.data
+ loginByPhone({code, phone}).then(res => {
+ wx.setStorageSync('member', res.data.users)
+ wx.setStorageSync('token', res.data.token)
+ wx.showToast({
+ title: '鐧诲綍鎴愬姛',
+ })
+ setTimeout(() => {
+ wx.switchTab({
+ url: '/pages/index/index',
+ })
+ }, 300)
+ })
+ },
+ changeStatus() {
+ if(!this.data.agreementFalg){
+ return wx.showToast({
+ title: '璇峰厛闃呰骞跺悓鎰忕浉鍏冲崗璁�',
+ icon: 'none'
+ })
+ }
+ this.setData({
+ status: '1'
+ })
},
agreementChange(e) {
this.setData({
@@ -35,6 +79,37 @@
this.setData({
primary: app.primary
})
+ this.initData()
+ },
+ onOpen(e){
+ const { serviceHtml, privacyHtml } = this.data
+ const { index } = e.target.dataset
+ let activeHtml = index == '0' ? serviceHtml : privacyHtml
+ this.setData({
+ activeHtml,
+ showModal: true
+ })
+ },
+ onClose() {
+ this.setData({showModal: false})
+ },
+ initData(){
+ getDictData({
+ code: 'ZBOM_CUSTOMIZED',
+ label: 'SERVER_AGREEMENT'
+ }).then(res => {
+ this.setData({
+ serviceHtml: res.data.code
+ })
+ })
+ getDictData({
+ code: 'ZBOM_CUSTOMIZED',
+ label: 'PRIVACY_AGREEMENT'
+ }).then(res => {
+ this.setData({
+ privacyHtml: res.data.code
+ })
+ })
},
/**
diff --git a/wechat_staff/pages/login/index.json b/wechat_staff/pages/login/index.json
index 9a23ce5..16640fe 100644
--- a/wechat_staff/pages/login/index.json
+++ b/wechat_staff/pages/login/index.json
@@ -1,7 +1,8 @@
{
"usingComponents": {
"van-checkbox": "@vant/weapp/checkbox/index",
- "van-field": "@vant/weapp/field/index"
+ "van-field": "@vant/weapp/field/index",
+ "van-popup": "@vant/weapp/popup/index"
},
"navigationStyle": "default",
"navigationBarTitleText": "鐧诲綍"
diff --git a/wechat_staff/pages/login/index.less b/wechat_staff/pages/login/index.less
index 5d14858..c1e6740 100644
--- a/wechat_staff/pages/login/index.less
+++ b/wechat_staff/pages/login/index.less
@@ -58,4 +58,9 @@
flex: 1;
}
}
+}
+.modal{
+ width: 600rpx;
+ min-height: 600rpx;
+ padding: 30rpx;
}
\ No newline at end of file
diff --git a/wechat_staff/pages/login/index.wxml b/wechat_staff/pages/login/index.wxml
index 9fe6288..5e6cc05 100644
--- a/wechat_staff/pages/login/index.wxml
+++ b/wechat_staff/pages/login/index.wxml
@@ -6,30 +6,35 @@
<view class="btns">
<block wx:if="{{ status == '0' }}">
<view class="btn speedy">鎵嬫満鍙峰揩鎹风櫥褰�</view>
- <view class="btn">鎵嬫満楠岃瘉鐮佺櫥褰�</view>
+ <view bindtap="changeStatus" class="btn">鎵嬫満楠岃瘉鐮佺櫥褰�</view>
</block>
<block wx:if="{{ status == '1' }}">
<view class="line">
<image class="icon" src="../../static/login_ic_phone@2x.png" mode="widthFix"></image>
- <van-field class="input" border="{{false}}" model:value="{{ phone }}" placeholder="璇疯緭鍏ユ墜鏈哄彿" />
+ <van-field class="input" maxlength="{{ 11 }}" border="{{false}}" model:value="{{ phone }}" placeholder="璇疯緭鍏ユ墜鏈哄彿" />
<view bindtap="getCode" wx:if="{{ countDown === 0 }}" class="get_code primary">鑾峰彇楠岃瘉鐮�</view>
<view wx:else class="placeholder9">{{ countDown }}s</view>
</view>
<view class="line">
<image class="icon" src="../../static/login_ic_password@2x.png" mode="widthFix"></image>
- <van-field class="input" border="{{false}}" model:value="{{ password }}" placeholder="璇疯緭鍏ラ獙璇佺爜" />
+ <van-field class="input" maxlength="{{ 6 }}" border="{{false}}" model:value="{{ code }}" placeholder="璇疯緭鍏ラ獙璇佺爜" />
</view>
- <view class="btn speedy sub_btn">绔嬪嵆鐧诲綍</view>
+ <view bindtap="loginPhone" class="btn speedy sub_btn">绔嬪嵆鐧诲綍</view>
</block>
<view class="protocol">
<van-checkbox value="{{ agreementFalg }}" checked-color="{{primary}}" shape="round" bind:change="agreementChange"></van-checkbox>
<view class="content">
<text>鎴戝凡闃呰骞跺悓鎰�</text>
- <text class="primary">銆奪BOM鐢ㄦ埛鏈嶅姟鍗忚銆�</text>
+ <text data-index="0" bindtap="onOpen" class="primary">銆奪BOM鐢ㄦ埛鏈嶅姟鍗忚銆�</text>
<text>鍙�</text>
- <text class="primary">銆奪BOM鐢ㄦ埛闅愮鏀跨瓥銆�</text>
+ <text data-index="1" bindtap="onOpen" class="primary">銆奪BOM鐢ㄦ埛闅愮鏀跨瓥銆�</text>
</view>
</view>
</view>
-
+ <!-- -->
+ <van-popup show="{{ showModal }}" round bind:close="onClose">
+ <view class="modal">
+ <rich-text nodes="{{activeHtml}}"></rich-text>
+ </view>
+ </van-popup>
</view>
\ No newline at end of file
diff --git a/wechat_staff/pages/login/index.wxss b/wechat_staff/pages/login/index.wxss
index 3682d1a..54467bd 100644
--- a/wechat_staff/pages/login/index.wxss
+++ b/wechat_staff/pages/login/index.wxss
@@ -59,3 +59,8 @@
.btns .protocol .content {
flex: 1;
}
+.modal {
+ width: 600rpx;
+ min-height: 600rpx;
+ padding: 30rpx;
+}
diff --git a/wechat_staff/pages/promotion/index.js b/wechat_staff/pages/promotion/index.js
index 8d4d780..21a867e 100644
--- a/wechat_staff/pages/promotion/index.js
+++ b/wechat_staff/pages/promotion/index.js
@@ -1,11 +1,14 @@
-// pages/promotion/index.js
+import { newsPage } from '../../api/index'
Page({
/**
* 椤甸潰鐨勫垵濮嬫暟鎹�
*/
data: {
-
+ capacity: 10,
+ page: 0,
+ list: [],
+ total: 0,
},
/**
@@ -14,10 +17,9 @@
onLoad(options) {
},
-
- /**
- * 鐢熷懡鍛ㄦ湡鍑芥暟--鐩戝惉椤甸潰鍒濇娓叉煋瀹屾垚
- */
+ getList() {
+ newsPage()
+ },
onReady() {
},
diff --git a/wechat_staff/pages/work/index.js b/wechat_staff/pages/work/index.js
index c1c84c5..1f5c4c0 100644
--- a/wechat_staff/pages/work/index.js
+++ b/wechat_staff/pages/work/index.js
@@ -1,4 +1,4 @@
-// pages/mine/mine.js
+import { getMemberInfo } from '../../api/index'
Page({
/**
@@ -7,6 +7,8 @@
data: {
clientHeight: 0,
clientTop: 0,
+
+ uesrInfo: {}
},
/**
@@ -16,6 +18,8 @@
const res = wx.getMenuButtonBoundingClientRect()
this.setData({clientHeight: res.height})
this.setData({clientTop: res.top})
+
+ this.initData()
},
changePath(e) {
// 椤甸潰璺宠浆
@@ -31,9 +35,13 @@
url: `${temp[index]}`,
})
},
- /**
- * 鐢熷懡鍛ㄦ湡鍑芥暟--鐩戝惉椤甸潰鍒濇娓叉煋瀹屾垚
- */
+ initData() {
+ getMemberInfo().then(res => {
+ this.setData({
+ uesrInfo: res.data
+ })
+ })
+ },
onReady() {
},
diff --git a/wechat_staff/project.config.json b/wechat_staff/project.config.json
index 71c3d03..6f2d575 100644
--- a/wechat_staff/project.config.json
+++ b/wechat_staff/project.config.json
@@ -1,5 +1,5 @@
{
- "appid": "wx9c8b22ccc4642e07",
+ "appid": "wx208dd1edc0be24ee",
"compileType": "miniprogram",
"libVersion": "3.4.10",
"packOptions": {
diff --git a/wechat_staff/project.private.config.json b/wechat_staff/project.private.config.json
index 2d02d1a..7ebdbf6 100644
--- a/wechat_staff/project.private.config.json
+++ b/wechat_staff/project.private.config.json
@@ -24,7 +24,14 @@
},
{
"name": "",
- "pathName": "pages/kefu/select",
+ "pathName": "pages/login/index",
+ "query": "",
+ "launchMode": "default",
+ "scene": null
+ },
+ {
+ "name": "",
+ "pathName": "pages/promotion/index",
"query": "",
"launchMode": "default",
"scene": null
diff --git a/wechat_staff/static/icon/home_ic_anli@2x 2.png b/wechat_staff/static/icon/home_ic_anli@2x 2.png
new file mode 100644
index 0000000..157129a
--- /dev/null
+++ b/wechat_staff/static/icon/home_ic_anli@2x 2.png
Binary files differ
diff --git a/wechat_staff/static/icon/home_ic_chanpin@2x 2.png b/wechat_staff/static/icon/home_ic_chanpin@2x 2.png
new file mode 100644
index 0000000..204fb60
--- /dev/null
+++ b/wechat_staff/static/icon/home_ic_chanpin@2x 2.png
Binary files differ
diff --git a/wechat_staff/static/icon/home_ic_shijing@2x 2.png b/wechat_staff/static/icon/home_ic_shijing@2x 2.png
new file mode 100644
index 0000000..1e163fa
--- /dev/null
+++ b/wechat_staff/static/icon/home_ic_shijing@2x 2.png
Binary files differ
diff --git a/wechat_staff/static/icon/home_ic_zixun.png b/wechat_staff/static/icon/home_ic_zixun.png
new file mode 100644
index 0000000..f3d93a1
--- /dev/null
+++ b/wechat_staff/static/icon/home_ic_zixun.png
Binary files differ
diff --git a/wechat_staff/static/images/home_class_a@2x.png b/wechat_staff/static/images/home_class_a@2x.png
deleted file mode 100644
index 44d76cb..0000000
--- a/wechat_staff/static/images/home_class_a@2x.png
+++ /dev/null
Binary files differ
diff --git a/wechat_staff/static/images/home_class_b2@2x.png b/wechat_staff/static/images/home_class_b2@2x.png
deleted file mode 100644
index 57ea838..0000000
--- a/wechat_staff/static/images/home_class_b2@2x.png
+++ /dev/null
Binary files differ
diff --git a/wechat_staff/static/images/home_class_b@2x.png b/wechat_staff/static/images/home_class_b@2x.png
deleted file mode 100644
index bd3494b..0000000
--- a/wechat_staff/static/images/home_class_b@2x.png
+++ /dev/null
Binary files differ
diff --git a/wechat_staff/static/images/home_class_c@2x.png b/wechat_staff/static/images/home_class_c@2x.png
deleted file mode 100644
index ebb9dce..0000000
--- a/wechat_staff/static/images/home_class_c@2x.png
+++ /dev/null
Binary files differ
--
Gitblit v1.9.3