作者 梁鹏山

fix:更新同步

要显示太多修改。

为保证性能只显示 16 of 16+ 个文件。

@@ -7,9 +7,10 @@ @@ -7,9 +7,10 @@
7 <view class="word">{{type == 3?item.name:type==2?item.product_name:item.product.name}}</view> 7 <view class="word">{{type == 3?item.name:type==2?item.product_name:item.product.name}}</view>
8 <view class="info"> 8 <view class="info">
9 <view class="jifen"> 9 <view class="jifen">
10 - <view class="name">积分</view>  
11 - <text wx:if='{{item.product.price2!=null||item.price2!=null}}'>{{type == 3 || type == 2?item.price2:item.product.price2}}</text>  
12 - <text wx:else>{{type == 3 || type == 2?item.goods_price:item.product.price}}</text> 10 + <!-- 2023-10-19 需求要将积分改为微信支付的金额 -->
  11 + <!-- <view class="name">积分</view> -->
  12 + <text wx:if='{{item.product.price2!=null||item.price2!=null}}'>¥{{type == 3 || type == 2?item.price2:item.product.price2}}</text>
  13 + <text wx:else>¥{{type == 3 || type == 2?item.goods_price:item.product.price}}</text>
13 <text style="margin-left: 10rpx;color:#ccc;font-size: 28rpx;" wx:if="{{type == 3 || type == 4}}">X{{item.num}}</text> 14 <text style="margin-left: 10rpx;color:#ccc;font-size: 28rpx;" wx:if="{{type == 3 || type == 4}}">X{{item.num}}</text>
14 </view> 15 </view>
15 <view class="num_box" wx:if="{{type == 1}}"> 16 <view class="num_box" wx:if="{{type == 1}}">
1 App({ 1 App({
2 - onLaunch: function () {  
3 - if (wx.getStorageSync('token')) {  
4 - this.getmessagelist()  
5 -  
6 - }  
7 - this.getToken();  
8 -  
9 - //自动更新版本  
10 - const updateManager = wx.getUpdateManager()  
11 - updateManager.onCheckForUpdate(function (res) {  
12 - // 请求完新版本信息的回调  
13 -  
14 - })  
15 - updateManager.onUpdateReady(function () {  
16 - wx.showModal({  
17 - title: '更新提示',  
18 - content: '新版本已经准备好,是否重启应用?',  
19 - success: function (res) {  
20 - if (res.confirm) {  
21 - // 新的版本已经下载好,调用 applyUpdate 应用新版本并重启  
22 - updateManager.applyUpdate()  
23 - } 2 + onLaunch: function () {
  3 + if (wx.getStorageSync('token')) {
  4 + this.getmessagelist()
24 } 5 }
25 - })  
26 - })  
27 - updateManager.onUpdateFailed(function () {  
28 - // 新的版本下载失败  
29 - wx.showModal({  
30 - title: '更新提示',  
31 - content: '新版本下载失败',  
32 - showCancel: false  
33 - })  
34 - })  
35 - },  
36 - post: function (url, data, showLoad) {  
37 - wx.showNavigationBarLoading()  
38 - var promise = new Promise((resolve, reject) => {  
39 - //init  
40 - let that = this;  
41 - let postData = data, baseUrl;  
42 - // let baseUrl = 'https://binhai.w.broing.cn/api';  
43 - // let baseUrl ='http://binhaitest.w.brotop.cn/api'  
44 - // 现在用的  
45 - // let baseUrl = 'https://binhai.w.broing.cn/api'  
46 - // let baseUrl = 'http://binhaitest.w.brotop.cn/api'  
47 - // 滨海  
48 - var entrance_type = wx.getStorageSync("entrance_type");  
49 - console.log(entrance_type);  
50 - if (entrance_type == '1' || entrance_type == '0' || url == '/getopenid/get' || url.indexOf('/wb/wb')>-1) {  
51 - //劳保商城入口  
52 - console.log('11111111111111111')  
53 - baseUrl = 'https://binhai.w.broing.cn/api';  
54 - // baseUrl = 'http://binhai.shs.broing.cn/api'  
55 - } else if (entrance_type == '2') {  
56 - //工会商城入口  
57 - console.log('@@@@@@@@@@@@@@@@@@@@@@')  
58 - baseUrl = 'https://binhaigh.w.broing.cn/api';  
59 - // baseUrl = 'http://gonghui.shs.broing.cn/api'  
60 - } else if (entrance_type == '3') {  
61 - //办公入口  
62 - baseUrl = 'https://bgcb.w.broing.cn/api';  
63 - }  
64 - // 天远甄选  
65 - // if (entrance_type == '1' || url == '/getopenid/get' || url.indexOf('address') > -1) {  
66 - // //劳保商城入口  
67 - // baseUrl = 'https://binhai2.w.broing.cn/api';  
68 - // } else if (entrance_type == '2') {  
69 - // //工会商城入口  
70 - // baseUrl = 'https://binhaigh2.w.broing.cn/api';  
71 - // } else if (entrance_type == '3') {  
72 - // //工会商城入口  
73 - // baseUrl = 'https://bgcb2.w.broing.cn/api';  
74 - // }  
75 - console.log(baseUrl);  
76 - //网络请求  
77 - wx.request({  
78 - url: baseUrl + url,  
79 - data: postData,  
80 - method: 'POST',  
81 - header: {  
82 - 'content-type': 'application/x-www-form-urlencoded',  
83 - 'token': wx.getStorageSync('token') || ''  
84 - },  
85 - success: function (res) { //返回取得的数据  
86 - console.log('ssssssssssssssssssssssssssssssssssss', res)  
87 - if (res.data.code == '200') {  
88 - resolve(res.data)  
89 - } else if (res.data.code == '5000') {  
90 - wx.hideLoading();  
91 - reject(res.data)  
92 - wx.removeStorageSync('login'); 6 + this.getToken();
  7 + //自动更新版本
  8 + const updateManager = wx.getUpdateManager()
  9 + updateManager.onCheckForUpdate(function (res) {
  10 + // 请求完新版本信息的回调
  11 + })
  12 + updateManager.onUpdateReady(function () {
93 wx.showModal({ 13 wx.showModal({
94 - title: '提示',  
95 - content: res.data.msg,  
96 - showCancel: false 14 + title: '更新提示',
  15 + content: '新版本已经准备好,是否重启应用?',
  16 + success: function (res) {
  17 + if (res.confirm) {
  18 + // 新的版本已经下载好,调用 applyUpdate 应用新版本并重启
  19 + updateManager.applyUpdate()
  20 + }
  21 + }
97 }) 22 })
98 - wx.removeStorageSync('token');  
99 - setTimeout(() => {  
100 - wx.navigateTo({  
101 - url: '/pages/register/register?type=1',  
102 - })  
103 - }, 1200)  
104 -  
105 - } else { 23 + })
  24 + updateManager.onUpdateFailed(function () {
  25 + // 新的版本下载失败
106 wx.showModal({ 26 wx.showModal({
107 - title: '提示',  
108 - content: res.data.msg,  
109 - showCancel: false 27 + title: '更新提示',
  28 + content: '新版本下载失败',
  29 + showCancel: false
110 }) 30 })
111 - reject(res.data)  
112 - }  
113 - setTimeout(function () {  
114 - wx.hideNavigationBarLoading()  
115 - }, 600)  
116 - },  
117 - fail: function (e) {  
118 - reject('网络出错');  
119 - wx.hideNavigationBarLoading()  
120 - }  
121 - })  
122 - });  
123 - return promise;  
124 - },  
125 - getToken() {  
126 - let that = this;  
127 - let u = that.interface.getToken;  
128 - wx.login({  
129 - success: (result) => {  
130 - that.postk(u, {  
131 - code: result.code  
132 - }).then((r) => {  
133 - console.log(r)  
134 - wx.setStorageSync('token', r.data.token)  
135 - wx.setStorageSync('login', r.data.login_new1)  
136 - wx.setStorageSync('gh_login', r.data.login_new2)  
137 - wx.setStorageSync('cb_login', r.data.login_new3)  
138 - wx.setStorageSync('sq', r.data.sq1)  
139 - wx.setStorageSync('gh_sq', r.data.sq2)  
140 - wx.setStorageSync('cb_sq', r.data.sq3)  
141 }) 31 })
142 - },  
143 - fail: (res) => { },  
144 - complete: (res) => { },  
145 - })  
146 - },  
147 - // 开放商城公共接口  
148 - postk: function (url, data, showLoad) {  
149 - wx.showNavigationBarLoading()  
150 - var promise = new Promise((resolve, reject) => {  
151 - //init  
152 - let that = this;  
153 - let postData = data  
154 - // 滨海  
155 - let baseUrl = 'https://binhaidispark.w.broing.cn/api'  
156 - // 天远甄选  
157 - // let baseUrl = 'https://binhaidispark2.w.broing.cn/api' 32 + },
  33 + post: function (url, data, showLoad) {
  34 + wx.showNavigationBarLoading()
  35 + var promise = new Promise((resolve, reject) => {
  36 + //init
  37 + let that = this;
  38 + let postData = data, baseUrl;
  39 + // let baseUrl = 'https://binhai.w.broing.cn/api';
  40 + // let baseUrl ='http://binhaitest.w.brotop.cn/api'
  41 + // 现在用的
  42 + // let baseUrl = 'https://binhai.w.broing.cn/api'
  43 + // let baseUrl = 'http://binhaitest.w.brotop.cn/api'
  44 + // 滨海
  45 + var entrance_type = wx.getStorageSync("entrance_type");
  46 + if (entrance_type == '1' || entrance_type == '0' || url == '/getopenid/get' || url.indexOf('/wb/wb') > -1) {
  47 + //劳保商城入口
  48 + baseUrl = 'https://binhai.w.broing.cn/api';
  49 + // baseUrl = 'http://binhai.shs.broing.cn/api'
  50 + } else if (entrance_type == '2') {
  51 + //工会商城入口
  52 + baseUrl = 'https://binhaigh.w.broing.cn/api';
  53 + // baseUrl = 'http://gonghui.shs.broing.cn/api'
  54 + } else if (entrance_type == '3') {
  55 + //办公入口
  56 + baseUrl = 'https://bgcb.w.broing.cn/api';
  57 + }
  58 + // 天远甄选
  59 + // if (entrance_type == '1' || url == '/getopenid/get' || url.indexOf('address') > -1) {
  60 + // //劳保商城入口
  61 + // baseUrl = 'https://binhai2.w.broing.cn/api';
  62 + // } else if (entrance_type == '2') {
  63 + // //工会商城入口
  64 + // baseUrl = 'https://binhaigh2.w.broing.cn/api';
  65 + // } else if (entrance_type == '3') {
  66 + // //工会商城入口
  67 + // baseUrl = 'https://bgcb2.w.broing.cn/api';
  68 + // }
  69 + //网络请求
  70 + wx.request({
  71 + url: baseUrl + url,
  72 + data: postData,
  73 + method: 'POST',
  74 + header: {
  75 + 'content-type': 'application/x-www-form-urlencoded',
  76 + 'token': wx.getStorageSync('token') || ''
  77 + },
  78 + success: function (res) { //返回取得的数据
  79 + if (res.data.code == '200') {
  80 + resolve(res.data)
  81 + } else if (res.data.code == '5000') {
  82 + wx.hideLoading();
  83 + reject(res.data)
  84 + wx.removeStorageSync('login');
  85 + wx.showModal({
  86 + title: '提示',
  87 + content: res.data.msg,
  88 + showCancel: false
  89 + })
  90 + wx.removeStorageSync('token');
  91 + setTimeout(() => {
  92 + wx.navigateTo({
  93 + url: '/pages/register/register?type=1',
  94 + })
  95 + }, 1200)
  96 + } else {
  97 + wx.showModal({
  98 + title: '提示',
  99 + content: res.data.msg,
  100 + showCancel: false
  101 + })
  102 + reject(res.data)
  103 + }
  104 + setTimeout(function () {
  105 + wx.hideNavigationBarLoading()
  106 + }, 600)
  107 + },
  108 + fail: function (e) {
  109 + reject('网络出错');
  110 + wx.hideNavigationBarLoading()
  111 + }
  112 + })
  113 + });
  114 + return promise;
  115 + },
  116 + getToken() {
  117 + let that = this;
  118 + let u = that.interface.getToken;
  119 + wx.login({
  120 + success: (result) => {
  121 + that.postk(u, {
  122 + code: result.code
  123 + }).then((r) => {
  124 + console.log(r)
  125 + wx.setStorageSync('token', r.data.token)
  126 + wx.setStorageSync('login', r.data.login_new1)
  127 + wx.setStorageSync('gh_login', r.data.login_new2)
  128 + wx.setStorageSync('cb_login', r.data.login_new3)
  129 + wx.setStorageSync('sq', r.data.sq1)
  130 + wx.setStorageSync('gh_sq', r.data.sq2)
  131 + wx.setStorageSync('cb_sq', r.data.sq3)
  132 + })
  133 + },
  134 + fail: (res) => { },
  135 + complete: (res) => { },
  136 + })
  137 + },
  138 + // 开放商城公共接口
  139 + postk: function (url, data, showLoad) {
  140 + wx.showNavigationBarLoading()
  141 + var promise = new Promise((resolve, reject) => {
  142 + //init
  143 + let that = this;
  144 + let postData = data
  145 + // 滨海
  146 + let baseUrl = 'https://binhaidispark.w.broing.cn/api'
  147 + // 天远甄选
  148 + // let baseUrl = 'https://binhaidispark2.w.broing.cn/api'
158 149
159 - //网络请求  
160 - wx.request({  
161 - url: baseUrl + url,  
162 - data: postData,  
163 - method: 'POST',  
164 - header: {  
165 - 'content-type': 'application/x-www-form-urlencoded',  
166 - 'token': wx.getStorageSync('token') || ''  
167 - // 'token': '' || ''  
168 - },  
169 - success: function (res) { //返回取得的数据  
170 - if (res.data.code == '1') {  
171 - resolve(res.data)  
172 - } else if (res.data.code == '5000') {  
173 - wx.hideLoading();  
174 - reject(res.data)  
175 - wx.removeStorageSync('token');  
176 - wx.removeStorageSync('login');  
177 - // wx.navigateTo({  
178 - // url: '/pages/register/register?type=1',  
179 - // })  
180 - } else {  
181 - wx.showToast({  
182 - title: res.data.msg,  
183 - icon: 'none', 150 + //网络请求
  151 + wx.request({
  152 + url: baseUrl + url,
  153 + data: postData,
  154 + method: 'POST',
  155 + header: {
  156 + 'content-type': 'application/x-www-form-urlencoded',
  157 + 'token': wx.getStorageSync('token') || ''
  158 + // 'token': '' || ''
  159 + },
  160 + success: function (res) { //返回取得的数据
  161 + if (res.data.code == '1') {
  162 + resolve(res.data)
  163 + } else if (res.data.code == '5000') {
  164 + wx.hideLoading();
  165 + reject(res.data)
  166 + wx.removeStorageSync('token');
  167 + wx.removeStorageSync('login');
  168 + // wx.navigateTo({
  169 + // url: '/pages/register/register?type=1',
  170 + // })
  171 + } else {
  172 + wx.showToast({
  173 + title: res.data.msg,
  174 + icon: 'none',
184 175
  176 + })
  177 + reject(res.data)
  178 + }
  179 + setTimeout(function () {
  180 + wx.hideNavigationBarLoading()
  181 + }, 600)
  182 + },
  183 + fail: function (e) {
  184 + reject('网络出错');
  185 + wx.hideNavigationBarLoading()
  186 + }
185 }) 187 })
186 - reject(res.data)  
187 - }  
188 - setTimeout(function () {  
189 - wx.hideNavigationBarLoading()  
190 - }, 600)  
191 - },  
192 - fail: function (e) {  
193 - reject('网络出错');  
194 - wx.hideNavigationBarLoading()  
195 - }  
196 - })  
197 - });  
198 - return promise;  
199 - }, 188 + });
  189 + return promise;
  190 + },
200 191
201 - upload(filetype, file) { 192 + upload(filetype, file) {
202 193
203 - var promise = new Promise((resolve, reject) => {  
204 - wx.showNavigationBarLoading()  
205 - wx.showLoading({  
206 - title: '上传中',  
207 - })  
208 - let url = 'https://binhaidispark.w.broing.cn/api/common/upload'; 194 + var promise = new Promise((resolve, reject) => {
  195 + wx.showNavigationBarLoading()
  196 + wx.showLoading({
  197 + title: '上传中',
  198 + })
  199 + let url = 'https://binhaidispark.w.broing.cn/api/common/upload';
209 200
210 - let head = {  
211 - 'token': wx.getStorageSync('token'),  
212 - 'XX-Device-Type': ''  
213 - }  
214 - let typename = {  
215 - filetype: filetype  
216 - }  
217 - wx.uploadFile({  
218 - url: url, //仅为示例,非真实的接口地址  
219 - filePath: file,  
220 - name: 'file',  
221 - header: head,  
222 - formData: typename,  
223 - success: function (res) {  
224 - console.log('上传文件后', res)  
225 - let temdata = JSON.parse(res.data);  
226 - console.log(temdata)  
227 - let urlobj = {  
228 - url: temdata.data.url  
229 - }  
230 - resolve(urlobj);  
231 - },  
232 - fail: function (res) {  
233 - reject('网络出错');  
234 - wx.hideNavigationBarLoading()  
235 - wx.hideLoading()  
236 - },  
237 - complete: () => {  
238 - wx.hideNavigationBarLoading()  
239 - wx.hideLoading()  
240 - },  
241 - })  
242 - });  
243 - return promise;  
244 - }, 201 + let head = {
  202 + 'token': wx.getStorageSync('token'),
  203 + 'XX-Device-Type': ''
  204 + }
  205 + let typename = {
  206 + filetype: filetype
  207 + }
  208 + wx.uploadFile({
  209 + url: url, //仅为示例,非真实的接口地址
  210 + filePath: file,
  211 + name: 'file',
  212 + header: head,
  213 + formData: typename,
  214 + success: function (res) {
  215 + console.log('上传文件后', res)
  216 + let temdata = JSON.parse(res.data);
  217 + console.log(temdata)
  218 + let urlobj = {
  219 + url: temdata.data.url
  220 + }
  221 + resolve(urlobj);
  222 + },
  223 + fail: function (res) {
  224 + reject('网络出错');
  225 + wx.hideNavigationBarLoading()
  226 + wx.hideLoading()
  227 + },
  228 + complete: () => {
  229 + wx.hideNavigationBarLoading()
  230 + wx.hideLoading()
  231 + },
  232 + })
  233 + });
  234 + return promise;
  235 + },
245 236
246 237
247 - // 获取个人信息  
248 - getInfoFun() {  
249 - let that = this;  
250 - let u = that.interface.readteacher;  
251 - that.post(u, {}).then((r) => {  
252 - console.log('3489523498', r)  
253 - if (r.code == 200) { 238 + // 获取个人信息
  239 + getInfoFun() {
  240 + let that = this;
  241 + let u = that.interface.readteacher;
  242 + that.post(u, {}).then((r) => {
  243 + console.log('3489523498', r)
  244 + if (r.code == 200) {
254 245
255 wx.setStorageSync('login', r.msg.login_new) 246 wx.setStorageSync('login', r.msg.login_new)
256 // that.globalData.login_new=r.msg.login_new; 247 // that.globalData.login_new=r.msg.login_new;
@@ -262,113 +253,108 @@ App({ @@ -262,113 +253,108 @@ App({
262 }) 253 })
263 }, 254 },
264 255
265 - getmessagelist() {  
266 - let that = this  
267 - let url = '/information/get_all';  
268 - let data = {  
269 - page: 1,  
270 - pageNum: 10,  
271 -  
272 - }  
273 - this.post(url, data, "POST").then((r) => {  
274 - // console.log(r)  
275 - // that.setData({  
276 - // messagelist: that.data.messagelist.concat(r.msg)  
277 - // }) 256 + getmessagelist() {
  257 + let that = this
  258 + let url = '/information/get_all';
  259 + let data = {
  260 + page: 1,
  261 + pageNum: 10,
278 262
279 - let newlist = [];  
280 - r.msg.forEach(function (value, index, array) {  
281 - console.log(newlist)  
282 - if (value.status == 1) {  
283 - newlist.push(value)  
284 } 263 }
285 - })  
286 -  
287 - console.log('77889944556', newlist)  
288 - if (newlist.length != 0) {  
289 - wx.showTabBarRedDot({  
290 - index: 1,  
291 - success: function (red) { 264 + this.post(url, data, "POST").then((r) => {
  265 + // console.log(r)
  266 + // that.setData({
  267 + // messagelist: that.data.messagelist.concat(r.msg)
  268 + // })
292 269
293 - wx.setTabBarBadge({  
294 - index: 1,  
295 - text: newlist.length.toString(), 270 + let newlist = [];
  271 + r.msg.forEach(function (value, index, array) {
  272 + console.log(newlist)
  273 + if (value.status == 1) {
  274 + newlist.push(value)
  275 + }
296 }) 276 })
297 - }  
298 - })  
299 - }  
300 277
  278 + console.log('77889944556', newlist)
  279 + if (newlist.length != 0) {
  280 + wx.showTabBarRedDot({
  281 + index: 1,
  282 + success: function (red) {
301 283
302 - }).catch((err) => { })  
303 - },  
304 -  
305 - onShow: function () {  
306 - console.log('hahahahhahahahhhahh')  
307 - }, 284 + wx.setTabBarBadge({
  285 + index: 1,
  286 + text: newlist.length.toString(),
  287 + })
  288 + }
  289 + })
  290 + }
  291 + }).catch((err) => { })
  292 + },
308 293
  294 + onShow: function () { },
309 295
310 - //接口管理  
311 - interface: {  
312 - openid: '/getopenid/get', // 获取openid  
313 - getcode: '/getopenid/getcode', // 获取验证码,  
314 - getToken: '/user/getToken',  
315 - readteacher: '/getopenid/readteacher', // 获取个人信息  
316 - login: '/getopenid/smslogin', // 登录  
317 - jifenlist: '/order/jifenlist', // 积分列表  
318 - address: '/address/index', // 地址列表  
319 - addaddress: '/address/add', // 添加地址  
320 - editaddress: '/address/edit', // 修改地址  
321 - deladdress: '/address/delete', // 删除地址  
322 - mraddress: '/address/mo', // 修改默认地址  
323 - adshow: '/address/editshow', //地址详情(数据回显)  
324 - about: '/wb/wb', // 关于我们  
325 - order: '/order/orderlist', // 获取订单列表  
326 - payorder: '/order/payorder', // 订单页点击支付  
327 - disorder: '/order/disorder', // 订单列表取消订单  
328 - orderrefund: '/order/orderrefund', // 退换货详情  
329 - // upload: 'https://binhai.w.broing.cn/api/common/upload', // 上传图片  
330 - upload: 'https://binhai.w.brotop.cn/api',  
331 - refund: '/order/refund', // 退货提交 296 + //接口管理
  297 + interface: {
  298 + openid: '/getopenid/get', // 获取openid
  299 + getcode: '/getopenid/getcode', // 获取验证码,
  300 + getToken: '/user/getToken',
  301 + readteacher: '/getopenid/readteacher', // 获取个人信息
  302 + login: '/getopenid/smslogin', // 登录
  303 + jifenlist: '/order/jifenlist', // 积分列表
  304 + address: '/address/index', // 地址列表
  305 + addaddress: '/address/add', // 添加地址
  306 + editaddress: '/address/edit', // 修改地址
  307 + deladdress: '/address/delete', // 删除地址
  308 + mraddress: '/address/mo', // 修改默认地址
  309 + adshow: '/address/editshow', //地址详情(数据回显)
  310 + about: '/wb/wb', // 关于我们
  311 + order: '/order/orderlist', // 获取订单列表
  312 + payorder: '/order/payorder', // 订单页点击支付
  313 + disorder: '/order/disorder', // 订单列表取消订单
  314 + orderrefund: '/order/orderrefund', // 退换货详情
  315 + // upload: 'https://binhai.w.broing.cn/api/common/upload', // 上传图片
  316 + upload: 'https://binhai.w.brotop.cn/api',
  317 + refund: '/order/refund', // 退货提交
332 318
333 - delorder: '/order/delorder', // 删除订单  
334 - okorder: '/order/okorder', // 确认订单  
335 - orderInfo: '/order/orderInfo', // 订单详情  
336 - kuaidi: '/kuaidi/kuaidi', //物流信息  
337 - collectdel: '/product/collectdel', //收藏删除  
338 - collectList: '/getopenid/collectlist', //收藏列表  
339 - deleteseach: '/product/deleteseach', //删除搜索历史  
340 - order_pay: '/order/pay', //订单支付  
341 - now_add: '/order/now_add', //点击结算  
342 - hotsreach: '/product/hotsreach', // 热门搜索  
343 - searchhis: '/product/searchhis', // 商品搜索历史  
344 - search: '/product/search', // 商品搜索结果列表  
345 - getPid: '/cap/getpid', // 分类页面  
346 - prev_pay: '/shop/prev_pay', // 购物车点击结算  
347 - gwcshop: '/shop/gwcshop', //购物车数量修改保存  
348 - deletes: '/shop/deletes', //购物车删除  
349 - shopcar: '/shop/shopcar', // 购物车页面  
350 - now_prev_pay: '/shop/now_prev_pay', // 直接购买  
351 - addshop: '/shop/addshop', // 添加购物车  
352 - collect: '/product/collect', // 收藏  
353 - getInfo: '/product/getInfo', //商品详情  
354 - good_list: '/product/get', // 商品  
355 - index: '/cap/get', // 首页大小分类  
356 - banner: '/banner/index', // 轮播图  
357 - notice: '/cap/notice', // 公告  
358 - youfei: '/shop/youfei1', // 单算邮费  
359 - youfei1: '/shop/youfei', // 購物車邮费  
360 - shopcarNum: '/shop/shopcarnum', // 购物车数量  
361 - orderlist: '/shop/orderlist', // 订单各状态数量  
362 - order_read: '/shop/read', // 订单数  
363 - orderMixed: '/order/zhifu',  
364 - },  
365 - globalData: {  
366 - login_new: "",  
367 - // 滨海  
368 - baseUrlimg: 'https://binhaidispark.w.broing.cn/',  
369 - // 天远  
370 - // baseUrlimg: 'https://binhaidispark2.w.broing.cn/api',  
371 - } 319 + delorder: '/order/delorder', // 删除订单
  320 + okorder: '/order/okorder', // 确认订单
  321 + orderInfo: '/order/orderInfo', // 订单详情
  322 + kuaidi: '/kuaidi/kuaidi', //物流信息
  323 + collectdel: '/product/collectdel', //收藏删除
  324 + collectList: '/getopenid/collectlist', //收藏列表
  325 + deleteseach: '/product/deleteseach', //删除搜索历史
  326 + order_pay: '/order/pay', //订单支付
  327 + now_add: '/order/now_add', //点击结算
  328 + hotsreach: '/product/hotsreach', // 热门搜索
  329 + searchhis: '/product/searchhis', // 商品搜索历史
  330 + search: '/product/search', // 商品搜索结果列表
  331 + getPid: '/cap/getpid', // 分类页面
  332 + prev_pay: '/shop/prev_pay', // 购物车点击结算
  333 + gwcshop: '/shop/gwcshop', //购物车数量修改保存
  334 + deletes: '/shop/deletes', //购物车删除
  335 + shopcar: '/shop/shopcar', // 购物车页面
  336 + now_prev_pay: '/shop/now_prev_pay', // 直接购买
  337 + addshop: '/shop/addshop', // 添加购物车
  338 + collect: '/product/collect', // 收藏
  339 + getInfo: '/product/getInfo', //商品详情
  340 + good_list: '/product/get', // 商品
  341 + index: '/cap/get', // 首页大小分类
  342 + banner: '/banner/index', // 轮播图
  343 + notice: '/cap/notice', // 公告
  344 + youfei: '/shop/youfei1', // 单算邮费
  345 + youfei1: '/shop/youfei', // 購物車邮费
  346 + shopcarNum: '/shop/shopcarnum', // 购物车数量
  347 + orderlist: '/shop/orderlist', // 订单各状态数量
  348 + order_read: '/shop/read', // 订单数
  349 + orderMixed: '/order/zhifu',
  350 + },
  351 + globalData: {
  352 + login_new: "",
  353 + // 滨海
  354 + baseUrlimg: 'https://binhaidispark.w.broing.cn/',
  355 + // 天远
  356 + // baseUrlimg: 'https://binhaidispark2.w.broing.cn/api',
  357 + }
372 }) 358 })
373 // 滨海wx73497072e7340d61 359 // 滨海wx73497072e7340d61
374 // 天远wx2980402f625c4f80 360 // 天远wx2980402f625c4f80
1 -const app=getApp() 1 +const app = getApp()
2 Component({ 2 Component({
3 - /**  
4 - * 组件的属性列表  
5 - */  
6 - properties: {  
7 - list: Array  
8 - }, 3 + /**
  4 + * 组件的属性列表
  5 + */
  6 + properties: {
  7 + list: Array
  8 + },
9 9
10 - /**  
11 - * 组件的初始数据  
12 - */  
13 - data: { 10 + /**
  11 + * 组件的初始数据
  12 + */
  13 + data: {
14 14
15 - }, 15 + },
16 16
17 - /**  
18 - * 组件的方法列表  
19 - */  
20 - methods: {  
21 - look_more(e) {  
22 - let login_new=app.globalData.login_new;  
23 - if(login_new==0){  
24 - wx.showToast({  
25 - title: '您还不是会员',  
26 - icon:"none" 17 + /**
  18 + * 组件的方法列表
  19 + */
  20 + methods: {
  21 + look_more(e) {
  22 + // 2023-10-19 需求是任何人都可以看商品
  23 + // let login_new=app.globalData.login_new;
  24 + // if(login_new==0){
  25 + // wx.showToast({
  26 + // title: '您还不是会员',
  27 + // icon:"none"
  28 + // })
  29 + // setTimeout(function(){
  30 + // wx.navigateTo({
  31 + // url: '/packageA/pages/login/login',
  32 + // })
  33 + // },1500)
  34 + // return false
  35 + // }
  36 + let id = e.currentTarget.dataset.id
  37 + wx.navigateTo({
  38 + url: '/packageA/pages/shop_detail/shop_detail?id=' + id
27 }) 39 })
28 - setTimeout(function(){  
29 - wx.navigateTo({  
30 - url: '/packageA/pages/login/login',  
31 - })  
32 - },1500)  
33 - return false  
34 - }  
35 - let id = e.currentTarget.dataset.id  
36 - wx.navigateTo({  
37 - url: '/packageA/pages/shop_detail/shop_detail?id=' + id  
38 - }) 40 + },
39 }, 41 },
40 - },  
41 - lifetimes: {  
42 - created() {  
43 - // 在组件实例刚刚被创建时执行 42 + lifetimes: {
  43 + created() {
  44 + // 在组件实例刚刚被创建时执行
44 45
45 46
46 - },  
47 - attached() {  
48 - // 在组件实例进入页面节点树时执行  
49 - },  
50 - ready() {  
51 - // 在组件在视图层布局完成后执行  
52 - this.setData({  
53 - list: this.properties.list  
54 - }) 47 + },
  48 + attached() {
  49 + // 在组件实例进入页面节点树时执行
  50 + },
  51 + ready() {
  52 + // 在组件在视图层布局完成后执行
  53 + this.setData({
  54 + list: this.properties.list
  55 + })
55 56
56 - },  
57 - detached() {  
58 - // 在组件实例被从页面节点树移除时执行  
59 - },  
60 - } 57 + },
  58 + detached() {
  59 + // 在组件实例被从页面节点树移除时执行
  60 + },
  61 + }
61 }) 62 })
1 const app = getApp() 1 const app = getApp()
2 Page({ 2 Page({
3 3
4 - /**  
5 - * 页面的初始数据  
6 - */  
7 - data: {  
8 - selected: 0,  
9 - autoplay: true,  
10 - interval: 5000,  
11 - duration: 500,  
12 - circular: true,  
13 - current: 0,  
14 - zcurrent: 0, //用来记录当前swiper对应的索引index  
15 - length_num: 9, //指定展示的小分类数量  
16 - nav_index: 0,  
17 - c_index: 0, //筛选分类下标  
18 - page: 1, //页数  
19 - price: 'price desc', //价格排序方式  
20 - paynum: 'paynum desc', //销量排序方式  
21 - stick: 0,  
22 - activity: [],  
23 - xianshilist: [{}],  
24 - day: '',  
25 - hou: '',  
26 - min: '',  
27 - sec: '',  
28 - endTime: '',  
29 - activitystatus: '',  
30 - showtime: false,  
31 - status1: '',  
32 - status2: '',  
33 - title2: '',  
34 - scrollTop: '',  
35 - pid: '',  
36 - logok: '',  
37 - typename: 1,  
38 - list: [{  
39 - pagePath: "/packageA/pages/index/index",  
40 - text: "商品",  
41 - iconPath: "/images/tabbar/icon_75.png",  
42 - selectedIconPath: "/images/tabbar/icon_68.png"  
43 - },  
44 - {  
45 - pagePath: "/packageA/pages/message/message",  
46 - text: "消息",  
47 - iconPath: "/images/tabbar/message.png",  
48 - selectedIconPath: "/images/tabbar/messageactive.png"  
49 - },  
50 - {  
51 - pagePath: "/packageA/pages/shop_cart/shop_cart",  
52 - text: "购物车",  
53 - iconPath: "/images/tabbar/icon_70.png",  
54 - selectedIconPath: "/images/tabbar/icon_73.png"  
55 - },  
56 - {  
57 - pagePath: "/packageA/pages/my/my",  
58 - text: "我的",  
59 - iconPath: "/images/tabbar/icon_71.png",  
60 - selectedIconPath: "/images/tabbar/icon_72.png"  
61 - }  
62 - ]  
63 - },  
64 -  
65 -  
66 -  
67 -  
68 - scroll(e) {  
69 - // console.log(e.detail.scrollTop)  
70 - // if (e.detail.scrollTop >300){  
71 - // console.log(8888)  
72 - // this.setData({  
73 - // stick:1  
74 - // })  
75 - // }else{  
76 - // this.setData({  
77 - // stick:0  
78 - // })  
79 - // }  
80 -  
81 - // console.log(this.data.stick)  
82 - },  
83 -  
84 -  
85 - onLoad: function (options) {  
86 - console.log(app.globalData.index)  
87 - if (wx.getStorageSync('entrance_type') == '2') {  
88 - wx.setNavigationBarTitle({  
89 - title: '工会商城'  
90 - })  
91 - } else if (wx.getStorageSync('entrance_type') == '1') {  
92 - wx.setNavigationBarTitle({  
93 - title: '劳保商城'  
94 - })  
95 - } else if (wx.getStorageSync('entrance_type') == '3') {  
96 - wx.setNavigationBarTitle({  
97 - title: '办公采办'  
98 - })  
99 - }  
100 - if (app.globalData.index == undefined) {  
101 - let that = this;  
102 - let token = wx.getStorageSync('token');  
103 -  
104 - console.log('woshitoe', token);  
105 - if (token != "") {  
106 - console.log(9999)  
107 - this.getInfoFun()  
108 - }  
109 -  
110 - this.get_notice()  
111 - this.get_shopnum()  
112 - this.getmessagelist();  
113 - console.log('998867', this.data.pid)  
114 - if (this.data.pid) {  
115 - this.get_info(this.data.pid, 2);  
116 - } else {  
117 - this.get_info(0, 1);  
118 - }  
119 -  
120 - // 获取活动专区  
121 - this.getzhuanqulist();  
122 - this.getxianshi();  
123 - setTimeout(function () {  
124 - that.setData({  
125 - showtime: true  
126 - })  
127 - }, 990)  
128 - }  
129 - //控制显示隐藏  
130 - this.ishow()  
131 -  
132 - },  
133 -  
134 - // 获取个人信息  
135 - getInfoFun() {  
136 - let that = this;  
137 - let u = app.interface.readteacher;  
138 - app.post(u, {}).then((r) => {  
139 - console.log('3489523498', r)  
140 - if (r.code == 200) {  
141 -  
142 - app.globalData.login_new = r.msg.login_new;  
143 - app.globalData.status = r.msg.status;  
144 - console.log(app.globalData.status)  
145 - // t.setData({  
146 - // obj: r.msg  
147 - // })  
148 - }  
149 - })  
150 - },  
151 - moremiao() {  
152 - let token = wx.getStorageSync("token")  
153 - if (token == '') {  
154 - wx.showModal({  
155 - title: '提示',  
156 - content: '请先登录',  
157 - success(res) {  
158 - if (res.confirm) { 4 + /**
  5 + * 页面的初始数据
  6 + */
  7 + data: {
  8 + selected: 0,
  9 + autoplay: true,
  10 + interval: 5000,
  11 + duration: 500,
  12 + circular: true,
  13 + current: 0,
  14 + zcurrent: 0, //用来记录当前swiper对应的索引index
  15 + length_num: 9, //指定展示的小分类数量
  16 + nav_index: 0,
  17 + c_index: 0, //筛选分类下标
  18 + page: 1, //页数
  19 + price: 'price desc', //价格排序方式
  20 + paynum: 'paynum desc', //销量排序方式
  21 + stick: 0,
  22 + activity: [],
  23 + xianshilist: [{}],
  24 + day: '',
  25 + hou: '',
  26 + min: '',
  27 + sec: '',
  28 + endTime: '',
  29 + activitystatus: '',
  30 + showtime: false,
  31 + status1: '',
  32 + status2: '',
  33 + title2: '',
  34 + scrollTop: '',
  35 + pid: '',
  36 + logok: '',
  37 + typename: 1,
  38 + list: [{
  39 + pagePath: "/packageA/pages/index/index",
  40 + text: "商品",
  41 + iconPath: "/images/tabbar/icon_75.png",
  42 + selectedIconPath: "/images/tabbar/icon_68.png"
  43 + },
  44 + {
  45 + pagePath: "/packageA/pages/message/message",
  46 + text: "消息",
  47 + iconPath: "/images/tabbar/message.png",
  48 + selectedIconPath: "/images/tabbar/messageactive.png"
  49 + },
  50 + {
  51 + pagePath: "/packageA/pages/shop_cart/shop_cart",
  52 + text: "购物车",
  53 + iconPath: "/images/tabbar/icon_70.png",
  54 + selectedIconPath: "/images/tabbar/icon_73.png"
  55 + },
  56 + {
  57 + pagePath: "/packageA/pages/my/my",
  58 + text: "我的",
  59 + iconPath: "/images/tabbar/icon_71.png",
  60 + selectedIconPath: "/images/tabbar/icon_72.png"
  61 + }
  62 + ]
  63 + },
  64 +
  65 + scroll(e) {
  66 + // console.log(e.detail.scrollTop)
  67 + // if (e.detail.scrollTop >300){
  68 + // console.log(8888)
  69 + // this.setData({
  70 + // stick:1
  71 + // })
  72 + // }else{
  73 + // this.setData({
  74 + // stick:0
  75 + // })
  76 + // }
  77 + // console.log(this.data.stick)
  78 + },
  79 +
  80 + onLoad: function (options) {
  81 + if (options.token) {
  82 + wx.setStorageSync('token', options.token)
  83 + }
  84 + if (wx.getStorageSync('entrance_type') == '2') {
  85 + wx.setNavigationBarTitle({
  86 + title: '工会商城'
  87 + })
  88 + } else if (wx.getStorageSync('entrance_type') == '1') {
  89 + wx.setNavigationBarTitle({
  90 + title: '劳保商城'
  91 + })
  92 + } else if (wx.getStorageSync('entrance_type') == '3') {
  93 + wx.setNavigationBarTitle({
  94 + title: '办公采办'
  95 + })
  96 + }
  97 + // if (app.globalData.index == undefined) {
  98 + // let that = this;
  99 + // let token = wx.getStorageSync('token');
  100 + // if (token != "") {
  101 + // this.getInfoFun()
  102 + // }
  103 + // this.get_notice()
  104 + // this.get_shopnum()
  105 + // this.getmessagelist();
  106 + // if (this.data.pid) {
  107 + // this.get_info(this.data.pid, 2);
  108 + // } else {
  109 + // this.get_info(0, 1);
  110 + // }
  111 + // // 获取活动专区
  112 + // this.getzhuanqulist();
  113 + // this.getxianshi();
  114 + // setTimeout(function () {
  115 + // that.setData({
  116 + // showtime: true
  117 + // })
  118 + // }, 990)
  119 + // }
  120 + //控制显示隐藏
  121 + // this.ishow()
  122 + },
  123 + // 获取个人信息
  124 + getInfoFun() {
  125 + let that = this;
  126 + let u = app.interface.readteacher;
  127 + app.post(u, {}).then((r) => {
  128 + if (r.code == 200) {
  129 + app.globalData.login_new = r.msg.login_new;
  130 + app.globalData.status = r.msg.status;
  131 + }
  132 + }).catch({})
  133 + },
  134 +
  135 + moremiao() {
  136 + let token = wx.getStorageSync("token")
  137 + if (token == '') {
  138 + wx.showModal({
  139 + title: '提示',
  140 + content: '请先登录',
  141 + success(res) {
  142 + if (res.confirm) {
  143 + wx.navigateTo({
  144 + url: '/packageA/pages/register/register',
  145 + })
  146 + } else if (res.cancel) { }
  147 + }
  148 + })
  149 + } else {
  150 + // 2023-10-19 需求是无需登录
  151 + // let login_new = wx.getStorageSync("login");
  152 + // if (login_new == 0) {
  153 + // wx.showToast({
  154 + // title: '您还不是会员',
  155 + // icon:"none"
  156 + // })
  157 + // setTimeout(function(){
  158 + // wx.navigateTo({
  159 + // url: '/pages/login/login',
  160 + // })
  161 + // },1500)
  162 + // return false
  163 + // wx.showModal({
  164 + // title: '提示',
  165 + // content: '您还不是会员',
  166 + // success(res) {
  167 + // if (res.confirm) {
  168 + // wx.navigateTo({
  169 + // url: '/packageA/pages/login/login',
  170 + // })
  171 + // } else if (res.cancel) { }
  172 + // }
  173 + // })
  174 + // return false
  175 + // }
159 wx.navigateTo({ 176 wx.navigateTo({
160 - url: '/packageA/pages/register/register', 177 + url: '/packageA/pages/xianshi/xianshi?title2=' + this.data.title2,
161 }) 178 })
162 - } else if (res.cancel) { }  
163 } 179 }
164 - })  
165 - } else {  
166 - let login_new = wx.getStorageSync("login");  
167 - if (login_new == 0) {  
168 - // wx.showToast({  
169 - // title: '您还不是会员',  
170 - // icon:"none"  
171 - // })  
172 - // setTimeout(function(){  
173 - // wx.navigateTo({  
174 - // url: '/pages/login/login',  
175 - // })  
176 - // },1500)  
177 - // return false  
178 -  
179 - wx.showModal({  
180 - title: '提示',  
181 - content: '您还不是会员',  
182 - success(res) {  
183 - if (res.confirm) {  
184 - wx.navigateTo({  
185 - url: '/packageA/pages/login/login',  
186 - })  
187 - } else if (res.cancel) { }  
188 - }  
189 - })  
190 180
191 - return false 181 + },
192 182
  183 + // 控制活动专区和限时抢购显示隐藏
  184 + ishow() {
  185 + let that = this
  186 + let url = '//wb/wb';
  187 + let data = {}
  188 + app.post(url, data, "POST").then((r) => {
  189 + that.setData({
  190 + status1: r.msg.status1,
  191 + status2: r.msg.status2,
  192 + title2: r.msg.title2
  193 + })
  194 + }).catch((err) => { })
  195 + },
193 196
194 - }  
195 - wx.navigateTo({  
196 - url: '/packageA/pages/xianshi/xianshi?title2=' + this.data.title2,  
197 - })  
198 - } 197 + // 限时抢购
  198 + getxianshi() {
  199 + let that = this
  200 + let url = '/special/get_all';
  201 + let data = {
  202 + page: 1,
  203 + pageNum: 6
  204 + }
  205 + app.post(url, data, "POST").then((r) => {
  206 + that.setData({
  207 + xianshilist: r.msg.list,
  208 + endTime: r.msg.residue_time,
  209 + activitystatus: r.msg.status
  210 + })
  211 + var time = that.date_format(r.msg.residue_time);
  212 + that.countDown()
  213 + // that.setData({
  214 + // messagelist: that.data.messagelist.concat(r.msg)
  215 + // })
  216 + // console.log(that.data.messagelist)
  217 + }).catch((err) => { })
  218 + },
199 219
200 - }, 220 + date_format(micro_second) {
  221 + // 总秒数
  222 + var second = micro_second;
  223 + // var second = Math.floor(micro_second / 1000);
  224 + // 天数
  225 + var day = Math.floor(second / 3600 / 24);
  226 + // 小时
  227 + var hr = Math.floor(second / 3600 % 24);
  228 + // 分钟
  229 + var min = Math.floor(second / 60 % 60);
  230 + // 秒
  231 + var sec = Math.floor(second % 60);
  232 + return day + "天" + hr + "小时" + min + "分钟" + sec + "秒";
  233 + },
201 234
202 - // 控制活动专区和限时抢购显示隐藏  
203 - ishow() {  
204 - let that = this  
205 - let url = '//wb/wb';  
206 - let data = { 235 + // 倒计时
  236 + countDown() {
  237 + var that = this;
  238 + console.log('999', that.data.endTime)
  239 + var time = that.data.endTime;
  240 + var interval = setInterval(function () {
  241 + // 秒数
  242 + let day = parseInt(time / (60 * 60 * 24));
  243 + let hou = parseInt(time % (60 * 60 * 24) / 3600);
  244 + let min = parseInt(time % (60 * 60 * 24) % 3600 / 60);
  245 + let sec = parseInt(time % (60 * 60 * 24) % 3600 % 60);
207 246
208 - }  
209 - app.post(url, data, "POST").then((r) => {  
210 - console.log('4456789', r)  
211 - that.setData({  
212 - status1: r.msg.status1,  
213 - status2: r.msg.status2,  
214 - title2: r.msg.title2  
215 - }) 247 + that.setData({
  248 + day: that.timeFormat(day),
  249 + hou: that.timeFormat(hou),
  250 + min: that.timeFormat(min),
  251 + sec: that.timeFormat(sec)
  252 + })
216 253
  254 + time--;
  255 + if (time <= 0) {
  256 + clearInterval(interval);
217 257
  258 + }
  259 + }.bind(this), 1000);
  260 + },
218 261
219 - }).catch((err) => { })  
220 - }, 262 + timeFormat(param) {
  263 + return param < 10 ? '0' + param : param;
  264 + },
221 265
222 - // 限时抢购  
223 - getxianshi() {  
224 - let that = this  
225 - let url = '/special/get_all';  
226 - let data = {  
227 - page: 1,  
228 - pageNum: 6 266 + //获取活动专区列表
  267 + getzhuanqulist() {
  268 + let that = this
  269 + let url = '/activity/get_all';
  270 + let data = {}
  271 + app.post(url, data, "POST").then((r) => {
  272 + console.log(r)
  273 + that.setData({
  274 + activity: r.msg
  275 + })
  276 + // that.setData({
  277 + // messagelist: that.data.messagelist.concat(r.msg)
  278 + // })
  279 + // console.log(that.data.messagelist)
  280 + }).catch((err) => { })
  281 + },
229 282
230 - }  
231 - app.post(url, data, "POST").then((r) => {  
232 - console.log(r)  
233 - console.log(r.msg.residue_time)  
234 - that.setData({  
235 - xianshilist: r.msg.list,  
236 - endTime: r.msg.residue_time,  
237 - activitystatus: r.msg.status  
238 - })  
239 - var time = that.date_format(r.msg.residue_time);  
240 - console.log('9988776', that.data.activitystatus)  
241 -  
242 - that.countDown()  
243 -  
244 - console.log(that.data.xianshilist)  
245 - // that.setData({  
246 - // messagelist: that.data.messagelist.concat(r.msg)  
247 - // })  
248 -  
249 - // console.log(that.data.messagelist)  
250 -  
251 - }).catch((err) => { })  
252 - },  
253 -  
254 - date_format(micro_second) {  
255 - // 总秒数  
256 - var second = micro_second;  
257 - // var second = Math.floor(micro_second / 1000);  
258 - // 天数  
259 - var day = Math.floor(second / 3600 / 24);  
260 - // 小时  
261 - var hr = Math.floor(second / 3600 % 24);  
262 - // 分钟  
263 - var min = Math.floor(second / 60 % 60);  
264 - // 秒  
265 - var sec = Math.floor(second % 60);  
266 - return day + "天" + hr + "小时" + min + "分钟" + sec + "秒";  
267 - },  
268 -  
269 - // 倒计时  
270 - countDown() {  
271 - var that = this;  
272 - console.log('999', that.data.endTime)  
273 - var time = that.data.endTime;  
274 - var interval = setInterval(function () {  
275 - // 秒数  
276 - let day = parseInt(time / (60 * 60 * 24));  
277 - let hou = parseInt(time % (60 * 60 * 24) / 3600);  
278 - let min = parseInt(time % (60 * 60 * 24) % 3600 / 60);  
279 - let sec = parseInt(time % (60 * 60 * 24) % 3600 % 60);  
280 -  
281 - that.setData({  
282 - day: that.timeFormat(day),  
283 - hou: that.timeFormat(hou),  
284 - min: that.timeFormat(min),  
285 - sec: that.timeFormat(sec)  
286 - })  
287 -  
288 - time--;  
289 - if (time <= 0) {  
290 - clearInterval(interval);  
291 -  
292 - }  
293 - }.bind(this), 1000);  
294 - },  
295 -  
296 - timeFormat(param) {  
297 - return param < 10 ? '0' + param : param;  
298 - },  
299 -  
300 - //获取活动专区列表  
301 - getzhuanqulist() {  
302 - let that = this  
303 - let url = '/activity/get_all';  
304 - let data = {}  
305 - app.post(url, data, "POST").then((r) => {  
306 - console.log(r)  
307 - that.setData({  
308 - activity: r.msg  
309 - })  
310 -  
311 - console.log(that.data.activity)  
312 - // that.setData({  
313 - // messagelist: that.data.messagelist.concat(r.msg)  
314 - // })  
315 -  
316 - // console.log(that.data.messagelist)  
317 -  
318 - }).catch((err) => { })  
319 - },  
320 -  
321 - // 活动专区查看更多  
322 - seeactive(e) {  
323 - let id = e.currentTarget.dataset.id  
324 - let token = wx.getStorageSync("token")  
325 - if (token == '') {  
326 - wx.showModal({  
327 - title: '提示',  
328 - content: '请先登录',  
329 - success(res) {  
330 - if (res.confirm) { 283 + // 活动专区查看更多
  284 + seeactive(e) {
  285 + let id = e.currentTarget.dataset.id
  286 + let token = wx.getStorageSync("token")
  287 + if (token == '') {
  288 + wx.showModal({
  289 + title: '提示',
  290 + content: '请先登录',
  291 + success(res) {
  292 + if (res.confirm) {
  293 + wx.navigateTo({
  294 + url: '/packageA/pages/register/register',
  295 + })
  296 + } else if (res.cancel) { }
  297 + }
  298 + })
  299 + } else {
  300 + // 2023-10-19 需求是无需登录
  301 + // let login_new = wx.getStorageSync('login');
  302 + // if (login_new == 0) {
  303 + // wx.showModal({
  304 + // title: '提示',
  305 + // content: '您还不是会员',
  306 + // success(res) {
  307 + // if (res.confirm) {
  308 + // wx.navigateTo({
  309 + // url: '/packageA/pages/login/login',
  310 + // })
  311 + // } else if (res.cancel) { }
  312 + // }
  313 + // })
  314 + // return false
  315 + // }
331 wx.navigateTo({ 316 wx.navigateTo({
332 - url: '/packageA/pages/register/register', 317 + url: '/packageA/pages/zhuanqu/zhuanqu?id=' + id,
333 }) 318 })
334 - } else if (res.cancel) { }  
335 } 319 }
336 - })  
337 - } else {  
338 - let login_new = wx.getStorageSync('login');  
339 - if (login_new == 0) {  
340 - wx.showModal({  
341 - title: '提示',  
342 - content: '您还不是会员',  
343 - success(res) {  
344 - if (res.confirm) {  
345 - wx.navigateTo({  
346 - url: '/packageA/pages/login/login',  
347 - })  
348 - } else if (res.cancel) { }  
349 - }  
350 - })  
351 -  
352 - return false  
353 - }  
354 - wx.navigateTo({  
355 - url: '/packageA/pages/zhuanqu/zhuanqu?id=' + id,  
356 - })  
357 - }  
358 -  
359 - }, 320 + },
360 321
361 - more() {  
362 - let token = wx.getStorageSync("token")  
363 - if (token == '') {  
364 - wx.showModal({  
365 - title: '提示',  
366 - content: '请先登录',  
367 - success(res) {  
368 - if (res.confirm) {  
369 - wx.navigateTo({  
370 - url: '/packageA/pages/register/register', 322 + more() {
  323 + let token = wx.getStorageSync("token")
  324 + if (token == '') {
  325 + wx.showModal({
  326 + title: '提示',
  327 + content: '请先登录',
  328 + success(res) {
  329 + if (res.confirm) {
  330 + wx.navigateTo({
  331 + url: '/packageA/pages/register/register',
  332 + })
  333 + } else if (res.cancel) { }
  334 + }
371 }) 335 })
372 - } else if (res.cancel) { } 336 + return false
373 } 337 }
374 - })  
375 -  
376 - return false  
377 - }  
378 - let login_new = wx.getStorageSync('login');  
379 - if (login_new == 0) {  
380 - wx.showModal({  
381 - title: '提示',  
382 - content: '您还不是会员',  
383 - success(res) {  
384 - if (res.confirm) {  
385 -  
386 - 338 + // 2023-10-19 需求是无需登录
  339 + // let login_new = wx.getStorageSync('login');
  340 + // if (login_new == 0) {
  341 + // wx.showModal({
  342 + // title: '提示',
  343 + // content: '您还不是会员',
  344 + // success(res) {
  345 + // if (res.confirm) {
  346 + // wx.navigateTo({
  347 + // url: '/packageA/pages/login/login',
  348 + // })
  349 + // } else if (res.cancel) { }
  350 + // }
  351 + // })
  352 + // return false
  353 + // }
  354 + wx.navigateTo({
  355 + url: '/packageA/pages/classify/classify',
  356 + })
  357 + },
  358 + //展示所有的小分类
  359 + show_all() {
  360 + this.setData({
  361 + length_num: this.data.length_num == 9 ? this.data.class_arr.length : 9
  362 + })
  363 + },
  364 + // 查看小分类
  365 + look_item(e) {
  366 + let token = wx.getStorageSync("token")
  367 + if (token == '') {
  368 + wx.showModal({
  369 + title: '提示',
  370 + content: '请先登录',
  371 + success(res) {
  372 + if (res.confirm) {
  373 + wx.navigateTo({
  374 + url: '/packageA/pages/register/register',
  375 + })
  376 + } else if (res.cancel) { }
  377 + }
  378 + })
  379 + } else {
  380 + // 2023-10-19 需求是无需登录
  381 + // let login_new = wx.getStorageSync('login');
  382 + // let gh_login = wx.getStorageSync('gh_login');
  383 + // let cb_login = wx.getStorageSync('cb_login');
  384 + // let loginType = wx.getStorageSync('entrance_type');
  385 + // if (loginType == 1) {
  386 + // if (login_new == 0) {
  387 + // wx.showModal({
  388 + // title: '提示',
  389 + // content: '请绑定账户后操作',
  390 + // success(res) {
  391 + // if (res.confirm) {
  392 + // wx.navigateTo({
  393 + // url: '/packageA/pages/login/login',
  394 + // })
  395 + // } else if (res.cancel) {
  396 +
  397 + // }
  398 + // }
  399 + // })
  400 +
  401 + // return false
  402 + // }
  403 + // } else if (loginType == 2) {
  404 + // if (gh_login == 0) {
  405 + // wx.showModal({
  406 + // title: '提示',
  407 + // content: '请绑定账户后操作',
  408 + // success(res) {
  409 + // if (res.confirm) {
  410 + // wx.navigateTo({
  411 + // url: '/packageA/pages/login/login',
  412 + // })
  413 + // } else if (res.cancel) {
  414 +
  415 + // }
  416 + // }
  417 + // })
  418 +
  419 + // return false
  420 + // }
  421 + // } else if (loginType == 3) {
  422 + // if (cb_login == 0) {
  423 + // wx.showModal({
  424 + // title: '提示',
  425 + // content: '请绑定账户后操作',
  426 + // success(res) {
  427 + // if (res.confirm) {
  428 + // wx.navigateTo({
  429 + // url: '/packageA/pages/login/login',
  430 + // })
  431 + // } else if (res.cancel) {
  432 +
  433 + // }
  434 + // }
  435 + // })
  436 +
  437 + // return false
  438 + // }
  439 + // }
  440 +
  441 + let title = this.data.nav_arr[this.data.nav_index].name
  442 + let index = e.currentTarget.dataset.index ? e.currentTarget.dataset.index : 0
  443 + let pid = this.data.nav_arr[this.data.nav_index].id
387 wx.navigateTo({ 444 wx.navigateTo({
388 - url: '/packageA/pages/login/login', 445 + url: '/packageA/pages/search/search_result/search_result?title=' + title + "&index=" + index + '&pid=' + pid
389 }) 446 })
390 - } else if (res.cancel) { }  
391 } 447 }
392 - })  
393 448
394 - return false  
395 - }  
396 - wx.navigateTo({  
397 - url: '/packageA/pages/classify/classify',  
398 - })  
399 - },  
400 - //展示所有的小分类  
401 - show_all() {  
402 - this.setData({  
403 - length_num: this.data.length_num == 9 ? this.data.class_arr.length : 9  
404 - })  
405 - },  
406 - // 查看小分类  
407 - look_item(e) {  
408 - let token = wx.getStorageSync("token")  
409 - if (token == '') {  
410 - wx.showModal({  
411 - title: '提示',  
412 - content: '请先登录',  
413 - success(res) {  
414 - if (res.confirm) {  
415 - wx.navigateTo({  
416 - url: '/packageA/pages/register/register', 449 + },
  450 + //监测轮播图变化
  451 + swiperChange(e) {
  452 + this.setData({
  453 + zcurrent: e.detail.current
  454 + })
  455 + },
  456 + //轮播图
  457 + look_more(e) {
  458 + let token = wx.getStorageSync("token")
  459 + let id = e.currentTarget.dataset.id
  460 + let style = e.currentTarget.dataset.style
  461 + if (token == '') {
  462 + wx.showModal({
  463 + title: '提示',
  464 + content: '请先登录',
  465 + success(res) {
  466 + if (res.confirm) {
  467 + wx.navigateTo({
  468 + url: '/packageA/pages/register/register',
  469 + })
  470 + } else if (res.cancel) { }
  471 + }
417 }) 472 })
418 - } else if (res.cancel) { }  
419 - }  
420 - })  
421 - } else {  
422 - let login_new = wx.getStorageSync('login');  
423 - let gh_login = wx.getStorageSync('gh_login');  
424 - let cb_login = wx.getStorageSync('cb_login');  
425 - let loginType = wx.getStorageSync('entrance_type');  
426 - if (loginType == 1) {  
427 - if (login_new == 0) {  
428 - wx.showModal({  
429 - title: '提示',  
430 - content: '请绑定账户后操作',  
431 - success(res) {  
432 - if (res.confirm) { 473 + } else {
  474 + // 2023-10-19 需求是无需登录
  475 + // let login_new = wx.getStorageSync('login');
  476 + // if (login_new == 0) {
  477 + // wx.showModal({
  478 + // title: '提示',
  479 + // content: '您还不是会员',
  480 + // success(res) {
  481 + // if (res.confirm) {
  482 + // wx.navigateTo({
  483 + // url: '/packageA/pages/login/login',
  484 + // })
  485 + // } else if (res.cancel) { }
  486 + // }
  487 + // })
  488 + // return false
  489 + // }
  490 + if (style == 2) {
433 wx.navigateTo({ 491 wx.navigateTo({
434 - url: '/packageA/pages/login/login', 492 + url: '/packageA/pages/outerChain/outerChain?src=' + e.currentTarget.dataset.src
435 }) 493 })
436 - } else if (res.cancel) {  
437 -  
438 - }  
439 - }  
440 - })  
441 -  
442 - return false  
443 - }  
444 - } else if(loginType == 2){  
445 - if (gh_login == 0) {  
446 - wx.showModal({  
447 - title: '提示',  
448 - content: '请绑定账户后操作',  
449 - success(res) {  
450 - if (res.confirm) { 494 + } else {
451 wx.navigateTo({ 495 wx.navigateTo({
452 - url: '/packageA/pages/login/login', 496 + url: '/packageA/pages/shop_detail/shop_detail?id=' + id
453 }) 497 })
454 - } else if (res.cancel) {  
455 -  
456 - }  
457 } 498 }
458 - })  
459 -  
460 - return false  
461 } 499 }
462 - }else if(loginType == 3){  
463 - if (cb_login == 0) {  
464 - wx.showModal({  
465 - title: '提示',  
466 - content: '请绑定账户后操作',  
467 - success(res) {  
468 - if (res.confirm) {  
469 - wx.navigateTo({  
470 - url: '/packageA/pages/login/login',  
471 - })  
472 - } else if (res.cancel) {  
473 500
474 - } 501 + },
  502 + // 排序
  503 + reorder(e) {
  504 + let that = this
  505 + let index = Number(e.currentTarget.dataset.index)
  506 + if (index == 1) {
  507 + if (that.data.price == "price") {
  508 + that.setData({
  509 + price: 'price desc'
  510 + })
  511 + } else {
  512 + that.setData({
  513 + price: 'price'
  514 + })
  515 + }
  516 + } else if (index == 2) {
  517 + if (that.data.paynum == "paynum") {
  518 + that.setData({
  519 + paynum: 'paynum desc'
  520 + })
  521 + } else {
  522 + that.setData({
  523 + paynum: 'paynum'
  524 + })
475 } 525 }
476 - })  
477 -  
478 - return false  
479 - }  
480 - }  
481 -  
482 - let title = this.data.nav_arr[this.data.nav_index].name  
483 - let index = e.currentTarget.dataset.index ? e.currentTarget.dataset.index : 0  
484 - let pid = this.data.nav_arr[this.data.nav_index].id  
485 - wx.navigateTo({  
486 - url: '/packageA/pages/search/search_result/search_result?title=' + title + "&index=" + index + '&pid=' + pid  
487 - })  
488 - }  
489 -  
490 - },  
491 - //监测轮播图变化  
492 - swiperChange(e) {  
493 - this.setData({  
494 - zcurrent: e.detail.current  
495 - })  
496 - },  
497 - //轮播图  
498 - look_more(e) {  
499 - let token = wx.getStorageSync("token")  
500 - let id = e.currentTarget.dataset.id  
501 - let style = e.currentTarget.dataset.style  
502 - if (token == '') {  
503 - wx.showModal({  
504 - title: '提示',  
505 - content: '请先登录',  
506 - success(res) {  
507 - if (res.confirm) {  
508 - wx.navigateTo({  
509 - url: '/packageA/pages/register/register',  
510 - })  
511 - } else if (res.cancel) { }  
512 } 526 }
513 - })  
514 - } else {  
515 - let login_new = wx.getStorageSync('login');  
516 - if (login_new == 0) {  
517 - wx.showModal({  
518 - title: '提示',  
519 - content: '您还不是会员',  
520 - success(res) {  
521 - if (res.confirm) {  
522 - wx.navigateTo({  
523 - url: '/packageA/pages/login/login',  
524 - })  
525 - } else if (res.cancel) { }  
526 - }  
527 - })  
528 - return false  
529 - }  
530 - if (style == 2) {  
531 - wx.navigateTo({  
532 - url: '/packageA/pages/outerChain/outerChain?src=' + e.currentTarget.dataset.src 527 + this.setData({
  528 + c_index: e.currentTarget.dataset.index,
  529 + page: 1,
  530 + page_type: false
533 }) 531 })
534 - } else {  
535 - wx.navigateTo({  
536 - url: '/packageA/pages/shop_detail/shop_detail?id=' + id  
537 - })  
538 - }  
539 - }  
540 -  
541 - },  
542 -  
543 - 532 + //调用排序接口
  533 + this.good_list(this.data.pid, e.currentTarget.dataset.index)
  534 + },
544 535
  536 + select_nav(e) {
  537 + let index = Number(e.currentTarget.dataset.index)
  538 + let id = e.currentTarget.dataset.id;
  539 + this.setData({
  540 + pid: id
  541 + })
545 542
546 - // 排序  
547 - reorder(e) {  
548 - let that = this  
549 - let index = Number(e.currentTarget.dataset.index)  
550 - if (index == 1) {  
551 - if (that.data.price == "price") {  
552 - that.setData({  
553 - price: 'price desc' 543 + this.setData({
  544 + scrollTop: 0
554 }) 545 })
555 - } else {  
556 - that.setData({  
557 - price: 'price' 546 + if (index == this.data.nav_index) {
  547 + return
  548 + } else {
  549 + this.setData({
  550 + nav_index: index,
  551 + page: 1,
  552 + page_type: false,
  553 + c_index: 0, //筛选分类下标
  554 + price: 'price desc', //价格排序方式
  555 + paynum: 'paynum desc' //销量排序方式
  556 + })
  557 + this.get_info(id, 2)
  558 + }
  559 + },
  560 + // 轮播图
  561 + get_banner() {
  562 + let url = app.interface.banner
  563 + app.post(url, {}).then((res) => {
  564 + this.setData({
  565 + imgurl: res.msg
  566 + })
558 }) 567 })
559 - }  
560 - } else if (index == 2) {  
561 - if (that.data.paynum == "paynum") {  
562 - that.setData({  
563 - paynum: 'paynum desc' 568 + },
  569 + //获取公告
  570 + get_notice() {
  571 + let that = this
  572 + let url = app.interface.notice
  573 + app.post(url, {}).then((res) => {
  574 + for (let obj of res.msg) {
  575 + obj.createtime = obj.createtime.substring(0, 10)
  576 + }
  577 + that.setData({
  578 + notice: res.msg
  579 + })
564 }) 580 })
565 - } else {  
566 - that.setData({  
567 - paynum: 'paynum' 581 + },
  582 + //获取页面信息
  583 + get_info(pid, type) { //type 1为小标题 2为小标题下的小分类
  584 + wx.showLoading({
  585 + title: '加载中',
  586 + mask: true
568 }) 587 })
569 - }  
570 - }  
571 - this.setData({  
572 - c_index: e.currentTarget.dataset.index,  
573 - page: 1,  
574 - page_type: false  
575 - })  
576 - //调用排序接口  
577 - this.good_list(this.data.pid, e.currentTarget.dataset.index)  
578 - },  
579 -  
580 - select_nav(e) {  
581 - let index = Number(e.currentTarget.dataset.index)  
582 - let id = e.currentTarget.dataset.id;  
583 - this.setData({  
584 - pid: id  
585 - })  
586 -  
587 - this.setData({  
588 - scrollTop: 0  
589 - })  
590 - if (index == this.data.nav_index) {  
591 - return  
592 - } else {  
593 - this.setData({  
594 - nav_index: index,  
595 - page: 1,  
596 - page_type: false,  
597 - c_index: 0, //筛选分类下标  
598 - price: 'price desc', //价格排序方式  
599 - paynum: 'paynum desc' //销量排序方式  
600 - })  
601 - this.get_info(id, 2)  
602 - }  
603 - },  
604 - // 轮播图  
605 - get_banner() {  
606 - let url = app.interface.banner  
607 - app.post(url, {}).then((res) => {  
608 - this.setData({  
609 - imgurl: res.msg  
610 - })  
611 - })  
612 - },  
613 - //获取公告  
614 - get_notice() {  
615 - let that = this  
616 - let url = app.interface.notice  
617 - app.post(url, {}).then((res) => {  
618 - for (let obj of res.msg) {  
619 - obj.createtime = obj.createtime.substring(0, 10)  
620 - }  
621 - that.setData({  
622 - notice: res.msg  
623 - })  
624 - })  
625 - },  
626 - //获取页面信息  
627 - get_info(pid, type) { //type 1为小标题 2为小标题下的小分类  
628 - wx.showLoading({  
629 - title: '加载中',  
630 - mask: true  
631 - })  
632 - let that = this  
633 - let url = app.interface.index  
634 - let params = {  
635 - pid: pid  
636 - }  
637 - app.post(url, params).then((res) => {  
638 - console.log('88776654', res)  
639 - wx.hideLoading()  
640 - if (type == 1) {  
641 - let obj = {  
642 - name: '首页',  
643 - id: '' 588 + let that = this
  589 + let url = app.interface.index
  590 + let params = {
  591 + pid: pid
644 } 592 }
645 - res.msg.unshift(obj)  
646 - that.setData({  
647 - nav_arr: res.msg  
648 - })  
649 - that.get_info(res.msg[0].id, 2)  
650 - } else if (type == 2) {  
651 - console.log('666', res)  
652 - // let obj = {  
653 - // name: '全部',  
654 - // id: ''  
655 - // }  
656 - // res.msg.unshift(obj)  
657 - that.setData({  
658 - class_arr: res.msg,  
659 - cid: '' 593 + app.post(url, params).then((res) => {
  594 + console.log('88776654', res)
  595 + wx.hideLoading()
  596 + if (type == 1) {
  597 + let obj = {
  598 + name: '首页',
  599 + id: ''
  600 + }
  601 + res.msg.unshift(obj)
  602 + that.setData({
  603 + nav_arr: res.msg
  604 + })
  605 + that.get_info(res.msg[0].id, 2)
  606 + } else if (type == 2) {
  607 + console.log('666', res)
  608 + // let obj = {
  609 + // name: '全部',
  610 + // id: ''
  611 + // }
  612 + // res.msg.unshift(obj)
  613 + that.setData({
  614 + class_arr: res.msg,
  615 + cid: ''
  616 + })
  617 + that.good_list(pid, that.data.c_index)
  618 + }
  619 + }).catch((er) => {
  620 + wx.hideLoading()
660 }) 621 })
661 - that.good_list(pid, that.data.c_index)  
662 - }  
663 - }).catch((er) => {  
664 - wx.hideLoading()  
665 - })  
666 - },  
667 - //获取商品列表  
668 - good_list(pid, c_index) {  
669 - wx.showLoading({  
670 - title: '加载中',  
671 - mask: true  
672 - })  
673 - let that = this  
674 - let url = app.interface.good_list  
675 - let params = {  
676 - pid: pid,  
677 - page: that.data.page  
678 - }  
679 - if (c_index == 1) {  
680 - params.price = that.data.price  
681 - } else if (c_index == 2) {  
682 - params.paynum = that.data.paynum  
683 - }  
684 - app.post(url, params).then((res) => {  
685 - let list = res.msg;  
686 - for (let obj of list) {  
687 - obj.sales = obj.paynum  
688 - }  
689 - if (that.data.page == 1) {  
690 - wx.hideLoading()  
691 -  
692 - that.setData({  
693 - shop_arr: list 622 + },
  623 + //获取商品列表
  624 + good_list(pid, c_index) {
  625 + wx.showLoading({
  626 + title: '加载中',
  627 + mask: true
694 }) 628 })
695 - } else {  
696 - if (res.msg.length == 0) {  
697 - wx.hideLoading()  
698 - that.setData({  
699 - page_type: true  
700 - })  
701 - } else {  
702 - setTimeout(() => {  
703 - wx.hideLoading()  
704 - that.setData({  
705 - shop_arr: that.data.shop_arr.concat(list)  
706 - })  
707 - }, 1000) 629 + let that = this
  630 + let url = app.interface.good_list
  631 + let params = {
  632 + pid: pid,
  633 + page: that.data.page
708 } 634 }
709 - }  
710 - })  
711 - },  
712 -  
713 -  
714 - /**  
715 - * 生命周期函数--监听页面加载  
716 - */  
717 -  
718 - //获取购物车数量  
719 - get_shopnum() {  
720 - let that = this  
721 - let url = app.interface.shopcarNum  
722 - app.post(url, {}).then((res) => {  
723 - if (res.msg > 0) {  
724 - wx.showTabBarRedDot({  
725 - index: 2,  
726 - success: function (red) {  
727 - wx.setTabBarBadge({  
728 - index: 2,  
729 - text: res.msg.toString(),  
730 - })  
731 - }  
732 - })  
733 - } else {  
734 - wx.hideTabBarRedDot({  
735 - index: 2, 635 + if (c_index == 1) {
  636 + params.price = that.data.price
  637 + } else if (c_index == 2) {
  638 + params.paynum = that.data.paynum
  639 + }
  640 + app.post(url, params).then((res) => {
  641 + let list = res.msg;
  642 + for (let obj of list) {
  643 + obj.sales = obj.paynum
  644 + }
  645 + if (that.data.page == 1) {
  646 + wx.hideLoading()
  647 +
  648 + that.setData({
  649 + shop_arr: list
  650 + })
  651 + } else {
  652 + if (res.msg.length == 0) {
  653 + wx.hideLoading()
  654 + that.setData({
  655 + page_type: true
  656 + })
  657 + } else {
  658 + setTimeout(() => {
  659 + wx.hideLoading()
  660 + that.setData({
  661 + shop_arr: that.data.shop_arr.concat(list)
  662 + })
  663 + }, 1000)
  664 + }
  665 + }
736 }) 666 })
737 - }  
738 - })  
739 - }, 667 + },
740 668
741 - getmessagelist() {  
742 - let that = this  
743 - let url = '/information/get_all';  
744 - let data = {  
745 - page: 1,  
746 - pageNum: 10,  
747 669
748 - }  
749 - app.post(url, data, "POST").then((r) => {  
750 - // console.log(r)  
751 - // that.setData({  
752 - // messagelist: that.data.messagelist.concat(r.msg)  
753 - // })  
754 -  
755 - let newlist = [];  
756 - r.msg.forEach(function (value, index, array) {  
757 - console.log(newlist)  
758 - if (value.status == 1) {  
759 - newlist.push(value) 670 + /**
  671 + * 生命周期函数--监听页面加载
  672 + */
  673 +
  674 + //获取购物车数量
  675 + get_shopnum() {
  676 + let that = this
  677 + let url = app.interface.shopcarNum
  678 + app.post(url, {}).then((res) => {
  679 + if (res.msg > 0) {
  680 + wx.showTabBarRedDot({
  681 + index: 2,
  682 + success: function (red) {
  683 + wx.setTabBarBadge({
  684 + index: 2,
  685 + text: res.msg.toString(),
  686 + })
  687 + }
  688 + })
  689 + } else {
  690 + wx.hideTabBarRedDot({
  691 + index: 2,
  692 + })
  693 + }
  694 + }).catch(err => {})
  695 + },
  696 +
  697 + getmessagelist() {
  698 + let that = this
  699 + let url = '/information/get_all';
  700 + let data = {
  701 + page: 1,
  702 + pageNum: 10,
760 } 703 }
761 - }) 704 + app.post(url, data, "POST").then((r) => {
  705 + // console.log(r)
  706 + // that.setData({
  707 + // messagelist: that.data.messagelist.concat(r.msg)
  708 + // })
  709 + let newlist = [];
  710 + r.msg.forEach(function (value, index, array) {
  711 + if (value.status == 1) {
  712 + newlist.push(value)
  713 + }
  714 + })
  715 + if (newlist.length != 0) {
  716 + wx.showTabBarRedDot({
  717 + index: 1,
  718 + success: function (red) {
  719 + wx.setTabBarBadge({
  720 + index: 1,
  721 + text: newlist.length.toString(),
  722 + })
  723 + }
  724 + })
  725 + }
  726 + }).catch((err) => { })
  727 + },
  728 + // 获取个人信息
762 729
763 - console.log('77889944556', newlist)  
764 - if (newlist.length != 0) {  
765 - wx.showTabBarRedDot({  
766 - index: 1,  
767 - success: function (red) { 730 + /**
  731 + * 生命周期函数--监听页面初次渲染完成
  732 + */
  733 + onReady: function () {
768 734
769 - wx.setTabBarBadge({  
770 - index: 1,  
771 - text: newlist.length.toString(),  
772 - })  
773 - }  
774 - })  
775 - }  
776 -  
777 -  
778 - }).catch((err) => { })  
779 - },  
780 - // 获取个人信息  
781 -  
782 - /**  
783 - * 生命周期函数--监听页面初次渲染完成  
784 - */  
785 - onReady: function () {  
786 -  
787 - },  
788 -  
789 - /**  
790 - * 生命周期函数--监听页面显示  
791 - */  
792 - onShow: function () {  
793 -  
794 - this.setData({  
795 - logok: app.globalData.baseUrlimg + "assets/img/cb2ad36a391388f19f5f912fa021f8f.png"  
796 - })  
797 - console.log(this.data.logok)  
798 - // this.logok=app.globalData.baseUrlimg+"assets/img/cb2ad36a391388f19f5f912fa021f8f.png''  
799 - this.get_banner()  
800 - console.log(app.globalData.index)  
801 - if (app.globalData.index == 0) {  
802 - app.globalData.index = undefined  
803 - let token = wx.getStorageSync('token');  
804 - console.log('woshitoe', token)  
805 - if (token != "") {  
806 - this.getInfoFun()  
807 - }  
808 - this.get_notice()  
809 - this.get_shopnum()  
810 - this.getmessagelist();  
811 - console.log('998867', this.data.pid)  
812 - if (this.data.pid) {  
813 - this.get_info(this.data.pid, 2);  
814 - } else {  
815 - this.get_info(0, 1);  
816 - }  
817 -  
818 - //控制显示隐藏  
819 - this.ishow()  
820 - } 735 + },
821 736
  737 + /**
  738 + * 生命周期函数--监听页面显示
  739 + */
  740 + onShow: function () {
  741 + this.setData({
  742 + logok: app.globalData.baseUrlimg + "assets/img/cb2ad36a391388f19f5f912fa021f8f.png"
  743 + })
  744 + // this.logok=app.globalData.baseUrlimg+"assets/img/cb2ad36a391388f19f5f912fa021f8f.png''
  745 + this.get_banner()
  746 + // if (app.globalData.index == 0) {
  747 + // app.globalData.index = undefined
  748 + let token = wx.getStorageSync('token');
  749 + if (token != "") {
  750 + this.getInfoFun()
  751 + }
  752 + this.get_notice()
  753 + this.get_shopnum()
  754 + this.getmessagelist();
  755 + if (this.data.pid) {
  756 + this.get_info(this.data.pid, 2);
  757 + } else {
  758 + this.get_info(0, 1);
  759 + }
  760 + //控制显示隐藏
  761 + this.ishow()
  762 + // }
  763 + },
822 764
  765 + /**
  766 + * 生命周期函数--监听页面隐藏
  767 + */
  768 + onHide: function () {
823 769
824 - }, 770 + },
825 771
826 - /**  
827 - * 生命周期函数--监听页面隐藏  
828 - */  
829 - onHide: function () { 772 + /**
  773 + * 生命周期函数--监听页面卸载
  774 + */
  775 + onUnload: function () {
830 776
831 - }, 777 + },
832 778
833 - /**  
834 - * 生命周期函数--监听页面卸载  
835 - */  
836 - onUnload: function () { 779 + /**
  780 + * 页面相关事件处理函数--监听用户下拉动作
  781 + */
  782 + onPullDownRefresh: function () {
837 783
838 - }, 784 + },
  785 + loadMore(e) {
  786 + console.log(e)
  787 + let that = this
  788 + if (that.data.page_type) {
  789 + wx.showToast({
  790 + title: '暂无更多数据',
  791 + icon: 'none',
  792 + duration: 1000
  793 + })
  794 + return
  795 + }
  796 + that.setData({
  797 + page: that.data.page + 1
  798 + })
  799 + that.good_list(that.data.pid, that.data.c_index)
  800 + },
  801 + /**
  802 + * 页面上拉触底事件的处理函数
  803 + */
  804 + onReachBottom: function () {
  805 + console.log(43898438493)
  806 + let that = this
  807 + if (that.data.page_type) {
  808 + wx.showToast({
  809 + title: '暂无更多数据',
  810 + icon: 'none',
  811 + duration: 1000
  812 + })
  813 + return
  814 + }
  815 + that.setData({
  816 + page: that.data.page + 1
  817 + })
  818 + that.good_list(that.data.pid, that.data.c_index)
  819 + },
839 820
840 - /**  
841 - * 页面相关事件处理函数--监听用户下拉动作  
842 - */  
843 - onPullDownRefresh: function () { 821 + /**
  822 + * 用户点击右上角分享
  823 + */
  824 + onShareAppMessage: function () {
844 825
845 - },  
846 - loadMore(e) {  
847 - console.log(e)  
848 - let that = this  
849 - if (that.data.page_type) {  
850 - wx.showToast({  
851 - title: '暂无更多数据',  
852 - icon: 'none',  
853 - duration: 1000  
854 - })  
855 - return  
856 - }  
857 - that.setData({  
858 - page: that.data.page + 1  
859 - })  
860 - that.good_list(that.data.pid, that.data.c_index)  
861 - },  
862 - /**  
863 - * 页面上拉触底事件的处理函数  
864 - */  
865 - onReachBottom: function () {  
866 - console.log(43898438493)  
867 - let that = this  
868 - if (that.data.page_type) {  
869 - wx.showToast({  
870 - title: '暂无更多数据',  
871 - icon: 'none',  
872 - duration: 1000  
873 - })  
874 - return  
875 } 826 }
876 - that.setData({  
877 - page: that.data.page + 1  
878 - })  
879 - that.good_list(that.data.pid, that.data.c_index)  
880 - },  
881 -  
882 - /**  
883 - * 用户点击右上角分享  
884 - */  
885 - onShareAppMessage: function () {  
886 -  
887 - }  
888 }) 827 })
@@ -2,166 +2,166 @@ @@ -2,166 +2,166 @@
2 const app = getApp() 2 const app = getApp()
3 Page({ 3 Page({
4 4
5 - /**  
6 - * 页面的初始数据  
7 - */  
8 - data: {  
9 - page: 1,  
10 - messagelist: [],  
11 - token:'',  
12 - login_new:'',  
13 - selected:1,  
14 - list:[{  
15 -         pagePath: "/packageA/pages/index/index",  
16 -         text: "商品",  
17 -         iconPath: "/images/tabbar/icon_75.png",  
18 -         selectedIconPath: "/images/tabbar/icon_68.png"  
19 -       },  
20 -       {  
21 -         pagePath: "/packageA/pages/message/message",  
22 -         text: "消息",  
23 -         iconPath: "/images/tabbar/message.png",  
24 -         selectedIconPath: "/images/tabbar/messageactive.png"  
25 -       },  
26 -       {  
27 -         pagePath: "/packageA/pages/shop_cart/shop_cart",  
28 -         text: "购物车",  
29 -         iconPath: "/images/tabbar/icon_70.png",  
30 -         selectedIconPath: "/images/tabbar/icon_73.png"  
31 -       },  
32 -       {  
33 -         pagePath"/packageA/pages/my/my",  
34 -         text"我的",  
35 -         iconPath"/images/tabbar/icon_71.png",  
36 -         selectedIconPath"/images/tabbar/icon_72.png"  
37 -       }]  
38 - },  
39 -  
40 - /**  
41 - * 生命周期函数--监听页面加载  
42 - */  
43 - onLoad: function(options) {  
44 -  
45 - },  
46 -  
47 - getmessagelist() {  
48 - let that = this  
49 - let url = '/information/get_all';  
50 - let data = {  
51 - page: that.data.page,  
52 - pageNum: 10, 5 + /**
  6 + * 页面的初始数据
  7 + */
  8 + data: {
  9 + page: 1,
  10 + messagelist: [],
  11 + token: '',
  12 + login_new: '',
  13 + selected: 1,
  14 + list: [{
  15 + pagePath: "/packageA/pages/index/index",
  16 + text: "商品",
  17 + iconPath: "/images/tabbar/icon_75.png",
  18 + selectedIconPath: "/images/tabbar/icon_68.png"
  19 + },
  20 + {
  21 + pagePath: "/packageA/pages/message/message",
  22 + text: "消息",
  23 + iconPath: "/images/tabbar/message.png",
  24 + selectedIconPath: "/images/tabbar/messageactive.png"
  25 + },
  26 + {
  27 + pagePath: "/packageA/pages/shop_cart/shop_cart",
  28 + text: "购物车",
  29 + iconPath: "/images/tabbar/icon_70.png",
  30 + selectedIconPath: "/images/tabbar/icon_73.png"
  31 + },
  32 + {
  33 + pagePath: "/packageA/pages/my/my",
  34 + text: "我的",
  35 + iconPath: "/images/tabbar/icon_71.png",
  36 + selectedIconPath: "/images/tabbar/icon_72.png"
  37 + }]
  38 + },
  39 +
  40 + /**
  41 + * 生命周期函数--监听页面加载
  42 + */
  43 + onLoad: function (options) {
  44 +
  45 + },
  46 +
  47 + getmessagelist() {
  48 + let that = this
  49 + let url = '/information/get_all';
  50 + let data = {
  51 + page: that.data.page,
  52 + pageNum: 10,
53 53
54 - }  
55 - app.post(url, data, "POST").then((r) => {  
56 - console.log(r)  
57 - that.setData({  
58 - messagelist: that.data.messagelist.concat(r.msg)  
59 - })  
60 -  
61 - let newlist = [];  
62 - that.data.messagelist.forEach(function(value, index, array) {  
63 - console.log(newlist)  
64 - if (value.status == 1) {  
65 - newlist.push(value)  
66 } 54 }
67 - })  
68 -  
69 - console.log(newlist)  
70 - if (newlist.length != 0) {  
71 - wx.showTabBarRedDot({  
72 - index: 1,  
73 - success: function(red) {  
74 - wx.setTabBarBadge({  
75 - index: 1,  
76 - text: newlist.length.toString(), 55 + app.post(url, data, "POST").then((r) => {
  56 + console.log(r)
  57 + that.setData({
  58 + messagelist: that.data.messagelist.concat(r.msg)
  59 + })
  60 +
  61 + let newlist = [];
  62 + that.data.messagelist.forEach(function (value, index, array) {
  63 + console.log(newlist)
  64 + if (value.status == 1) {
  65 + newlist.push(value)
  66 + }
77 }) 67 })
78 - } 68 +
  69 + console.log(newlist)
  70 + if (newlist.length != 0) {
  71 + wx.showTabBarRedDot({
  72 + index: 1,
  73 + success: function (red) {
  74 + wx.setTabBarBadge({
  75 + index: 1,
  76 + text: newlist.length.toString(),
  77 + })
  78 + }
  79 + })
  80 + } else {
  81 + wx.hideTabBarRedDot({
  82 + index: 1,
  83 + success: function (red) {
  84 +
  85 + // wx.setTabBarBadge({
  86 + // index: 1,
  87 + // text: newlist.length.toString(),
  88 + // })
  89 + }
  90 + })
  91 + }
  92 +
  93 +
  94 + }).catch((err) => { })
  95 + },
  96 +
  97 + // 订单详情
  98 + ordertail(e) {
  99 + let id = e.currentTarget.dataset.id;
  100 + wx.navigateTo({
  101 + url: '/packageA/pages/messagedetail/messagedetail?id=' + id,
  102 + })
  103 + },
  104 +
  105 + /**
  106 + * 生命周期函数--监听页面初次渲染完成
  107 + */
  108 + onReady: function () {
  109 +
  110 + },
  111 +
  112 + /**
  113 + * 生命周期函数--监听页面显示
  114 + */
  115 + onShow: function () {
  116 + this.setData({
  117 + token: wx.getStorageSync('token'),
  118 + login_new: app.globalData.login_new
79 }) 119 })
80 - }else{  
81 - wx.hideTabBarRedDot({  
82 - index: 1,  
83 - success: function (red) {  
84 -  
85 - // wx.setTabBarBadge({  
86 - // index: 1,  
87 - // text: newlist.length.toString(),  
88 - // })  
89 - } 120 +
  121 + this.setData({
  122 + messagelist: [],
  123 + page: 1
  124 + })
  125 + this.getmessagelist()
  126 + },
  127 +
  128 + /**
  129 + * 生命周期函数--监听页面隐藏
  130 + */
  131 + onHide: function () {
  132 +
  133 + },
  134 +
  135 + /**
  136 + * 生命周期函数--监听页面卸载
  137 + */
  138 + onUnload: function () {
  139 +
  140 + },
  141 +
  142 + /**
  143 + * 页面相关事件处理函数--监听用户下拉动作
  144 + */
  145 + onPullDownRefresh: function () {
  146 +
  147 + },
  148 +
  149 + /**
  150 + * 页面上拉触底事件的处理函数
  151 + */
  152 + onReachBottom: function () {
  153 + let newpage = this.data.page;
  154 + newpage++;
  155 + this.setData({
  156 + page: newpage
90 }) 157 })
91 - }  
92 -  
93 -  
94 - }).catch((err) => {})  
95 - },  
96 -  
97 - // 订单详情  
98 - ordertail(e) {  
99 - let id = e.currentTarget.dataset.id;  
100 - wx.navigateTo({  
101 - url: '/packageA/pages/messagedetail/messagedetail?id=' + id,  
102 - })  
103 - },  
104 -  
105 - /**  
106 - * 生命周期函数--监听页面初次渲染完成  
107 - */  
108 - onReady: function() {  
109 -  
110 - },  
111 -  
112 - /**  
113 - * 生命周期函数--监听页面显示  
114 - */  
115 - onShow: function() {  
116 - this.setData({  
117 - token:wx.getStorageSync('token'),  
118 - login_new:app.globalData.login_new  
119 - })  
120 -  
121 - this.setData({  
122 - messagelist: [],  
123 - page: 1  
124 - })  
125 - this.getmessagelist()  
126 - },  
127 -  
128 - /**  
129 - * 生命周期函数--监听页面隐藏  
130 - */  
131 - onHide: function() {  
132 -  
133 - },  
134 -  
135 - /**  
136 - * 生命周期函数--监听页面卸载  
137 - */  
138 - onUnload: function() {  
139 -  
140 - },  
141 -  
142 - /**  
143 - * 页面相关事件处理函数--监听用户下拉动作  
144 - */  
145 - onPullDownRefresh: function() {  
146 -  
147 - },  
148 -  
149 - /**  
150 - * 页面上拉触底事件的处理函数  
151 - */  
152 - onReachBottom: function() {  
153 - let newpage = this.data.page;  
154 - newpage++;  
155 - this.setData({  
156 - page: newpage  
157 - })  
158 - this.getmessagelist()  
159 - },  
160 -  
161 - /**  
162 - * 用户点击右上角分享  
163 - */  
164 - onShareAppMessage: function() {  
165 -  
166 - } 158 + this.getmessagelist()
  159 + },
  160 +
  161 + /**
  162 + * 用户点击右上角分享
  163 + */
  164 + onShareAppMessage: function () {
  165 +
  166 + }
167 }) 167 })
@@ -2,9 +2,9 @@ @@ -2,9 +2,9 @@
2 <navigator class="no_login" catchtap="go_login" url="/packageA/pages/register/register" hover-class="none">请先登录</navigator> 2 <navigator class="no_login" catchtap="go_login" url="/packageA/pages/register/register" hover-class="none">请先登录</navigator>
3 </block> 3 </block>
4 4
5 -<block wx:elif="{{login_new==''}}"> 5 +<!-- <block wx:elif="{{login_new==''}}">
6 <navigator class="no_login" catchtap="go_login" url="/packageA/pages/login/login" hover-class="none">请先绑定会员</navigator> 6 <navigator class="no_login" catchtap="go_login" url="/packageA/pages/login/login" hover-class="none">请先绑定会员</navigator>
7 -</block> 7 +</block> -->
8 8
9 <block wx:else> 9 <block wx:else>
10 <view class="empty" wx:if="{{messagelist.length==0}}">暂无更多数据</view> 10 <view class="empty" wx:if="{{messagelist.length==0}}">暂无更多数据</view>
@@ -125,8 +125,8 @@ Page({ @@ -125,8 +125,8 @@ Page({
125 let t = this; 125 let t = this;
126 let type = e.currentTarget.dataset.i; 126 let type = e.currentTarget.dataset.i;
127 let index = e.currentTarget.dataset.t; 127 let index = e.currentTarget.dataset.t;
128 - if (wx.getStorageSync("token") && !this.data.noBind && index != 5) {  
129 - 128 + if (wx.getStorageSync("token") && index != 5) {
  129 + // if (wx.getStorageSync("token") && !this.data.noBind && index != 5) {
130 if (index == 1) { 130 if (index == 1) {
131 // 跳转订单列表 131 // 跳转订单列表
132 wx.navigateTo({ 132 wx.navigateTo({
@@ -178,25 +178,25 @@ Page({ @@ -178,25 +178,25 @@ Page({
178 178
179 return false 179 return false
180 } 180 }
181 -  
182 - if(this.data.noBind){  
183 - wx.showModal({  
184 - title: '提示',  
185 - content: '请绑定账号后操作',  
186 - confirmText:'去绑定',  
187 - cancelText:'取消',  
188 - success(res) {  
189 - if (res.confirm) {  
190 - wx.navigateTo({  
191 - url: '/packageA/pages/login/login',  
192 - })  
193 - } else if (res.cancel) {  
194 - }  
195 - }  
196 - }) 181 + // 2023-10-19 需求取消登录限制
  182 + // if(this.data.noBind){
  183 + // wx.showModal({
  184 + // title: '提示',
  185 + // content: '请绑定账号后操作',
  186 + // confirmText:'去绑定',
  187 + // cancelText:'取消',
  188 + // success(res) {
  189 + // if (res.confirm) {
  190 + // wx.navigateTo({
  191 + // url: '/packageA/pages/login/login',
  192 + // })
  193 + // } else if (res.cancel) {
  194 + // }
  195 + // }
  196 + // })
197 197
198 - return false  
199 - } 198 + // return false
  199 + // }
200 } 200 }
201 }, 201 },
202 //获取购物车数量 202 //获取购物车数量
@@ -14,13 +14,13 @@ @@ -14,13 +14,13 @@
14 </view> 14 </view>
15 <!-- <view class="company">{{obj.competition}}</view> --> 15 <!-- <view class="company">{{obj.competition}}</view> -->
16 16
17 - <view class="info_box" wx:if="{{noBind}}"> 17 + <!-- <view class="info_box" wx:if="{{noBind}}">
18 <view class="bindNote">点击绑定账号</view> 18 <view class="bindNote">点击绑定账号</view>
19 - </view>  
20 - <view class="info_box" wx:else> 19 + </view> -->
  20 + <view class="info_box">
21 <view>{{obj.job?obj.job:'暂无'}}</view> 21 <view>{{obj.job?obj.job:'暂无'}}</view>
22 <!-- <view>{{obj.section?obj.section:'暂无'}}</view> --> 22 <!-- <view>{{obj.section?obj.section:'暂无'}}</view> -->
23 - <view>{{obj.tel}}</view> 23 + <view>{{obj.tel?obj.tel:''}}</view>
24 </view> 24 </view>
25 </view> 25 </view>
26 </view> 26 </view>
1 const app = getApp() 1 const app = getApp()
2 Page({ 2 Page({
3 3
4 - /**  
5 - * 页面的初始数据  
6 - */  
7 - data: {  
8 - success: false,  
9 - fail: false,  
10 - name: '',  
11 - choudanNum:0,  
12 - addressId: 0,  
13 - tel: '',  
14 - area: '',  
15 - address: '',  
16 - cover_type: false,  
17 - total:'',  
18 -  
19 - info:{  
20 - address:{  
21 - address:'',  
22 - area:'',  
23 - id:'',  
24 - tel:'',  
25 - name:''  
26 - }  
27 -  
28 - }  
29 - },  
30 - //加减商品数量  
31 - num_change(e) {  
32 - let that = this  
33 - let num = Number(e.currentTarget.dataset.num)  
34 - console.log(num)  
35 - let type = e.currentTarget.dataset.type  
36 - let index = e.currentTarget.dataset.index  
37 - let id = e.currentTarget.dataset.id  
38 - let check = e.currentTarget.dataset.check  
39 - let coudan = this.data.coudan||[]  
40 - let coudan_arr = this.data.coudan_arr||[]  
41 - let price = e.currentTarget.dataset.price;  
42 - let price2 = e.currentTarget.dataset.price2;  
43 -  
44 - if (type == 1) {  
45 - if(this.data.info.choudan*100<(price*100)){  
46 - wx.showToast({  
47 - title: '当前剩余积分不足,请重新挑选',  
48 - icon:'none'  
49 - })  
50 - return  
51 - }  
52 - num++  
53 - } else {  
54 - num--  
55 - if (num < 0) {  
56 - num = 0;  
57 - return  
58 - }  
59 - } 4 + /**
  5 + * 页面的初始数据
  6 + */
  7 + data: {
  8 + success: false,
  9 + fail: false,
  10 + name: '',
  11 + choudanNum: 0,
  12 + addressId: 0,
  13 + tel: '',
  14 + area: '',
  15 + address: '',
  16 + cover_type: false,
  17 + total: '',
  18 +
  19 + info: {
  20 + address: {
  21 + address: '',
  22 + area: '',
  23 + id: '',
  24 + tel: '',
  25 + name: ''
  26 + }
  27 +
  28 + }
  29 + },
  30 + //加减商品数量
  31 + num_change(e) {
  32 + let that = this
  33 + let num = Number(e.currentTarget.dataset.num)
  34 + console.log(num)
  35 + let type = e.currentTarget.dataset.type
  36 + let index = e.currentTarget.dataset.index
  37 + let id = e.currentTarget.dataset.id
  38 + let check = e.currentTarget.dataset.check
  39 + let coudan = this.data.coudan || []
  40 + let coudan_arr = this.data.coudan_arr || []
  41 + let price = e.currentTarget.dataset.price;
  42 + let price2 = e.currentTarget.dataset.price2;
60 43
61 - if (num<1) {  
62 - coudan.forEach((item, index) => {  
63 - if (item.id == id) {  
64 - coudan.splice(index, 1)  
65 - coudan_arr.splice(index, 1) 44 + if (type == 1) {
  45 + if (this.data.info.choudan * 100 < (price * 100)) {
  46 + wx.showToast({
  47 + title: '当前剩余积分不足,请重新挑选',
  48 + icon: 'none'
  49 + })
  50 + return
  51 + }
  52 + num++
  53 + } else {
  54 + num--
  55 + if (num < 0) {
  56 + num = 0;
  57 + return
  58 + }
66 } 59 }
67 - })  
68 - } else {  
69 - if(type==1&&num==1){ 60 +
  61 + if (num < 1) {
  62 + coudan.forEach((item, index) => {
  63 + if (item.id == id) {
  64 + coudan.splice(index, 1)
  65 + coudan_arr.splice(index, 1)
  66 + }
  67 + })
  68 + } else {
  69 + if (type == 1 && num == 1) {
70 //选中 70 //选中
71 - coudan.push({  
72 - id: id,  
73 - num: num  
74 - })  
75 - coudan_arr.push({  
76 - id: id,  
77 - num: num,  
78 - price: Number(price),  
79 - price2:Number(price2)  
80 - })  
81 - }else{  
82 - coudan.forEach((item, index) => {  
83 - if (item.id == id) {  
84 - item.num = num  
85 - coudan_arr[index].num = num 71 + coudan.push({
  72 + id: id,
  73 + num: num
  74 + })
  75 + coudan_arr.push({
  76 + id: id,
  77 + num: num,
  78 + price: Number(price),
  79 + price2: Number(price2)
  80 + })
  81 + } else {
  82 + coudan.forEach((item, index) => {
  83 + if (item.id == id) {
  84 + item.num = num
  85 + coudan_arr[index].num = num
  86 + }
  87 + })
  88 + }
  89 +
  90 + }
  91 + that.setData({
  92 + coudan: coudan,
  93 + coudan_arr: coudan_arr,
  94 + [`info.coudanProduct[${index}].num`]: num
  95 + // [`info.coudanProduct[${index}].check`]: check
  96 + })
  97 + this.get_choudan()
  98 + },
  99 + // 计算凑单费用
  100 + get_choudan() {
  101 + let coudan_arr = this.data.coudan_arr
  102 + let choudan_money = 0;
  103 + let num = 0
  104 + for (let obj of coudan_arr) {
  105 + console.log(obj)
  106 + console.log(obj.price2)
  107 + if (obj.price2 != null) {
  108 + console.log(111)
  109 + choudan_money = (obj.price2 * 100 * obj.num) / 100 + choudan_money
  110 + } else {
  111 + console.log(222)
  112 + choudan_money = (obj.price * 100 * obj.num) / 100 + choudan_money
86 } 113 }
87 - }) 114 + num = num + obj.num
88 } 115 }
89 116
90 - }  
91 - that.setData({  
92 - coudan: coudan,  
93 - coudan_arr: coudan_arr,  
94 - [`info.coudanProduct[${index}].num`]: num  
95 - // [`info.coudanProduct[${index}].check`]: check  
96 - })  
97 - this.get_choudan()  
98 - },  
99 - // 计算凑单费用  
100 - get_choudan() {  
101 - let coudan_arr = this.data.coudan_arr  
102 - let choudan_money = 0;  
103 - let num = 0  
104 - for (let obj of coudan_arr) {  
105 - console.log(obj)  
106 - console.log(obj.price2)  
107 - if (obj.price2!= null) {  
108 - console.log(111)  
109 - choudan_money = (obj.price2 * 100 * obj.num) / 100 + choudan_money  
110 - } else {  
111 - console.log(222)  
112 - choudan_money = (obj.price * 100 * obj.num) / 100 + choudan_money  
113 - }  
114 - num = num+obj.num  
115 - } 117 + this.setData({
  118 + choudan_money: choudan_money * 100,
  119 + choudanNum: num,
  120 + 'info.choudan': this.data.info.syjf - choudan_money
  121 + // choudan_money: Math.floor(choudan_money* 100) / 100
  122 + })
  123 + },
  124 + show_cover() {
  125 + let that = this
  126 + if (!that.data.cover_type) {
  127 + if (that.data.info.status == 0) {
  128 + that.setData({
  129 + fail: true
  130 + })
  131 + return
  132 + }
  133 + if (!that.data.info.address) {
  134 + wx.showToast({
  135 + title: '请添加地址',
  136 + icon: 'none',
  137 + duration: 1000
  138 + })
  139 + return
  140 + }
  141 + }
  142 + that.setData({
  143 + cover_type: !this.data.cover_type
  144 + })
  145 + },
  146 + // 去添加地址
  147 + add_address() {
  148 + wx.navigateTo({
  149 + url: '/packageA/pages/address/address',
  150 + })
  151 + },
  152 +
116 153
117 - this.setData({  
118 - choudan_money: choudan_money*100,  
119 - choudanNum:num,  
120 - 'info.choudan': this.data.info.syjf - choudan_money  
121 - // choudan_money: Math.floor(choudan_money* 100) / 100  
122 - })  
123 - },  
124 - show_cover() {  
125 - let that = this  
126 - if (!that.data.cover_type) {  
127 - if (that.data.info.status == 0) { 154 + //选择凑单商品
  155 + chooseGoods(e) {
  156 + // coudan 凑单商品组成的数组
  157 + // coudan_type 凑单的状态 可能废弃
  158 + let that = this
  159 + let coudan = this.data.coudan ? this.data.coudan : []
  160 + let coudan_arr = this.data.coudan_arr ? this.data.coudan_arr : []
  161 + let check = e.currentTarget.dataset.check
  162 + let num = e.currentTarget.dataset.num
  163 + let index = e.currentTarget.dataset.index
  164 + let id = e.currentTarget.dataset.id
  165 + let price = e.currentTarget.dataset.price;
  166 + let price2 = e.currentTarget.dataset.price2;
  167 + if (check) {
  168 + check = 0
  169 + coudan.forEach((item, index) => {
  170 + if (item.id == id) {
  171 + coudan.splice(index, 1)
  172 + coudan_arr.splice(index, 1)
  173 + }
  174 + })
  175 + } else {
  176 + check = 1
  177 + //选中
  178 + coudan.push({
  179 + id: id,
  180 + num: num
  181 + })
  182 + coudan_arr.push({
  183 + id: id,
  184 + num: num,
  185 + price: Number(price),
  186 + price2: Number(price2)
  187 + })
  188 + }
128 that.setData({ 189 that.setData({
129 - fail: true 190 + coudan: coudan,
  191 + coudan_arr: coudan_arr,
  192 + [`info.coudanProduct[${index}].check`]: check
130 }) 193 })
131 - return  
132 - }  
133 - if (!that.data.info.address) {  
134 - wx.showToast({  
135 - title: '请添加地址',  
136 - icon: 'none',  
137 - duration: 1000 194 + that.get_choudan()
  195 + },
  196 +
  197 + //获取页面信息
  198 + get_info(type, info, id) {
  199 + let that = this
  200 + let url = type == 4 ? app.interface.prev_pay : app.interface.now_prev_pay
  201 + let params = {
  202 + info: info
  203 + }
  204 + app.post(url, params).then((res) => {
  205 + console.log('99999', res, Number(res.msg.total))
  206 + res.msg.syjf = res.msg.choudan - res.msg.yunfei
  207 + res.msg.choudan = res.msg.choudan - res.msg.yunfei
  208 + res.msg.total = Number(res.msg.total * 100)
  209 + res.msg.yunfei = Number(res.msg.yunfei * 100)
  210 +
  211 + let total = (res.msg.total + res.msg.yunfei).toFixed("1");
  212 + console.log(total)
  213 +
  214 + that.setData({
  215 + info: res.msg,
  216 + total: total
  217 +
  218 + })
138 }) 219 })
139 - return  
140 - }  
141 - }  
142 - that.setData({  
143 - cover_type: !this.data.cover_type  
144 - })  
145 - },  
146 - // 去添加地址  
147 - add_address() {  
148 - wx.navigateTo({  
149 - url: '/packageA/pages/address/address',  
150 - })  
151 - },  
152 -  
153 -  
154 - //选择凑单商品  
155 - chooseGoods(e) {  
156 - // coudan 凑单商品组成的数组  
157 - // coudan_type 凑单的状态 可能废弃  
158 - let that = this  
159 - let coudan = this.data.coudan ? this.data.coudan : []  
160 - let coudan_arr = this.data.coudan_arr ? this.data.coudan_arr : []  
161 - let check = e.currentTarget.dataset.check  
162 - let num = e.currentTarget.dataset.num  
163 - let index = e.currentTarget.dataset.index  
164 - let id = e.currentTarget.dataset.id  
165 - let price = e.currentTarget.dataset.price;  
166 - let price2 = e.currentTarget.dataset.price2;  
167 - if (check) {  
168 - check = 0  
169 - coudan.forEach((item, index) => {  
170 - if (item.id == id) {  
171 - coudan.splice(index, 1)  
172 - coudan_arr.splice(index, 1) 220 + },
  221 +
  222 +
  223 + //获取页面信息
  224 + get_youfei(id) {
  225 + let that = this
  226 + let url = that.data.type == 4 ? app.interface.youfei1 : app.interface.youfei
  227 + let params = {
  228 + info: that.data.params,
  229 + address_id: id
173 } 230 }
174 - })  
175 - } else {  
176 - check = 1  
177 - //选中  
178 - coudan.push({  
179 - id: id,  
180 - num: num  
181 - })  
182 - coudan_arr.push({  
183 - id: id,  
184 - num: num,  
185 - price: Number(price),  
186 - price2:Number(price2)  
187 - })  
188 - }  
189 - that.setData({  
190 - coudan: coudan,  
191 - coudan_arr: coudan_arr,  
192 - [`info.coudanProduct[${index}].check`]: check  
193 - })  
194 - that.get_choudan()  
195 - },  
196 -  
197 - //获取页面信息  
198 - get_info(type, info, id) {  
199 - let that = this  
200 - let url = type == 4 ? app.interface.prev_pay : app.interface.now_prev_pay  
201 - let params = {  
202 - info: info  
203 - }  
204 - app.post(url, params).then((res) => {  
205 - console.log('99999', res, Number(res.msg.total))  
206 - res.msg.syjf = res.msg.choudan - res.msg.yunfei  
207 - res.msg.choudan = res.msg.choudan - res.msg.yunfei  
208 - res.msg.total = Number(res.msg.total * 100)  
209 - res.msg.yunfei = Number(res.msg.yunfei * 100)  
210 -  
211 - let total = (res.msg.total + res.msg.yunfei).toFixed("1");  
212 - console.log(total)  
213 -  
214 - that.setData({  
215 - info: res.msg,  
216 - total:total  
217 -  
218 - })  
219 -  
220 - console.log('9988756', that.data.info)  
221 -  
222 - })  
223 - },  
224 -  
225 -  
226 - //获取页面信息  
227 - get_youfei(id) {  
228 - let that = this  
229 - let url = that.data.type == 4 ? app.interface.youfei1 : app.interface.youfei  
230 - let params = {  
231 - info: that.data.params,  
232 - address_id: id  
233 - }  
234 - app.post(url, params).then((res) => {  
235 - that.setData({  
236 - "info.yunfei": Number(res.msg.yunfei)*100  
237 - })  
238 - })  
239 - },  
240 -  
241 -  
242 - //点击支付  
243 - submit() {  
244 - let that = this  
245 - let list = that.data.info.products  
246 - let coudan = that.data.coudan  
247 - let info = []  
248 - if (that.data.type == 4) {  
249 - for (let obj of list) {  
250 - info.push({  
251 - id: obj.product.id,  
252 - num: obj.product.num 231 + app.post(url, params).then((res) => {
  232 + that.setData({
  233 + "info.yunfei": Number(res.msg.yunfei) * 100
  234 + })
253 }) 235 })
254 - }  
255 - } else {  
256 - for (let obj of list) {  
257 - info.push({  
258 - id: obj.id,  
259 - num: obj.num 236 + },
  237 +
  238 +
  239 + //点击支付
  240 + submit() {
  241 + let that = this
  242 + let list = that.data.info.products
  243 + let coudan = that.data.coudan
  244 + let info = []
  245 + if (that.data.type == 4) {
  246 + for (let obj of list) {
  247 + info.push({
  248 + id: obj.product.id,
  249 + num: obj.product.num
  250 + })
  251 + }
  252 + } else {
  253 + for (let obj of list) {
  254 + info.push({
  255 + id: obj.id,
  256 + num: obj.num
  257 + })
  258 + }
  259 + }
  260 + if (coudan && coudan.length > 0) {
  261 + info = info.concat(coudan)
  262 + }
  263 + let url = app.interface.now_add
  264 + let params = {
  265 + address: that.data.info.address.id,
  266 + info: JSON.stringify(info)
  267 + }
  268 + app.post(url, params).then((res) => {
  269 + that.setData({
  270 + cover_type: false
  271 + })
  272 + that.order_pay(res.msg)
260 }) 273 })
261 - }  
262 - }  
263 - if (coudan && coudan.length > 0) {  
264 - info = info.concat(coudan)  
265 - }  
266 - let url = app.interface.now_add  
267 - let params = {  
268 - address: that.data.info.address.id,  
269 - info: JSON.stringify(info)  
270 - }  
271 - app.post(url, params).then((res) => {  
272 - that.setData({  
273 - cover_type: false  
274 - })  
275 - that.order_pay(res.msg)  
276 - })  
277 - },  
278 -  
279 - //订单支付  
280 - order_pay(order_odd) {  
281 - let url = app.interface.order_pay  
282 - let params = {  
283 - order_odd: order_odd  
284 - }  
285 - app.post(url, params).then((res) => {  
286 - this.setData({  
287 - order: res.msg  
288 - })  
289 - if (res.msg.message == "支付成功") {  
290 - // wx.showToast({  
291 - // title: '购买成功',  
292 - // icon:'none'  
293 - // })  
294 - this.setData({  
295 - success: true 274 + },
  275 +
  276 + //开放订单支付
  277 + order_pay(order_odd) {
  278 + let that = this;
  279 + let url = app.interface.order_pay
  280 + let params = {
  281 + order_odd: order_odd
  282 + }
  283 + app.post(url, params).then((res) => {
  284 + that.payment(res.msg)
296 }) 285 })
297 - } else if (res.msg.message == "余额不足") { 286 + },
  287 + payment(res) {
  288 + var timeStamp = res.timeStamp.toString();
  289 + wx.requestPayment({
  290 + timeStamp: timeStamp,
  291 + nonceStr: res.nonceStr,
  292 + package: res.package,
  293 + signType: res.signType,
  294 + paySign: res.paySign,
  295 + success: function (res) {
  296 + wx.redirectTo({
  297 + url: '/packageA/pages/order/order_list/order_list?status=3',
  298 + })
  299 + },
  300 + fail: function (res) {
  301 + console.log(res);
  302 + }
  303 + })
  304 + },
  305 + //订单支付
  306 + // order_pay(order_odd) {
  307 + // let url = app.interface.order_pay
  308 + // let params = {
  309 + // order_odd: order_odd
  310 + // }
  311 + // app.post(url, params).then((res) => {
  312 + // this.setData({
  313 + // order: res.msg
  314 + // })
  315 + // if (res.msg.message == "支付成功") {
  316 + // // wx.showToast({
  317 + // // title: '购买成功',
  318 + // // icon:'none'
  319 + // // })
  320 + // this.setData({
  321 + // success: true
  322 + // })
  323 + // } else if (res.msg.message == "余额不足") {
  324 + // this.setData({
  325 + // fail: true
  326 + // })
  327 + // }
  328 + // })
  329 + // },
  330 + /**
  331 + * 生命周期函数--监听页面加载
  332 + */
  333 + onLoad: function (options) {
  334 + console.log(options)
298 this.setData({ 335 this.setData({
299 - fail: true 336 + type: options.type,
  337 + params: options.info
300 }) 338 })
301 - }  
302 - })  
303 - },  
304 - /**  
305 - * 生命周期函数--监听页面加载  
306 - */  
307 - onLoad: function(options) {  
308 - console.log(options)  
309 - this.setData({  
310 - type: options.type,  
311 - params: options.info  
312 - })  
313 - this.get_info(options.type, options.info, options.id)  
314 - },  
315 -  
316 -  
317 - /**  
318 - * 生命周期函数--监听页面初次渲染完成  
319 - */  
320 - onReady: function() {  
321 -  
322 - },  
323 -  
324 - /**  
325 - * 生命周期函数--监听页面显示  
326 - */  
327 - onShow: function() {  
328 -  
329 - let pages = getCurrentPages();  
330 -  
331 - let currPage = pages[pages.length - 1]  
332 - console.log('887766554',currPage.data.id)  
333 - if (currPage.data.id) {  
334 - console.log('4778785',this.data.info)  
335 -  
336 - this.setData({  
337 - "info.address.address": currPage.data.address,  
338 - "info.address.area": currPage.data.area,  
339 - "info.address.id": currPage.data.id,  
340 - "info.address.tel": currPage.data.tel,  
341 - "info.address.name": currPage.data.name  
342 - })  
343 - console.log(this.data.info)  
344 - console.log(currPage.data.address)  
345 - this.get_youfei(currPage.data.id)  
346 - }  
347 - // if (wx.getStorageSync('no_address')) {  
348 - // wx.setStorageSync('no_address', false)  
349 - // this.setData({  
350 - // "info.address": null  
351 - // })  
352 - // } 339 + this.get_info(options.type, options.info, options.id)
  340 + },
353 341
354 - },  
355 342
356 - /**  
357 - * 生命周期函数--监听页面隐藏  
358 - */  
359 - onHide: function() { 343 + /**
  344 + * 生命周期函数--监听页面初次渲染完成
  345 + */
  346 + onReady: function () {
360 347
361 - }, 348 + },
362 349
363 - /**  
364 - * 生命周期函数--监听页面卸载  
365 - */  
366 - onUnload: function() { 350 + /**
  351 + * 生命周期函数--监听页面显示
  352 + */
  353 + onShow: function () {
367 354
368 - }, 355 + let pages = getCurrentPages();
369 356
370 - /**  
371 - * 页面相关事件处理函数--监听用户下拉动作  
372 - */  
373 - onPullDownRefresh: function() { 357 + let currPage = pages[pages.length - 1]
  358 + if (currPage.data.id) {
  359 + this.setData({
  360 + "info.address.address": currPage.data.address,
  361 + "info.address.area": currPage.data.area,
  362 + "info.address.id": currPage.data.id,
  363 + "info.address.tel": currPage.data.tel,
  364 + "info.address.name": currPage.data.name
  365 + })
  366 + this.get_youfei(currPage.data.id)
  367 + }
  368 + // if (wx.getStorageSync('no_address')) {
  369 + // wx.setStorageSync('no_address', false)
  370 + // this.setData({
  371 + // "info.address": null
  372 + // })
  373 + // }
374 374
375 - }, 375 + },
376 376
377 - /**  
378 - * 页面上拉触底事件的处理函数  
379 - */  
380 - onReachBottom: function() { 377 + /**
  378 + * 生命周期函数--监听页面隐藏
  379 + */
  380 + onHide: function () {
381 381
382 - }, 382 + },
383 383
384 - /**  
385 - * 用户点击右上角分享  
386 - */  
387 - onShareAppMessage: function() { 384 + /**
  385 + * 生命周期函数--监听页面卸载
  386 + */
  387 + onUnload: function () {
388 388
389 - } 389 + },
  390 +
  391 + /**
  392 + * 页面相关事件处理函数--监听用户下拉动作
  393 + */
  394 + onPullDownRefresh: function () {
  395 +
  396 + },
  397 +
  398 + /**
  399 + * 页面上拉触底事件的处理函数
  400 + */
  401 + onReachBottom: function () {
  402 +
  403 + },
  404 +
  405 + /**
  406 + * 用户点击右上角分享
  407 + */
  408 + onShareAppMessage: function () {
  409 +
  410 + }
390 }) 411 })
@@ -63,10 +63,10 @@ @@ -63,10 +63,10 @@
63 <view class='score'>{{info.date}}</view> 63 <view class='score'>{{info.date}}</view>
64 </view> 64 </view>
65 65
66 - <view class='mask_two'> 66 + <!-- <view class='mask_two'>
67 <view>邮费</view> 67 <view>邮费</view>
68 <view class='score' style="color:rgba(242, 0, 0, 1)">{{info.yunfei/100}}积分</view> 68 <view class='score' style="color:rgba(242, 0, 0, 1)">{{info.yunfei/100}}积分</view>
69 - </view> 69 + </view> -->
70 </view> 70 </view>
71 </view> 71 </view>
72 </view> 72 </view>
@@ -75,7 +75,8 @@ @@ -75,7 +75,8 @@
75 <view class="submit" catchtap="show_cover">提交</view> 75 <view class="submit" catchtap="show_cover">提交</view>
76 <view class="jifen"> 合计: 76 <view class="jifen"> 合计:
77 <!-- <text>{{choudan_money?choudan_money + info.total + info.yunfei*100/100: info.total + info.yunfei*100/100}}积分</text> --> 77 <!-- <text>{{choudan_money?choudan_money + info.total + info.yunfei*100/100: info.total + info.yunfei*100/100}}积分</text> -->
78 - <text>{{choudan_money?(choudan_money + info.total + info.yunfei)/100: (info.total + info.yunfei)/100}}积分</text> 78 + <!-- <text>{{choudan_money?(choudan_money + info.total + info.yunfei)/100: (info.total + info.yunfei)/100}}积分</text> -->
  79 + <text>¥{{choudan_money?(choudan_money + info.total + info.yunfei)/100: (info.total + info.yunfei)/100}}</text>
79 </view> 80 </view>
80 <view class="num">共{{info.totalnum + choudanNum}}件</view> 81 <view class="num">共{{info.totalnum + choudanNum}}件</view>
81 </view> 82 </view>
@@ -109,15 +110,17 @@ @@ -109,15 +110,17 @@
109 110
110 <view class="cover_box" wx:if="{{cover_type}}"> 111 <view class="cover_box" wx:if="{{cover_type}}">
111 <view class="cover_order"> 112 <view class="cover_order">
112 - <view class="all_money">{{choudan_money?(choudan_money + info.total + info.yunfei)/100: (info.total + info.yunfei)/100}}积分</view> 113 + <!-- <view class="all_money">{{choudan_money?(choudan_money + info.total + info.yunfei)/100: (info.total + info.yunfei)/100}}积分</view> -->
  114 + <view class="all_money">¥{{choudan_money?(choudan_money + info.total + info.yunfei)/100: (info.total + info.yunfei)/100}}</view>
113 <view class="money_item"> 115 <view class="money_item">
114 - <text>商品积分</text>  
115 - <text>{{choudan_money?(choudan_money + info.total)/100:info.total/100}}积分</text> 116 + <text>商品价格</text>
  117 + <!-- <text>{{choudan_money?(choudan_money + info.total)/100:info.total/100}}积分</text> -->
  118 + <text>¥{{choudan_money?(choudan_money + info.total)/100:info.total/100}}</text>
116 </view> 119 </view>
117 - <view class="money_item"> 120 + <!-- <view class="money_item">
118 <text>邮费</text> 121 <text>邮费</text>
119 <text>{{info.yunfei/100}}积分</text> 122 <text>{{info.yunfei/100}}积分</text>
120 - </view> 123 + </view> -->
121 <view class="cover_submit" catchtap="submit">确认支付</view> 124 <view class="cover_submit" catchtap="submit">确认支付</view>
122 <image src="/images/close.png" class="cover_close" catchtap="show_cover" /> 125 <image src="/images/close.png" class="cover_close" catchtap="show_cover" />
123 </view> 126 </view>
@@ -24,8 +24,8 @@ @@ -24,8 +24,8 @@
24 <view class="word">{{item.product_name}}</view> 24 <view class="word">{{item.product_name}}</view>
25 <view class="info"> 25 <view class="info">
26 <view class="jifen"> 26 <view class="jifen">
27 - <view class="name">积分</view>  
28 - <text>{{item.product_money}}</text> 27 + <!-- <view class="name">积分</view> -->
  28 + <text>¥{{item.product_money}}</text>
29 <text style="margin-left: 10rpx;color:#ccc;font-size: 28rpx;">X{{item.num}}</text> 29 <text style="margin-left: 10rpx;color:#ccc;font-size: 28rpx;">X{{item.num}}</text>
30 </view> 30 </view>
31 </view> 31 </view>
@@ -36,8 +36,8 @@ @@ -36,8 +36,8 @@
36 <view class="info_box" wx:if="{{type == 3}}"> 36 <view class="info_box" wx:if="{{type == 3}}">
37 <view class="f_item"> 37 <view class="f_item">
38 <view class="shop"> 38 <view class="shop">
39 - 商品积分  
40 - <text>{{item.price*100*item.num/100}}积分</text> 39 + 商品价格
  40 + <text>¥{{item.price*100*item.num/100}}</text>
41 </view> 41 </view>
42 </view> 42 </view>
43 </view> 43 </view>
@@ -58,10 +58,10 @@ @@ -58,10 +58,10 @@
58 <view class='score'>{{info.status_text}}</view> 58 <view class='score'>{{info.status_text}}</view>
59 </view> 59 </view>
60 60
61 - <view class='mask_two'> 61 + <!-- <view class='mask_two'>
62 <view>邮费</view> 62 <view>邮费</view>
63 <view class='score' style="color:rgba(242, 0, 0, 1)">{{info.youfei}}积分</view> 63 <view class='score' style="color:rgba(242, 0, 0, 1)">{{info.youfei}}积分</view>
64 - </view> 64 + </view> -->
65 65
66 </view> 66 </view>
67 </view> 67 </view>
@@ -71,7 +71,7 @@ @@ -71,7 +71,7 @@
71 <view class="footer" wx:if="{{type==2}}"> 71 <view class="footer" wx:if="{{type==2}}">
72 <view class="submit" catchtap="show_cover">提交</view> 72 <view class="submit" catchtap="show_cover">提交</view>
73 <view class="jifen"> 合计: 73 <view class="jifen"> 合计:
74 - <text>{{info.money}}积分</text> 74 + <text>¥{{info.money}}</text>
75 </view> 75 </view>
76 <view class="num">共{{info.total_num}}件</view> 76 <view class="num">共{{info.total_num}}件</view>
77 </view> 77 </view>
@@ -109,15 +109,15 @@ @@ -109,15 +109,15 @@
109 109
110 <view class="cover_box" wx:if="{{cover_type}}"> 110 <view class="cover_box" wx:if="{{cover_type}}">
111 <view class="cover_order"> 111 <view class="cover_order">
112 - <view class="all_money">{{info.total_price + info.youfei*100/100}}积分</view> 112 + <view class="all_money">¥{{info.total_price + info.youfei*100/100}}</view>
113 <view class="money_item"> 113 <view class="money_item">
114 - <text>商品积分</text>  
115 - <text>{{info.total_price}}积分</text> 114 + <text>商品价格</text>
  115 + <text>¥{{info.total_price}}</text>
116 </view> 116 </view>
117 - <view class="money_item"> 117 + <!-- <view class="money_item">
118 <text>邮费</text> 118 <text>邮费</text>
119 <text>{{info.youfei}}积分</text> 119 <text>{{info.youfei}}积分</text>
120 - </view> 120 + </view> -->
121 <view class="cover_submit" catchtap="order_pay" data-order="{{info.order_odd}}">确认支付</view> 121 <view class="cover_submit" catchtap="order_pay" data-order="{{info.order_odd}}">确认支付</view>
122 <image src="/images/close.png" class="cover_close" catchtap="show_cover" /> 122 <image src="/images/close.png" class="cover_close" catchtap="show_cover" />
123 </view> 123 </view>
1 const a = getApp() 1 const a = getApp()
2 Page({ 2 Page({
3 3
4 - /**  
5 - * 页面的初始数据  
6 - */  
7 -  
8 - data: {  
9 - status: 1,  
10 - nav: ['待支付', '待发货', '待收货', '已完成', '退换货'],  
11 - daiorder: [],  
12 - daifahuoorder: [],  
13 - daishouhuoorder: [],  
14 - success: [],  
15 - tui: [],  
16 - cover_type: false,  
17 - totalmoney:""  
18 - },  
19 - // 展示待支付的去支付弹窗  
20 - show_cover(e) {  
21 - if( a.globalData.status==0){  
22 - wx.showToast({  
23 - title: '您已您所在单位暂未开始劳保购买!',  
24 - icon:'none'  
25 - })  
26 - return false  
27 - }  
28 - if (e.currentTarget.dataset.d) {  
29 - let index = Number(e.currentTarget.dataset.index)  
30 - let daiorder = this.data.daiorder  
31 - this.setData({  
32 - info: daiorder[index]  
33 - })  
34 - console.log(this.data.info)  
35 - this.setData({  
36 - totalmoney: Number(this.data.info.total_price)+Number(this.data.info.youfei)  
37 - })  
38 - }  
39 - this.setData({  
40 - cover_type: !this.data.cover_type  
41 - })  
42 - },  
43 - //查看物流  
44 - look_logistics(e) {  
45 - wx.navigateTo({  
46 - url: '/packageA/pages/logistics/logistics?order=' + e.currentTarget.dataset.d  
47 - })  
48 - },  
49 - //查看订单详情  
50 - orderagain(e) {  
51 - let item=e.currentTarget.dataset.item;  
52 - let num=e.currentTarget.dataset.num;  
53 - let goodid=[]  
54 - item.forEach(function(value,index,array){  
55 - goodid.push(value.id)  
56 - })  
57 - let id=e.currentTarget.dataset.id; 4 + /**
  5 + * 页面的初始数据
  6 + */
58 7
59 - let that = this  
60 - let url = '/shop/recur_order'  
61 - let params = {  
62 - order_id:id  
63 - }  
64 - a.post(url, params).then((res) => {  
65 - // that.setData({  
66 - // "info.shop": Number(that.data.info.shop) + that.data.num,  
67 - // num: 1  
68 - // })  
69 - wx.showModal({  
70 - title: '提示',  
71 - content: '加入成功,是否跳到购物车',  
72 - success(res) {  
73 - if (res.confirm) {  
74 - console.log('用户点击确定')  
75 - wx.redirectTo({  
76 - url: '/packageA/pages/shop_cart/shop_cart', 8 + data: {
  9 + status: 1,
  10 + nav: ['待支付', '待发货', '待收货', '已完成', '退换货'],
  11 + daiorder: [],
  12 + daifahuoorder: [],
  13 + daishouhuoorder: [],
  14 + success: [],
  15 + tui: [],
  16 + cover_type: false,
  17 + totalmoney: ""
  18 + },
  19 + // 展示待支付的去支付弹窗
  20 + show_cover(e) {
  21 + if (a.globalData.status == 0) {
  22 + wx.showToast({
  23 + title: '您已您所在单位暂未开始劳保购买!',
  24 + icon: 'none'
77 }) 25 })
78 - } 26 + return false
79 } 27 }
80 - })  
81 - 28 + if (e.currentTarget.dataset.d) {
  29 + let index = Number(e.currentTarget.dataset.index)
  30 + let daiorder = this.data.daiorder
  31 + this.setData({
  32 + info: daiorder[index]
  33 + })
  34 + this.setData({
  35 + totalmoney: Number(this.data.info.total_price) + Number(this.data.info.youfei)
  36 + })
  37 + }
  38 + this.setData({
  39 + cover_type: !this.data.cover_type
  40 + })
  41 + },
  42 + //查看物流
  43 + look_logistics(e) {
  44 + wx.navigateTo({
  45 + url: '/packageA/pages/logistics/logistics?order=' + e.currentTarget.dataset.d
  46 + })
  47 + },
  48 + //查看订单详情
  49 + orderagain(e) {
  50 + let item = e.currentTarget.dataset.item;
  51 + let num = e.currentTarget.dataset.num;
  52 + let goodid = []
  53 + item.forEach(function (value, index, array) {
  54 + goodid.push(value.id)
  55 + })
  56 + let id = e.currentTarget.dataset.id;
82 57
  58 + let that = this
  59 + let url = '/shop/recur_order'
  60 + let params = {
  61 + order_id: id
  62 + }
  63 + a.post(url, params).then((res) => {
  64 + // that.setData({
  65 + // "info.shop": Number(that.data.info.shop) + that.data.num,
  66 + // num: 1
  67 + // })
  68 + wx.showModal({
  69 + title: '提示',
  70 + content: '加入成功,是否跳到购物车',
  71 + success(res) {
  72 + if (res.confirm) {
  73 + console.log('用户点击确定')
  74 + wx.redirectTo({
  75 + url: '/packageA/pages/shop_cart/shop_cart',
  76 + })
  77 + }
  78 + }
  79 + })
83 80
84 - // wx.switchTab({  
85 - // url: '/pages/shop_cart/shop_cart',  
86 - // })  
87 - })  
88 81
89 -  
90 - // console.log(6666)  
91 - // wx.navigateTo({  
92 - // url: '/pages/order/order_detail/order_detail?id=' + e.currentTarget.dataset.id+'&type='+e.currentTarget.dataset.type,  
93 - // })  
94 - },  
95 - /**  
96 - * 生命周期函数--监听页面加载  
97 - */  
98 - onLoad: function(options) {  
99 - this.setData({  
100 - status: options.type  
101 - })  
102 - this.order_read(options.type)  
103 - },  
104 82
105 - //切换导航  
106 - changeNav(e) {  
107 - var status = e.currentTarget.dataset.index;  
108 - this.setData({  
109 - status: status  
110 - })  
111 - this.order_read(status)  
112 - this.getListFun()  
113 - },  
114 - // 检测订单列表已读准通过台  
115 - order_read(status) {  
116 - let that = this;  
117 - let url = a.interface.order_read  
118 - let params = {  
119 - style: status > 0 ? (status > 1 ? (status > 2 ? (status > 3 ? 'tui' : 'success') : 'daishouhuoorder') : 'daifahuoorder') : 'daiorder'  
120 - }  
121 - a.post(url, params).then((r) => {  
122 - }).catch((er) => {})  
123 - },  
124 - // 获取订单列表  
125 - getListFun() {  
126 - let t = this;  
127 - let u = a.interface.order;  
128 - a.post(u, {}).then((r) => {  
129 - if (r.code == 200) {  
130 - t.setData({  
131 - daiorder: r.msg.daiorder,  
132 - daifahuoorder: r.msg.daifahuoorder,  
133 - daishouhuoorder: r.msg.daishouhuoorder,  
134 - success: r.msg.success,  
135 - tui: r.msg.tui, 83 + // wx.switchTab({
  84 + // url: '/pages/shop_cart/shop_cart',
  85 + // })
136 }) 86 })
137 - }  
138 - }).catch((er) => {})  
139 - },  
140 87
141 - // 支付订单  
142 - payFun(e) {  
143 - let t = this;  
144 - let u = a.interface.order_pay;  
145 - let d = {  
146 - order_odd: e.currentTarget.dataset.d  
147 - }  
148 - a.post(u, d).then((r) => {  
149 - this.setData({  
150 - cover_type: false  
151 - })  
152 - if (r.code == 200) {  
153 - wx.showToast({  
154 - title: r.msg.message,  
155 - icon: r.msg.message == '支付成功"' ? 'success' : 'none',  
156 - duration: 1300 88 +
  89 + // console.log(6666)
  90 + // wx.navigateTo({
  91 + // url: '/pages/order/order_detail/order_detail?id=' + e.currentTarget.dataset.id+'&type='+e.currentTarget.dataset.type,
  92 + // })
  93 + },
  94 + /**
  95 + * 生命周期函数--监听页面加载
  96 + */
  97 + onLoad: function (options) {
  98 + this.setData({
  99 + status: options.type
157 }) 100 })
158 - setTimeout(() => {  
159 - t.getListFun()  
160 - }, 1300)  
161 - }  
162 - }).catch((er) => {})  
163 - }, 101 + this.order_read(options.type)
  102 + },
164 103
165 - // 取消订单  
166 - celFun(e) {  
167 - let t = this;  
168 - let u = a.interface.disorder;  
169 - let d = {  
170 - order_odd: e.currentTarget.dataset.d  
171 - }  
172 - a.post(u, d).then((r) => {  
173 - if (r.code == 200) {  
174 - wx.showToast({  
175 - title: r.msg,  
176 - icon: 'none',  
177 - duration: 1300 104 + //切换导航
  105 + changeNav(e) {
  106 + var status = e.currentTarget.dataset.index;
  107 + this.setData({
  108 + status: status
178 }) 109 })
179 - setTimeout(() => {  
180 - t.getListFun()  
181 - }, 1300)  
182 - }  
183 - }).catch((er) => {})  
184 - }, 110 + this.order_read(status)
  111 + this.getListFun()
  112 + },
  113 + // 检测订单列表已读准通过台
  114 + order_read(status) {
  115 + let that = this;
  116 + let url = a.interface.order_read
  117 + let params = {
  118 + style: status > 0 ? (status > 1 ? (status > 2 ? (status > 3 ? 'tui' : 'success') : 'daishouhuoorder') : 'daifahuoorder') : 'daiorder'
  119 + }
  120 + a.post(url, params).then((r) => {
  121 + }).catch((er) => { })
  122 + },
  123 + // 获取订单列表
  124 + getListFun() {
  125 + let t = this;
  126 + let u = a.interface.order;
  127 + a.post(u, {}).then((r) => {
  128 + if (r.code == 200) {
  129 + t.setData({
  130 + daiorder: r.msg.daiorder,
  131 + daifahuoorder: r.msg.daifahuoorder,
  132 + daishouhuoorder: r.msg.daishouhuoorder,
  133 + success: r.msg.success,
  134 + tui: r.msg.tui,
  135 + })
  136 + }
  137 + }).catch((er) => { })
  138 + },
185 139
186 - // 确认收货  
187 - queren(e) {  
188 - let t = this;  
189 - let u = a.interface.okorder;  
190 - let d = {  
191 - order_odd: e.currentTarget.dataset.d  
192 - }  
193 - a.post(u, d).then((r) => {  
194 - if (r.code == 200) {  
195 - wx.showToast({  
196 - title: r.msg,  
197 - icon: 'none',  
198 - duration: 1300 140 + // 支付订单
  141 + payFun(e) {
  142 + let t = this;
  143 + let u = a.interface.order_pay;
  144 + let d = {
  145 + order_odd: e.currentTarget.dataset.d
  146 + }
  147 + a.post(u, d).then((r) => {
  148 + this.setData({
  149 + cover_type: false
  150 + })
  151 + t.payment(r.msg)
  152 + // if (r.code == 200) {
  153 + // wx.showToast({
  154 + // title: r.msg.message,
  155 + // icon: r.msg.message == '支付成功"' ? 'success' : 'none',
  156 + // duration: 1300
  157 + // })
  158 + // setTimeout(() => {
  159 + // t.getListFun()
  160 + // }, 1300)
  161 + // }
  162 + }).catch((er) => { })
  163 + },
  164 +
  165 + payment(res) {
  166 + let that = this;
  167 + var timeStamp = res.timeStamp.toString();
  168 + wx.requestPayment({
  169 + timeStamp: timeStamp,
  170 + nonceStr: res.nonceStr,
  171 + package: res.package,
  172 + signType: res.signType,
  173 + paySign: res.paySign,
  174 + success: function (res) {
  175 + console.log(res)
  176 + that.setData({
  177 + page: 1,
  178 + daiorder: [],
  179 + cover_type: false
  180 + })
  181 + that.getListFun()
  182 + },
  183 + fail: function (res) {
  184 + console.log(res);
  185 + }
199 }) 186 })
200 - setTimeout(() => {  
201 - t.getListFun()  
202 - }, 1300)  
203 - }  
204 - }).catch((er) => {})  
205 - },  
206 - //删除订单  
207 - delete_item(e) {  
208 - let t = this;  
209 - let u = a.interface.delorder;  
210 - let d = {  
211 - order_odd: e.currentTarget.dataset.d  
212 - }  
213 - a.post(u, d).then((r) => {  
214 - if (r.code == 200) {  
215 - wx.showToast({  
216 - title: r.msg,  
217 - icon: 'none',  
218 - duration: 1300 187 + },
  188 +
  189 + // 取消订单
  190 + celFun(e) {
  191 + let t = this;
  192 + let u = a.interface.disorder;
  193 + let d = {
  194 + order_odd: e.currentTarget.dataset.d
  195 + }
  196 + a.post(u, d).then((r) => {
  197 + if (r.code == 200) {
  198 + wx.showToast({
  199 + title: r.msg,
  200 + icon: 'none',
  201 + duration: 1300
  202 + })
  203 + setTimeout(() => {
  204 + t.getListFun()
  205 + }, 1300)
  206 + }
  207 + }).catch((er) => { })
  208 + },
  209 +
  210 + // 确认收货
  211 + queren(e) {
  212 + let t = this;
  213 + let u = a.interface.okorder;
  214 + let d = {
  215 + order_odd: e.currentTarget.dataset.d
  216 + }
  217 + a.post(u, d).then((r) => {
  218 + if (r.code == 200) {
  219 + wx.showToast({
  220 + title: r.msg,
  221 + icon: 'none',
  222 + duration: 1300
  223 + })
  224 + setTimeout(() => {
  225 + t.getListFun()
  226 + }, 1300)
  227 + }
  228 + }).catch((er) => { })
  229 + },
  230 + //删除订单
  231 + delete_item(e) {
  232 + let t = this;
  233 + let u = a.interface.delorder;
  234 + let d = {
  235 + order_odd: e.currentTarget.dataset.d
  236 + }
  237 + a.post(u, d).then((r) => {
  238 + if (r.code == 200) {
  239 + wx.showToast({
  240 + title: r.msg,
  241 + icon: 'none',
  242 + duration: 1300
  243 + })
  244 + t.getListFun()
  245 + }
  246 + }).catch((er) => { })
  247 + },
  248 + // 退换货跳转页面详情
  249 + jumpReturnFun(e) {
  250 + wx.navigateTo({
  251 + url: '/packageA/pages/order/return_goods/return_goods?d=' + e.currentTarget.dataset.d + "&&t=" + e.currentTarget.dataset.t,
219 }) 252 })
220 - t.getListFun()  
221 - }  
222 - }).catch((er) => {})  
223 - },  
224 - // 退换货跳转页面详情  
225 - jumpReturnFun(e) {  
226 - wx.navigateTo({  
227 - url: '/packageA/pages/order/return_goods/return_goods?d=' + e.currentTarget.dataset.d + "&&t=" + e.currentTarget.dataset.t,  
228 - })  
229 - }, 253 + },
230 254
231 - /**  
232 - * 生命周期函数--监听页面初次渲染完成  
233 - */  
234 - onReady: function() { 255 + /**
  256 + * 生命周期函数--监听页面初次渲染完成
  257 + */
  258 + onReady: function () {
235 259
236 - }, 260 + },
237 261
238 - /**  
239 - * 生命周期函数--监听页面显示  
240 - */  
241 - onShow: function() {  
242 - this.getListFun();  
243 - }, 262 + /**
  263 + * 生命周期函数--监听页面显示
  264 + */
  265 + onShow: function () {
  266 + this.getListFun();
  267 + },
244 268
245 - /**  
246 - * 生命周期函数--监听页面隐藏  
247 - */  
248 - onHide: function() { 269 + /**
  270 + * 生命周期函数--监听页面隐藏
  271 + */
  272 + onHide: function () {
249 273
250 - }, 274 + },
251 275
252 - /**  
253 - * 生命周期函数--监听页面卸载  
254 - */  
255 - onUnload: function() { 276 + /**
  277 + * 生命周期函数--监听页面卸载
  278 + */
  279 + onUnload: function () {
256 280
257 - }, 281 + },
258 282
259 - /**  
260 - * 页面相关事件处理函数--监听用户下拉动作  
261 - */  
262 - onPullDownRefresh: function() { 283 + /**
  284 + * 页面相关事件处理函数--监听用户下拉动作
  285 + */
  286 + onPullDownRefresh: function () {
263 287
264 - }, 288 + },
265 289
266 - /**  
267 - * 页面上拉触底事件的处理函数  
268 - */  
269 - onReachBottom: function() { 290 + /**
  291 + * 页面上拉触底事件的处理函数
  292 + */
  293 + onReachBottom: function () {
270 294
271 - }, 295 + },
272 296
273 - /**  
274 - * 用户点击右上角分享  
275 - */  
276 - onShareAppMessage: function() { 297 + /**
  298 + * 用户点击右上角分享
  299 + */
  300 + onShareAppMessage: function () {
277 301
278 - } 302 + }
279 }) 303 })
@@ -17,8 +17,8 @@ @@ -17,8 +17,8 @@
17 <view class='info_titles'>{{zitem.product_name}}</view> 17 <view class='info_titles'>{{zitem.product_name}}</view>
18 18
19 <view class='two_ones'> 19 <view class='two_ones'>
20 - <view class='scores'>积分</view>  
21 - <view class='prices'>{{zitem.product_money}}</view> 20 + <!-- <view class='scores'>积分</view> -->
  21 + <view class='prices'>¥{{zitem.product_money}}</view>
22 <view class='prices' style="margin-left: 10rpx;color:#ccc;font-size: 28rpx;">X{{zitem.num}}</view> 22 <view class='prices' style="margin-left: 10rpx;color:#ccc;font-size: 28rpx;">X{{zitem.num}}</view>
23 </view> 23 </view>
24 </view> 24 </view>
@@ -44,13 +44,13 @@ @@ -44,13 +44,13 @@
44 44
45 45
46 <view class='mask_two'> 46 <view class='mask_two'>
47 - <view>商品积分</view>  
48 - <view class='score'>{{item.total_price*100/100}}积分</view> 47 + <view>商品价格</view>
  48 + <view class='score'>¥{{item.total_price*100/100}}</view>
49 </view> 49 </view>
50 - <view class='mask_two no_border'> 50 + <!-- <view class='mask_two no_border'>
51 <view>邮费积分</view> 51 <view>邮费积分</view>
52 <view class='score'>{{item.youfei}}积分</view> 52 <view class='score'>{{item.youfei}}积分</view>
53 - </view> 53 + </view> -->
54 </view> 54 </view>
55 <view class='btn_box'> 55 <view class='btn_box'>
56 <!-- <view class='go_pay' data-d="{{item.order_odd}}" catchtap="payFun">去支付</view> --> 56 <!-- <view class='go_pay' data-d="{{item.order_odd}}" catchtap="payFun">去支付</view> -->
@@ -76,8 +76,8 @@ @@ -76,8 +76,8 @@
76 <view class='img_right'> 76 <view class='img_right'>
77 <view class='info_titles'>{{zitem.product_name}}</view> 77 <view class='info_titles'>{{zitem.product_name}}</view>
78 <view class='two_ones'> 78 <view class='two_ones'>
79 - <view class='scores'>积分</view>  
80 - <view class='prices'>{{zitem.product_money}}</view> 79 + <!-- <view class='scores'>积分</view> -->
  80 + <view class='prices'>¥{{zitem.product_money}}</view>
81 <view class='prices' style="margin-left: 10rpx;color:#ccc;font-size: 28rpx;">X{{zitem.num}}</view> 81 <view class='prices' style="margin-left: 10rpx;color:#ccc;font-size: 28rpx;">X{{zitem.num}}</view>
82 </view> 82 </view>
83 </view> 83 </view>
@@ -87,8 +87,8 @@ @@ -87,8 +87,8 @@
87 <view class='mask_two no_border'> 87 <view class='mask_two no_border'>
88 <view class='scorea' decode='{{true}}'>共{{item.total_num}}件商品 88 <view class='scorea' decode='{{true}}'>共{{item.total_num}}件商品
89 <text decode='{{true}}'>&emsp;实付:</text> 89 <text decode='{{true}}'>&emsp;实付:</text>
90 - <text class='red_score'> {{item.total_price*100/100 + (item.youfei*100)/100}}</text>  
91 - <text class='small_red_score'>积分</text> 90 + <text class='red_score'>¥ {{item.total_price*100/100 + (item.youfei*100)/100}}</text>
  91 + <!-- <text class='small_red_score'>积分</text> -->
92 </view> 92 </view>
93 </view> 93 </view>
94 94
@@ -110,13 +110,13 @@ @@ -110,13 +110,13 @@
110 </view> 110 </view>
111 111
112 <view class='mask_two'> 112 <view class='mask_two'>
113 - <view>商品积分</view>  
114 - <view class='score'>{{item.total_price*100/100}}积分</view> 113 + <view>商品价格</view>
  114 + <view class='score'>¥{{item.total_price*100/100}}</view>
115 </view> 115 </view>
116 - <view class='mask_two no_border'> 116 + <!-- <view class='mask_two no_border'>
117 <view>邮费积分</view> 117 <view>邮费积分</view>
118 <view class='score'>{{item.youfei}}积分</view> 118 <view class='score'>{{item.youfei}}积分</view>
119 - </view> 119 + </view> -->
120 <view class='btn_box'> 120 <view class='btn_box'>
121 <view class='go_pay' data-d="{{item.order_odd}}" data-t="2" bindtap="orderagain" data-id="{{item.id}}" data-type="2" data-item="{{item.orderitem}}" data-num="{{item.total_num}}">再来一单</view> 121 <view class='go_pay' data-d="{{item.order_odd}}" data-t="2" bindtap="orderagain" data-id="{{item.id}}" data-type="2" data-item="{{item.orderitem}}" data-num="{{item.total_num}}">再来一单</view>
122 <view class='cancel_order' data-d="{{item.order_odd}}" data-t="1" bindtap="jumpReturnFun">退货</view> 122 <view class='cancel_order' data-d="{{item.order_odd}}" data-t="1" bindtap="jumpReturnFun">退货</view>
@@ -146,8 +146,8 @@ @@ -146,8 +146,8 @@
146 <view class="address">收电话:</view> --> 146 <view class="address">收电话:</view> -->
147 147
148 <view class='two_ones'> 148 <view class='two_ones'>
149 - <view class='scores'>积分</view>  
150 - <view class='prices'>{{zitem.product_money}}</view> 149 + <!-- <view class='scores'>积分</view> -->
  150 + <view class='prices'>¥{{zitem.product_money}}</view>
151 <view class='prices' style="margin-left: 10rpx;color:#ccc;font-size: 28rpx;">X{{zitem.num}}</view> 151 <view class='prices' style="margin-left: 10rpx;color:#ccc;font-size: 28rpx;">X{{zitem.num}}</view>
152 </view> 152 </view>
153 </view> 153 </view>
@@ -172,19 +172,19 @@ @@ -172,19 +172,19 @@
172 </view> 172 </view>
173 173
174 <view class='mask_two'> 174 <view class='mask_two'>
175 - <view>商品积分</view>  
176 - <view class='score'>{{item.total_price*100/100}}积分</view> 175 + <view>商品价格</view>
  176 + <view class='score'>¥{{item.total_price*100/100}}</view>
177 </view> 177 </view>
178 - <view class='mask_two no_border'> 178 + <!-- <view class='mask_two no_border'>
179 <view>邮费积分</view> 179 <view>邮费积分</view>
180 <view class='score'>{{item.youfei}}积分</view> 180 <view class='score'>{{item.youfei}}积分</view>
181 - </view> 181 + </view> -->
182 182
183 <view class='mask_two no_border'> 183 <view class='mask_two no_border'>
184 <view class='scorea' decode='{{true}}'>共{{item.total_num}}件商品 184 <view class='scorea' decode='{{true}}'>共{{item.total_num}}件商品
185 <text decode='{{true}}'>&emsp;实付:</text> 185 <text decode='{{true}}'>&emsp;实付:</text>
186 - <text class='red_score'> {{item.total_price*100/100 + (item.youfei*100)/100}}</text>  
187 - <text class='small_red_score'>积分</text> 186 + <text class='red_score'> ¥{{item.total_price*100/100 + (item.youfei*100)/100}}</text>
  187 + <!-- <text class='small_red_score'>积分</text> -->
188 </view> 188 </view>
189 </view> 189 </view>
190 <view class='btn_box'> 190 <view class='btn_box'>
@@ -215,8 +215,8 @@ @@ -215,8 +215,8 @@
215 215
216 216
217 <view class='two_ones'> 217 <view class='two_ones'>
218 - <view class='scores'>积分</view>  
219 - <view class='prices'>{{zitem.product_money}}</view> 218 + <!-- <view class='scores'>积分</view> -->
  219 + <view class='prices'>¥{{zitem.product_money}}</view>
220 <view class='prices' style="margin-left: 10rpx;color:#ccc;font-size: 28rpx;">X{{zitem.num}}</view> 220 <view class='prices' style="margin-left: 10rpx;color:#ccc;font-size: 28rpx;">X{{zitem.num}}</view>
221 </view> 221 </view>
222 </view> 222 </view>
@@ -241,19 +241,19 @@ @@ -241,19 +241,19 @@
241 </view> 241 </view>
242 242
243 <view class='mask_two'> 243 <view class='mask_two'>
244 - <view>商品积分</view>  
245 - <view class='score'>{{item.total_price*100/100}}积分</view> 244 + <view>商品价格</view>
  245 + <view class='score'>¥{{item.total_price*100/100}}</view>
246 </view> 246 </view>
247 - <view class='mask_two no_border'> 247 + <!-- <view class='mask_two no_border'>
248 <view>邮费积分</view> 248 <view>邮费积分</view>
249 <view class='score'>{{item.youfei}}积分</view> 249 <view class='score'>{{item.youfei}}积分</view>
250 - </view> 250 + </view> -->
251 251
252 <view class='mask_two no_border'> 252 <view class='mask_two no_border'>
253 <view class='scorea' decode='{{true}}'>共{{item.total_num}}件商品 253 <view class='scorea' decode='{{true}}'>共{{item.total_num}}件商品
254 <text decode='{{true}}'>&emsp;实付:</text> 254 <text decode='{{true}}'>&emsp;实付:</text>
255 - <text class='red_score'> {{item.total_price*100/100 + (item.youfei*100)/100}}</text>  
256 - <text class='small_red_score'>积分</text> 255 + <text class='red_score'>¥ {{item.total_price*100/100 + (item.youfei*100)/100}}</text>
  256 + <!-- <text class='small_red_score'>积分</text> -->
257 </view> 257 </view>
258 </view> 258 </view>
259 259
@@ -284,8 +284,8 @@ @@ -284,8 +284,8 @@
284 284
285 285
286 <view class='two_ones'> 286 <view class='two_ones'>
287 - <view class='scores'>积分</view>  
288 - <view class='prices'>{{zitem.product_money}}</view> 287 + <!-- <view class='scores'>积分</view> -->
  288 + <view class='prices'>¥{{zitem.product_money}}</view>
289 <view class='prices' style="margin-left: 10rpx;color:#ccc;font-size: 28rpx;">X{{zitem.num}}</view> 289 <view class='prices' style="margin-left: 10rpx;color:#ccc;font-size: 28rpx;">X{{zitem.num}}</view>
290 </view> 290 </view>
291 </view> 291 </view>
@@ -309,19 +309,19 @@ @@ -309,19 +309,19 @@
309 </view> 309 </view>
310 310
311 <view class='mask_two'> 311 <view class='mask_two'>
312 - <view>商品积分</view>  
313 - <view class='score'>{{item.total_price*100/100}}积分</view> 312 + <view>商品价格</view>
  313 + <view class='score'>¥{{item.total_price*100/100}}</view>
314 </view> 314 </view>
315 - <view class='mask_two no_border'> 315 + <!-- <view class='mask_two no_border'>
316 <view>邮费积分</view> 316 <view>邮费积分</view>
317 <view class='score'>{{item.youfei}}积分</view> 317 <view class='score'>{{item.youfei}}积分</view>
318 - </view> 318 + </view> -->
319 319
320 <view class='mask_two no_border'> 320 <view class='mask_two no_border'>
321 <view class='scorea' decode='{{true}}'>共{{item.total_num}}件商品 321 <view class='scorea' decode='{{true}}'>共{{item.total_num}}件商品
322 <text decode='{{true}}'>&emsp;实付:</text> 322 <text decode='{{true}}'>&emsp;实付:</text>
323 - <text class='red_score'> {{item.total_price*1000/1000 + (item.youfei*1000)/1000}}</text>  
324 - <text class='small_red_score'>积分</text> 323 + <text class='red_score'>¥ {{item.total_price*1000/1000 + (item.youfei*1000)/1000}}</text>
  324 + <!-- <text class='small_red_score'>积分</text> -->
325 </view> 325 </view>
326 </view> 326 </view>
327 <view class='btn_box'> 327 <view class='btn_box'>
@@ -341,15 +341,15 @@ @@ -341,15 +341,15 @@
341 <!-- 待支付订单的支付弹窗 --> 341 <!-- 待支付订单的支付弹窗 -->
342 <view class="cover_box" wx:if="{{cover_type}}"> 342 <view class="cover_box" wx:if="{{cover_type}}">
343 <view class="cover_order"> 343 <view class="cover_order">
344 - <view class="all_money">{{totalmoney}}积分</view> 344 + <view class="all_money">¥{{totalmoney}}</view>
345 <view class="money_item"> 345 <view class="money_item">
346 - <text>商品积分</text>  
347 - <text>{{info.total_price}}积分</text> 346 + <text>商品价格</text>
  347 + <text>¥{{info.total_price}}</text>
348 </view> 348 </view>
349 - <view class="money_item"> 349 + <!-- <view class="money_item">
350 <text>邮费</text> 350 <text>邮费</text>
351 <text>{{info.youfei}}积分</text> 351 <text>{{info.youfei}}积分</text>
352 - </view> 352 + </view> -->
353 <view class="cover_submit" data-d="{{info.order_odd}}" catchtap="payFun">确认支付</view> 353 <view class="cover_submit" data-d="{{info.order_odd}}" catchtap="payFun">确认支付</view>
354 <image src="/images/close.png" class="cover_close" catchtap="show_cover" /> 354 <image src="/images/close.png" class="cover_close" catchtap="show_cover" />
355 </view> 355 </view>
@@ -93,12 +93,12 @@ @@ -93,12 +93,12 @@
93 </view> 93 </view>
94 <view class='mask_twos'> 94 <view class='mask_twos'>
95 <view class='mask_two'> 95 <view class='mask_two'>
96 - <view>退还总积分</view>  
97 - <view class='score'>{{detail.order.total_price + detail.order.youfei*100/100}}积分</view> 96 + <view>退还总金额</view>
  97 + <view class='score'>¥{{detail.order.total_price + detail.order.youfei*100/100}}</view>
98 </view> 98 </view>
99 <view class='mask_two'> 99 <view class='mask_two'>
100 <view>退回账户</view> 100 <view>退回账户</view>
101 - <view class='score'>{{detail.status == 1?detail.order.total_price + detail.order.youfei*100/100:0}}积分</view> 101 + <view class='score'>¥{{detail.status == 1?detail.order.total_price + detail.order.youfei*100/100:0}}</view>
102 </view> 102 </view>
103 </view> 103 </view>
104 <!-- 退款失败结束 --> 104 <!-- 退款失败结束 -->
@@ -130,8 +130,8 @@ @@ -130,8 +130,8 @@
130 <view class='score'>{{detail.cause}}</view> 130 <view class='score'>{{detail.cause}}</view>
131 </view> 131 </view>
132 <view class='mask_two'> 132 <view class='mask_two'>
133 - <view>退款积分</view>  
134 - <view class='score'>{{detail.order.total_price + detail.order.youfei*100/100}}积分</view> 133 + <view>退款金额</view>
  134 + <view class='score'>¥{{detail.order.total_price + detail.order.youfei*100/100}}</view>
135 </view> 135 </view>
136 </view> 136 </view>
137 </view> 137 </view>
@@ -2,9 +2,9 @@ @@ -2,9 +2,9 @@
2 <navigator class="no_login" catchtap="go_login" url="/pages/register/register" hover-class="none">请先登录</navigator> 2 <navigator class="no_login" catchtap="go_login" url="/pages/register/register" hover-class="none">请先登录</navigator>
3 </block> 3 </block>
4 4
5 -<block wx:elif="{{login_new==''}}"> 5 +<!-- <block wx:elif="{{login_new==''}}">
6 <navigator class="no_login" catchtap="go_login" url="/pages/login/login" hover-class="none">请先绑定后操作,点击绑定</navigator> 6 <navigator class="no_login" catchtap="go_login" url="/pages/login/login" hover-class="none">请先绑定后操作,点击绑定</navigator>
7 -</block> 7 +</block> -->
8 8
9 9
10 <block wx:else> 10 <block wx:else>
@@ -21,7 +21,8 @@ @@ -21,7 +21,8 @@
21 </view> 21 </view>
22 <view class="tips_info"> 22 <view class="tips_info">
23 <text>不含运费</text>合计 23 <text>不含运费</text>合计
24 - <text>{{integral}}积分</text> 24 + <!-- 2023-10-19 需求要将积分改为微信支付的金额 -->
  25 + <text>¥{{integral}}</text>
25 </view> 26 </view>
26 <view class="submit" bindtap="submit">结算({{all_num}})</view> 27 <view class="submit" bindtap="submit">结算({{all_num}})</view>
27 </view> 28 </view>
1 <import src="/wxParse/wxParse.wxml" /> 1 <import src="/wxParse/wxParse.wxml" />
2 2
3 <view class='page{{mask?" active":""}}'> 3 <view class='page{{mask?" active":""}}'>
4 - <concat/>  
5 - <view class='top'>  
6 - <view class='current_box'>{{current+1}}/{{info.images.length}}</view>  
7 - <swiper class='swiper' current='{{current}}' bindchange='getCurrent'>  
8 - <swiper-item class='swiper-item' wx:for='{{info.images}}' wx:key='index'>  
9 - <image src='{{item}}' mode="aspectFill" />  
10 - </swiper-item>  
11 - </swiper>  
12 - </view>  
13 - <view class='two'>  
14 - <view class='two_one'>  
15 - <view class='score'>积分</view>  
16 - <view class='price'>{{info.price2==null?info.price:info.price2}}</view> 4 + <concat />
  5 + <view class='top'>
  6 + <view class='current_box'>{{current+1}}/{{info.images.length}}</view>
  7 + <swiper class='swiper' current='{{current}}' bindchange='getCurrent'>
  8 + <swiper-item class='swiper-item' wx:for='{{info.images}}' wx:key='index'>
  9 + <image src='{{item}}' mode="aspectFill" />
  10 + </swiper-item>
  11 + </swiper>
17 </view> 12 </view>
  13 + <view class='two'>
  14 + <view class='two_one'>
  15 + <!-- 2023-10-19 需求要将积分改为微信支付的金额 -->
  16 + <!-- <view class='score'>积分</view> -->
  17 + <view class='price'>¥{{info.price2==null?info.price:info.price2}}</view>
  18 + </view>
18 19
19 - <!-- <view class="oldprice" wx:if="{{info.price2!=null}}">{{info.price}}</view> -->  
20 - <view class='two_two'>{{info.name}}</view>  
21 - <view class='two_three two_threek'>  
22 - <view>库存:{{info.sold}}</view>  
23 - <view>销量:{{info.paynum}}</view>  
24 - </view>  
25 - </view>  
26 - <view class='three'>  
27 - <view class='three_one'>  
28 - <view class='three_one_item {{status==index?"active":""}}' wx:for='{{nav}}' wx:for-index='index' wx:key='{{index}}' bindtap='clickNav' data-index='{{index}}'>{{item}}</view>  
29 - </view>  
30 - <view class='three_two'>  
31 - <template is="wxParse" data="{{wxParseData:contenta.nodes}}" wx:if="{{status==0}}" />  
32 - <template is="wxParse" data="{{wxParseData:contenb.nodes}}" wx:elif="{{status==1}}" />  
33 - <template is="wxParse" data="{{wxParseData:contenc.nodes}}" wx:elif="{{status==2}}" /> 20 + <!-- <view class="oldprice" wx:if="{{info.price2!=null}}">{{info.price}}</view> -->
  21 + <view class='two_two'>{{info.name}}</view>
  22 + <view class='two_three two_threek'>
  23 + <view>库存:{{info.sold}}</view>
  24 + <view>销量:{{info.paynum}}</view>
  25 + </view>
34 </view> 26 </view>
  27 + <view class='three'>
  28 + <view class='three_one'>
  29 + <view class='three_one_item {{status==index?"active":""}}' wx:for='{{nav}}' wx:for-index='index' wx:key='{{index}}' bindtap='clickNav' data-index='{{index}}'>{{item}}</view>
  30 + </view>
  31 + <view class='three_two'>
  32 + <template is="wxParse" data="{{wxParseData:contenta.nodes}}" wx:if="{{status==0}}" />
  33 + <template is="wxParse" data="{{wxParseData:contenb.nodes}}" wx:elif="{{status==1}}" />
  34 + <template is="wxParse" data="{{wxParseData:contenc.nodes}}" wx:elif="{{status==2}}" />
  35 + </view>
35 36
36 - </view>  
37 - <view class='bottom'>  
38 - <view class='cart_box' catchtap="go_car">  
39 - <view class='cart_img'>  
40 - <view class='cart_count'>{{info.shop}}</view>  
41 - <image src='/images/icon_51.png'></image>  
42 - </view>  
43 - <view class='cart_font'>购物车</view>  
44 </view> 37 </view>
  38 + <view class='bottom'>
  39 + <view class='cart_box' catchtap="go_car">
  40 + <view class='cart_img'>
  41 + <view class='cart_count'>{{info.shop}}</view>
  42 + <image src='/images/icon_51.png'></image>
  43 + </view>
  44 + <view class='cart_font'>购物车</view>
  45 + </view>
45 46
46 - <view class="sc_box" catchtap="colloct">  
47 - <image src="{{info.colloct?'/images/sc@.png':'/images/sc.png'}}" />  
48 - <view class="{{info.colloct?'active':''}}">{{info.colloct?'已收藏':'收藏'}}</view>  
49 - </view> 47 + <view class="sc_box" catchtap="colloct">
  48 + <image src="{{info.colloct?'/images/sc@.png':'/images/sc.png'}}" />
  49 + <view class="{{info.colloct?'active':''}}">{{info.colloct?'已收藏':'收藏'}}</view>
  50 + </view>
50 51
51 - <view class='left_btn' bindtap='change_cover' data-type="1">加入购物车</view>  
52 - <view class='right_btn' bindtap='change_cover' data-type="2">立即购买</view> 52 + <view class='left_btn' bindtap='change_cover' data-type="1">加入购物车</view>
  53 + <view class='right_btn' bindtap='change_cover' data-type="2">立即购买</view>
53 54
54 - <!-- 遮罩 -->  
55 - <view class="bottom_cover" catchtap="go_login" wx:if="{{no_login}}" />  
56 - </view> 55 + <!-- 遮罩 -->
  56 + <view class="bottom_cover" catchtap="go_login" wx:if="{{no_login}}" />
  57 + </view>
57 </view> 58 </view>
58 <!-- 弹框开始 --> 59 <!-- 弹框开始 -->
59 <view class='mask' wx:if='{{mask}}' bindtap="change_cover" catchtouchmove="true"> 60 <view class='mask' wx:if='{{mask}}' bindtap="change_cover" catchtouchmove="true">
60 - <view class='mask_diceng'>  
61 - <view class='mask_one'>  
62 - <view class='mask_img'>  
63 - <image src='{{info.images[0]}}'></image>  
64 - </view>  
65 - <view class='img_right'>  
66 - <view class='info_title'>{{info.name}}</view>  
67 - <view wx:if="{{info.price2!=null}}">  
68 - <view class='two_ones'>  
69 - <view class='scores'>积分</view>  
70 - <view class='prices'>{{info.price2}}</view>  
71 - </view>  
72 - <!-- <view class="oldprice">{{info.price}}</view> -->  
73 - </view>  
74 - 61 + <view class='mask_diceng'>
  62 + <view class='mask_one'>
  63 + <view class='mask_img'>
  64 + <image src='{{info.images[0]}}'></image>
  65 + </view>
  66 + <view class='img_right'>
  67 + <view class='info_title'>{{info.name}}</view>
  68 + <view wx:if="{{info.price2!=null}}">
  69 + <view class='two_ones'>
  70 + <!-- 2023-10-19 需求要将积分改为微信支付的金额 -->
  71 + <!-- <view class='scores'>积分</view> -->
  72 + <view class='prices'>¥{{info.price2}}</view>
  73 + </view>
  74 + <!-- <view class="oldprice">{{info.price}}</view> -->
  75 + </view>
75 76
76 - <view class='two_ones' wx:else>  
77 - <view class='scores'>积分</view>  
78 - <view class='prices'>{{info.price}}</view> 77 +
  78 + <view class='two_ones' wx:else>
  79 + <!-- 2023-10-19 需求要将积分改为微信支付的金额 -->
  80 + <!-- <view class='scores'>积分</view> -->
  81 + <view class='prices'>¥{{info.price}}</view>
  82 + </view>
  83 + </view>
79 </view> 84 </view>
80 - </view>  
81 - </view>  
82 - <view class='mask_two'>  
83 - <view class='mask_two_name'>购买数量</view>  
84 - <view class='operation_box'>  
85 - <view class='operation_btn' data-type="0" catchtap="num_change">  
86 - <image src='/images/reduce.png'></image> 85 + <view class='mask_two'>
  86 + <view class='mask_two_name'>购买数量</view>
  87 + <view class='operation_box'>
  88 + <view class='operation_btn' data-type="0" catchtap="num_change">
  89 + <image src='/images/reduce.png'></image>
  90 + </view>
  91 + <view class='operation_count'>{{num}}</view>
  92 + <view class='operation_btn' data-type="1" catchtap="num_change">
  93 + <image src='/images/add.png'></image>
  94 + </view>
  95 + </view>
87 </view> 96 </view>
88 - <view class='operation_count'>{{num}}</view>  
89 - <view class='operation_btn' data-type="1" catchtap="num_change">  
90 - <image src='/images/add.png'></image> 97 + <view class='mask_three'>
  98 + <view class='mask_btn1' bindtap='addshop' wx:if="{{btn_type == 1}}">加入购物车</view>
  99 + <view class='mask_btn2' bindtap='purchaseNow' wx:elif="{{btn_type == 2}}">立即购买</view>
91 </view> 100 </view>
92 - </view>  
93 - </view>  
94 - <view class='mask_three'>  
95 - <view class='mask_btn1' bindtap='addshop' wx:if="{{btn_type == 1}}">加入购物车</view>  
96 - <view class='mask_btn2' bindtap='purchaseNow' wx:elif="{{btn_type == 2}}">立即购买</view>  
97 </view> 101 </view>
98 - </view>  
99 102
100 </view> 103 </view>
101 <!-- 弹框结束--> 104 <!-- 弹框结束-->