From 2ce9f2d29b3f98588a253bde1b2138a0e6af5d53 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=82=93=E5=B9=B3=E8=89=BA?= <52643018@qq.com> Date: Mon, 19 Jul 2021 17:42:54 +0800 Subject: [PATCH 1/5] =?UTF-8?q?[=E4=BC=98=E5=8C=96]=20=E5=95=86=E5=93=81?= =?UTF-8?q?=E8=AF=A6=E6=83=85=E9=A1=B5=E5=88=86=E4=BA=AB=E5=B0=8F=E7=A8=8B?= =?UTF-8?q?=E5=BA=8F=E5=8D=A1=E7=89=87=E4=B9=9F=E8=A6=81=E8=A7=A6=E5=8F=91?= =?UTF-8?q?=E7=BB=91=E5=AE=9A=E5=85=B3=E7=B3=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/goodsDetail/index.vue | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pages/goodsDetail/index.vue b/pages/goodsDetail/index.vue index 26065e9..d682ce6 100644 --- a/pages/goodsDetail/index.vue +++ b/pages/goodsDetail/index.vue @@ -390,7 +390,7 @@ } }, - //海报结束 + //获取商品详情 getGoodsDetail() { let that = this; this.$http(this.API.API_GOODS_DETAIL, { @@ -505,7 +505,9 @@ let options = { id: goods.id, route: 'goods', - scene_code: this.$scene.V2_GOODS_SHAREPOSTER + scene_code: this.$scene.V2_GOODS_SHAREPOSTER, + share_id: this.userInfo.id, + pt: 2 } this.generateKooken(token, options); // 谁分享了就生成一个token From c93613717a6396a752c437ad90b52ebde77339d4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=82=93=E5=B9=B3=E8=89=BA?= <52643018@qq.com> Date: Mon, 19 Jul 2021 18:20:45 +0800 Subject: [PATCH 2/5] =?UTF-8?q?[=E5=AE=8C=E5=96=84]=20=E9=A6=96=E9=A1=B5?= =?UTF-8?q?=E5=88=86=E4=BA=AB=E7=BB=91=E5=AE=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- common/api.js | 1 + pages/center/fans.vue | 2 +- pages/index/index.vue | 22 ++++++++++++++++++---- 3 files changed, 20 insertions(+), 5 deletions(-) diff --git a/common/api.js b/common/api.js index 1e4d43e..62dfe1f 100644 --- a/common/api.js +++ b/common/api.js @@ -9,6 +9,7 @@ export const PRODURL = 'https://mall.gxsky.com'; // 正式服请求地址 export const API_CATEGORY_LIST = '/api/category/list'; // 首页-分类 export const API_GOODS_LIST = '/api/goods/list'; // 首页-分类下商品列表 export const API_SHARE_HOME = '/api/share/home'; // 首页分享信息 +export const API_SALESMAN_BINDALL = '/api/salesman/bindAll'; // 点击链接就可以被绑定 // 用户订单 export const API_USERORDER = '/api/order/list'; diff --git a/pages/center/fans.vue b/pages/center/fans.vue index ea8e688..d1e928a 100644 --- a/pages/center/fans.vue +++ b/pages/center/fans.vue @@ -21,7 +21,7 @@ {{item.username}} {{item.state}} - {{item.share_time}} + {{item.share_time || 0}} diff --git a/pages/index/index.vue b/pages/index/index.vue index 7bfe630..e6bfc92 100644 --- a/pages/index/index.vue +++ b/pages/index/index.vue @@ -78,6 +78,8 @@ uni.removeStorageSync('homePageOptions'); if(this.pt == 2) { this.bindUsders() + }else if(this.pt == 3){ + this.bindAllUsders(); } } }, @@ -96,7 +98,6 @@ let timeDate = Math.round(new Date().getTime() / 1000).toString(); let md5TimeDate = SparkMD5.hash(timeDate) let nowTime = new Date().toLocaleString(); - console.log("进来啦~~~~~") _this.$http(_this.API.API_BINDSALES, { deed: md5TimeDate, sid: _this.s_id, @@ -107,6 +108,14 @@ console.log(err) }) }, + // 小程序卡片分享的绑定 + bindAllUsders(){ + this.$http(this.API.API_SALESMAN_BINDALL, { + pid: this.s_id + }).then(res => { + this.$msg('提交审核成功'); + }) + }, // 获取分享信息 getShareInfo(){ this.$http(this.API.API_SHARE_HOME).then(res => { @@ -219,16 +228,21 @@ // this.getGoodsList(); }, onShareAppMessage(){ - const token = this.$shared.createToken(); + const userInfo = uni.getStorageSync('userinfo') || {}; + const token = this.$shared.createToken({user_id: userInfo.id}); const scene_code = this.$scene.V2_HOME_SHAREBUTTON; - let options = {route: 'home', scene_code}; + let options = { + route: 'home', + scene_code, + share_id: userInfo.id, + pt: 3 + }; this.generateKooken(token, options); // 谁分享了就生成一个token let shareInfo = { title: this.shareInfo.title || '欢迎使用时空网小程序', path: '/pages/route/index?token='+ token } - if(this.shareInfo.cover){ shareInfo.imageUrl = this.shareInfo.cover; } From e704e98d7ff9f9e024e31cc564a8bca66904c7f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=82=93=E5=B9=B3=E8=89=BA?= <52643018@qq.com> Date: Tue, 20 Jul 2021 16:58:13 +0800 Subject: [PATCH 3/5] =?UTF-8?q?[=E4=BC=98=E5=8C=96]=20=E9=A6=96=E9=A1=B5?= =?UTF-8?q?=E5=9C=A8=E6=B2=A1=E6=9C=89tab=E7=9A=84=E6=83=85=E5=86=B5?= =?UTF-8?q?=E4=B8=8B=E7=9A=84=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/index/index.vue | 1 + 1 file changed, 1 insertion(+) diff --git a/pages/index/index.vue b/pages/index/index.vue index e6bfc92..3e76152 100644 --- a/pages/index/index.vue +++ b/pages/index/index.vue @@ -166,6 +166,7 @@ getGoodsList(){ let per_page = this.pageSize; let tab_item = this.tab_list[this.current]; + if(this.$shared.isValueType(tab_item) == 'undefined') return; this.$http(this.API.API_GOODS_LIST, { category_id: tab_item.id, type: tab_item.type, From 1e7018f40b18f345b96b7732e5999e57d823f106 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=82=93=E5=B9=B3=E8=89=BA?= <52643018@qq.com> Date: Tue, 20 Jul 2021 17:04:35 +0800 Subject: [PATCH 4/5] =?UTF-8?q?[=E4=BC=98=E5=8C=96]=20=E9=82=80=E8=AF=B7?= =?UTF-8?q?=E6=88=90=E4=B8=BA=E5=88=86=E9=94=80=E8=BE=BE=E4=BA=BA=E9=A1=B5?= =?UTF-8?q?=E9=9D=A2=E4=BC=98=E5=8C=96=E6=B2=A1=E6=9C=89=E5=9B=BE=E7=89=87?= =?UTF-8?q?=E6=97=B6=E7=9A=84=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/center/invite.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pages/center/invite.vue b/pages/center/invite.vue index 502a37c..e2fd6c9 100644 --- a/pages/center/invite.vue +++ b/pages/center/invite.vue @@ -63,7 +63,7 @@ _this.$http(_this.API.API_BILLBACKGROUND, { type: 'telent_share' }).then(res => { - let img = res.data.img_url + let img = res.data?.img_url; // ?. 运算符,解决没有图片的情况下报错 if (img) { wx.getImageInfo({ src: img, From c32bc0c011e7876e1511a516501d97329c114532 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=82=93=E5=B9=B3=E8=89=BA?= <52643018@qq.com> Date: Tue, 20 Jul 2021 17:13:09 +0800 Subject: [PATCH 5/5] =?UTF-8?q?[=E4=BC=98=E5=8C=96]=20=E8=81=94=E7=B3=BB?= =?UTF-8?q?=E5=AE=A2=E6=9C=8D=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/contactService/index.vue | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/pages/contactService/index.vue b/pages/contactService/index.vue index f232551..225ea94 100644 --- a/pages/contactService/index.vue +++ b/pages/contactService/index.vue @@ -6,22 +6,23 @@ 服务时间 - {{ info.service_period }} + {{ info.service_period || '-' }} 客服电话 - {{ info.phone }} + {{ info.phone || '-' }} 联系地址 - {{ info.address }} + {{ info.address || '-' }} 客服微信 - + {{ info.wechat }} 复制 + - 当前版本 @@ -46,11 +47,12 @@ // 获取信息 getInfo(){ this.$http(this.API.API_CONTACT).then(res => { - this.info = res.data; + this.info = res.data || {}; }) }, // 拨打电话 makePhoneCall(){ + if(!this.info?.phone) return; uni.makePhoneCall({ phoneNumber: this.info.phone })