Commit 437c2dc6c7e8500d9fa99f98788850ba09e6d6db
Merge branch 'dev' of http://git.vipzhuang.cn/wxd/MShopWeApp into dev
Showing
3 changed files
with
27 additions
and
23 deletions
packageD/pages/AI-test-skin/index/aiskin.js
| 1 | 1 | /* |
| 2 | 2 | * @Author: abson |
| 3 | 3 | * @Date: 2022-02-11 14:13:05 |
| 4 | - * @LastEditTime: 2022-02-22 15:17:48 | |
| 4 | + * @LastEditTime: 2022-03-26 17:03:01 | |
| 5 | 5 | * @LastEditors: Please set LastEditors |
| 6 | 6 | * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE |
| 7 | 7 | * @FilePath: \MShopWeApp\packageB\pages\AI-test-skin\index\aiskin.js |
| ... | ... | @@ -25,11 +25,13 @@ Page({ |
| 25 | 25 | * 生命周期函数--监听页面加载 |
| 26 | 26 | */ |
| 27 | 27 | onLoad: function (options) { |
| 28 | - var user=getApp().globalData.userInfo; | |
| 29 | - if(!user){ | |
| 30 | - let url = "/pages/togoin/togoin"; | |
| 31 | - app.goto(url); | |
| 32 | - } | |
| 28 | + getApp().globalData.user_id = options?.user_id; | |
| 29 | + getApp().getUserFir(); | |
| 30 | + var user = getApp().globalData.userInfo; | |
| 31 | + if (!user || !getApp().globalData.user_id) { | |
| 32 | + let url = "/pages/togoin/togoin"; | |
| 33 | + app.goto(url); | |
| 34 | + } | |
| 33 | 35 | }, |
| 34 | 36 | |
| 35 | 37 | /** |
| ... | ... | @@ -57,8 +59,8 @@ Page({ |
| 57 | 59 | goto(e) { |
| 58 | 60 | |
| 59 | 61 | this.check_num(function () { |
| 60 | - var user=getApp().globalData.userInfo; | |
| 61 | - if(!user){ | |
| 62 | + var user = getApp().globalData.userInfo; | |
| 63 | + if (!user) { | |
| 62 | 64 | wx.showToast({ |
| 63 | 65 | title: "请先授权登陆", |
| 64 | 66 | icon: 'none', |
| ... | ... | @@ -68,14 +70,14 @@ Page({ |
| 68 | 70 | setTimeout(function () { |
| 69 | 71 | let url = "/pages/togoin/togoin"; |
| 70 | 72 | app.goto(url); |
| 71 | - },1000) | |
| 73 | + }, 1000) | |
| 72 | 74 | return false; |
| 73 | 75 | } |
| 74 | 76 | |
| 75 | 77 | let url = e.currentTarget.dataset.url; |
| 76 | 78 | app.goto(url); |
| 77 | 79 | }) |
| 78 | - | |
| 80 | + | |
| 79 | 81 | }, |
| 80 | 82 | |
| 81 | 83 | /** |
| ... | ... | @@ -102,26 +104,27 @@ Page({ |
| 102 | 104 | /** |
| 103 | 105 | * 用户点击右上角分享 |
| 104 | 106 | */ |
| 105 | - onShareAppMessage: function () { getApp().globalData.no_clear=1 | |
| 107 | + onShareAppMessage: function () { | |
| 108 | + getApp().globalData.no_clear = 1 | |
| 106 | 109 | |
| 107 | 110 | }, |
| 108 | 111 | |
| 109 | - check_num:function (func) { | |
| 112 | + check_num: function (func) { | |
| 110 | 113 | //判断右没有开AI测肤 |
| 111 | - getApp().promiseGet("/api/weshop/wx/weappSkin/get/"+setting.stoid,{}).then(rs=>{ | |
| 112 | - if(rs.data.code!=0 || !rs.data.data){ | |
| 114 | + getApp().promiseGet("/api/weshop/wx/weappSkin/get/" + setting.stoid, {}).then(rs => { | |
| 115 | + if (rs.data.code != 0 || !rs.data.data) { | |
| 113 | 116 | wx.showToast({ |
| 114 | 117 | title: "未开通测肤功能,请联系商家", |
| 115 | 118 | icon: 'none', |
| 116 | 119 | duration: 3000 |
| 117 | 120 | }) |
| 118 | - }else if(!rs.data.data.skin_num || rs.data.data.skin_num<=0){ | |
| 121 | + } else if (!rs.data.data.skin_num || rs.data.data.skin_num <= 0) { | |
| 119 | 122 | wx.showToast({ |
| 120 | 123 | title: "测肤功能的使用次数已经达到上限,请联系商家", |
| 121 | 124 | icon: 'none', |
| 122 | 125 | duration: 3000 |
| 123 | 126 | }) |
| 124 | - }else{ | |
| 127 | + } else { | |
| 125 | 128 | func(); |
| 126 | 129 | } |
| 127 | 130 | }) |
| ... | ... | @@ -139,14 +142,14 @@ Page({ |
| 139 | 142 | store_id: setting.stoid, |
| 140 | 143 | user_id: os.user_id, |
| 141 | 144 | page: 1, |
| 142 | - pageSize:1, | |
| 145 | + pageSize: 1, | |
| 143 | 146 | } |
| 144 | 147 | }); |
| 145 | 148 | // initChart.setOption(option); |
| 146 | 149 | if (res.code == 0 && res.data.pageData.length > 0) { |
| 147 | - this.setData({show_his:1}) | |
| 150 | + this.setData({ show_his: 1 }) | |
| 148 | 151 | } |
| 149 | 152 | } |
| 150 | - | |
| 151 | - | |
| 153 | + | |
| 154 | + | |
| 152 | 155 | }) |
| 153 | 156 | \ No newline at end of file | ... | ... |
pages/goods/goodsInfo/goodsInfo.js
| ... | ... | @@ -1248,7 +1248,7 @@ Page({ |
| 1248 | 1248 | |
| 1249 | 1249 | //让商品带上房间号 |
| 1250 | 1250 | //让商品带上房间号 |
| 1251 | - if (th.data.sys_switch.is_skuroom_id == 1) { | |
| 1251 | + if (!th.data.sys_switch.is_skuroom_id && th.data.sys_switch.is_skuroom_id == 1) { | |
| 1252 | 1252 | if (th.data.data.goods_id == getApp().globalData.room_goods_id) { |
| 1253 | 1253 | newd.room_id = getApp().globalData.room_id; |
| 1254 | 1254 | } |
| ... | ... | @@ -1354,7 +1354,7 @@ Page({ |
| 1354 | 1354 | |
| 1355 | 1355 | //让商品带上房间号 |
| 1356 | 1356 | //让商品带上房间号 |
| 1357 | - if (th.data.sys_switch.is_skuroom_id == 1) { | |
| 1357 | + if (!th.data.sys_switch.is_skuroom_id && th.data.sys_switch.is_skuroom_id == 1) { | |
| 1358 | 1358 | if (th.data.data.goods_id == getApp().globalData.room_goods_id) { |
| 1359 | 1359 | newd.room_id = getApp().globalData.room_id; |
| 1360 | 1360 | } |
| ... | ... | @@ -4243,7 +4243,7 @@ Page({ |
| 4243 | 4243 | } |
| 4244 | 4244 | |
| 4245 | 4245 | //让商品带上房间号 |
| 4246 | - if (th.data.sys_switch.is_skuroom_id == 1) { | |
| 4246 | + if (!th.data.sys_switch.is_skuroom_id && th.data.sys_switch.is_skuroom_id == 1) { | |
| 4247 | 4247 | if (th.data.data.goods_id == getApp().globalData.room_goods_id) { |
| 4248 | 4248 | newd.room_id = getApp().globalData.room_id; |
| 4249 | 4249 | } | ... | ... |