Commit 14267c2aee74cc6f5c3d6f2753006709f8e787b9
1 parent
217ef50f
超包整理
Showing
13 changed files
with
143 additions
and
499 deletions
app.js
| ... | ... | @@ -2,7 +2,7 @@ var t = require("setting.js"), o = require("./utils/auth.js"), a = require("./ut | 
| 2 | 2 | var os = t; | 
| 3 | 3 | var regeneratorRuntime = require('./utils/runtime.js'); | 
| 4 | 4 | var api = require("./api/api.js") | 
| 5 | -// import { pluginGD } from './utils/ai_config/config' | |
| 5 | + | |
| 6 | 6 | //公共方法和变量 | 
| 7 | 7 | App({ | 
| 8 | 8 | |
| ... | ... | @@ -221,21 +221,6 @@ App({ | 
| 221 | 221 | |
| 222 | 222 | }, | 
| 223 | 223 | |
| 224 | - // overShare:function() { | |
| 225 | - // // 监听路由切换 | |
| 226 | - // wx.onAppRoute(function(res) { | |
| 227 | - // console.log('route',res) | |
| 228 | - // let pages = getCurrentPages() | |
| 229 | - // let view = pages[pages.length - 1] | |
| 230 | - // if(view) { | |
| 231 | - // wx.showShareMenu({ | |
| 232 | - // withShareTicket:true, | |
| 233 | - // menus:['shareAppMessage','shareTimeline'] | |
| 234 | - // }) | |
| 235 | - // } | |
| 236 | - // }) | |
| 237 | - // }, | |
| 238 | - | |
| 239 | 224 | //---初始化第三方---- | 
| 240 | 225 | initExt: function () { | 
| 241 | 226 | var tt = t; | 
| ... | ... | @@ -267,14 +252,6 @@ App({ | 
| 267 | 252 | if (null == s.globalData.userInfo) { | 
| 268 | 253 | return o.auth(t); | 
| 269 | 254 | } | 
| 270 | - /*--- | |
| 271 | - a.get("/api/user/userInfo", { | |
| 272 | - isShowLoading: void 0 === i || i, | |
| 273 | - success: function(o) { | |
| 274 | - s.globalData.userInfo = o.data.result, s.globalData.userInfo.head_pic = e.getFullUrl(s.globalData.userInfo.head_pic), | |
| 275 | - "function" == typeof t && t(s.globalData.userInfo, s.globalData.wechatUser); | |
| 276 | - } | |
| 277 | - });--*/ | |
| 278 | 255 | } | 
| 279 | 256 | }, | 
| 280 | 257 | //----------------获取配置参数-------------------- | 
| ... | ... | @@ -390,7 +367,6 @@ App({ | 
| 390 | 367 | }); | 
| 391 | 368 | }, | 
| 392 | 369 | showWarning: function (t, o, a, e) { | 
| 393 | - //var imghost=this.globalData.setting.imghost; | |
| 394 | 370 | !a && (a = 1500), void 0 === e && (e = !0), wx.showToast({ | 
| 395 | 371 | title: t, | 
| 396 | 372 | mask: e, | 
| ... | ... | @@ -510,7 +486,7 @@ App({ | 
| 510 | 486 | wx.navigateTo({ url: url, }) //跳到tabbar页 | 
| 511 | 487 | } | 
| 512 | 488 | } | 
| 513 | - //wx.navigateTo({ url: url, }) //跳到非tabbar页 | |
| 489 | + | |
| 514 | 490 | }, | 
| 515 | 491 | |
| 516 | 492 | //显示提示,word提示内容,type 0失败,提示 1成功 | 
| ... | ... | @@ -663,11 +639,6 @@ App({ | 
| 663 | 639 | num += e.data.data.pageData[i].goods_num; | 
| 664 | 640 | } | 
| 665 | 641 | } | 
| 666 | - /*--- | |
| 667 | - wx.setTabBarBadge({ //tabbar右上角添加文本 | |
| 668 | - index: 2, ////tabbar下标 | |
| 669 | - text: '' + num //显示的内容 | |
| 670 | - });--*/ | |
| 671 | 642 | //-- 读取服务卡的数量 -- | 
| 672 | 643 | that.promiseGet("/api/weshop/cartService/page", { | 
| 673 | 644 | data: { | 
| ... | ... | @@ -1075,7 +1046,133 @@ App({ | 
| 1075 | 1046 | return parseFloat((parseFloat(first_money)+parseFloat(second_money)+parseFloat(third_money)).toFixed(2)); | 
| 1076 | 1047 | } | 
| 1077 | 1048 | } | 
| 1078 | - } | |
| 1049 | + }, | |
| 1050 | + | |
| 1051 | + | |
| 1052 | + // 保存图片到手机 | |
| 1053 | + savePic(th) { | |
| 1054 | + console.log('保存图片'); | |
| 1055 | + var self = th; | |
| 1056 | + // 获取用户的当前设置,返回值中有小程序已经向用户请求过的权限 | |
| 1057 | + this.getSetting().then((res) => { | |
| 1058 | + // 判断用户是否授权了保存到相册的权限,如果没有发起授权 | |
| 1059 | + if (!res.authSetting['scope.writePhotosAlbum']) { | |
| 1060 | + this.authorize().then(() => { | |
| 1061 | + // 同意授权后保存下载文件 | |
| 1062 | + this.saveImage(self.data.shareImgPath,th) | |
| 1063 | + .then(() => { | |
| 1064 | + self.setData({ | |
| 1065 | + showPoster: false | |
| 1066 | + }); | |
| 1067 | + }); | |
| 1068 | + }) | |
| 1069 | + } else { | |
| 1070 | + // 如果已经授权,保存下载文件 | |
| 1071 | + this.saveImage(self.data.shareImgPath) | |
| 1072 | + .then(() => { | |
| 1073 | + self.setData({ | |
| 1074 | + showPoster: false | |
| 1075 | + }); | |
| 1076 | + }); | |
| 1077 | + } | |
| 1078 | + | |
| 1079 | + }) | |
| 1080 | + }, | |
| 1081 | + | |
| 1082 | + // 获取用户已经授予了哪些权限 | |
| 1083 | + getSetting() { | |
| 1084 | + return new Promise((resolve, reject) => { | |
| 1085 | + wx.getSetting({ | |
| 1086 | + success: res => { | |
| 1087 | + resolve(res) | |
| 1088 | + } | |
| 1089 | + }) | |
| 1090 | + }) | |
| 1091 | + }, | |
| 1092 | + // 发起首次授权请求 | |
| 1093 | + authorize() { | |
| 1094 | + // isFirst 用来记录是否为首次发起授权, | |
| 1095 | + // 如果首次授权拒绝后,isFirst赋值为1 | |
| 1096 | + let isFirst = wx.getStorageSync('isFirst') || 0; | |
| 1097 | + return new Promise((resolve, reject) => { | |
| 1098 | + wx.authorize({ | |
| 1099 | + scope: 'scope.writePhotosAlbum', | |
| 1100 | + // 同意授权 | |
| 1101 | + success: () => { | |
| 1102 | + resolve(); | |
| 1103 | + }, | |
| 1104 | + // 拒绝授权,这里是用户拒绝授权后的回调 | |
| 1105 | + fail: res => { | |
| 1106 | + if (isFirst === 0) { | |
| 1107 | + wx.setStorageSync('isFirst', 1); | |
| 1108 | + wx.showToast({ | |
| 1109 | + title: '保存失败', | |
| 1110 | + icon: 'none', | |
| 1111 | + duration: 1000 | |
| 1112 | + }) | |
| 1113 | + } | |
| 1114 | + console.log('拒绝授权'); | |
| 1115 | + reject(); | |
| 1116 | + } | |
| 1117 | + }) | |
| 1118 | + }) | |
| 1119 | + }, | |
| 1120 | + // 保存图片到系统相册 | |
| 1121 | + saveImage(saveUrl,th) { | |
| 1122 | + var self = th; | |
| 1123 | + return new Promise((resolve, reject) => { | |
| 1124 | + wx.saveImageToPhotosAlbum({ | |
| 1125 | + filePath: saveUrl, | |
| 1126 | + success: (res) => { | |
| 1127 | + wx.showToast({ | |
| 1128 | + title: '保存成功', | |
| 1129 | + duration: 1000, | |
| 1130 | + }); | |
| 1131 | + self.setData({ | |
| 1132 | + showPlaybill: 'true' | |
| 1133 | + }); | |
| 1134 | + resolve(); | |
| 1135 | + }, | |
| 1136 | + fail: () => { | |
| 1137 | + wx.showToast({ | |
| 1138 | + title: '保存失败', | |
| 1139 | + duration: 1000, | |
| 1140 | + }); | |
| 1141 | + } | |
| 1142 | + }) | |
| 1143 | + }) | |
| 1144 | + }, | |
| 1145 | + | |
| 1146 | + //文本换行 参数:1、canvas对象,2、文本 3、距离左侧的距离 4、距离顶部的距离 5、6、文本的宽度 | |
| 1147 | + draw_Text: function (ctx, str, leftWidth, initHeight, titleHeight, canvasWidth, unit, lineNum) { | |
| 1148 | + var lineWidth = 0; | |
| 1149 | + var lastSubStrIndex = 0; //每次开始截取的字符串的索引 | |
| 1150 | + var han = 0; | |
| 1151 | + for (let i = 0; i < str.length; i++) { | |
| 1152 | + if(lineNum) { | |
| 1153 | + if(han == lineNum) return; | |
| 1154 | + }; | |
| 1155 | + if (han == 2) return; | |
| 1156 | + //lineWidth += ctx.measureText(str[i]).width; | |
| 1157 | + lineWidth += ut.measureText(str[i], 21.3 * unit); | |
| 1158 | + if (lineWidth > canvasWidth) { | |
| 1159 | + han++; | |
| 1160 | + | |
| 1161 | + if (han == 2 || han == lineNum) | |
| 1162 | + ctx.fillText(str.substring(lastSubStrIndex, i) + '...', leftWidth, initHeight); //绘制截取部分 | |
| 1163 | + else | |
| 1164 | + ctx.fillText(str.substring(lastSubStrIndex, i), leftWidth, initHeight); | |
| 1165 | + | |
| 1166 | + initHeight += 22; //22为字体的高度 | |
| 1167 | + lineWidth = 0; | |
| 1168 | + lastSubStrIndex = i; | |
| 1169 | + titleHeight += 20; | |
| 1170 | + } | |
| 1171 | + if (i == str.length - 1) { //绘制剩余部分 | |
| 1172 | + ctx.fillText(str.substring(lastSubStrIndex, i + 1), leftWidth, initHeight); | |
| 1173 | + } | |
| 1174 | + }; | |
| 1175 | + }, | |
| 1079 | 1176 | |
| 1080 | 1177 | |
| 1081 | 1178 | }); | ... | ... | 
packageC/pages/presell/cart/juchi_part.wxml
| 1 | 1 | <!-- 锯齿 --> | 
| 2 | 2 | <view class="circle-frame abs"> | 
| 3 | - <view class='circle circle-sawtooth'></view> | |
| 4 | - <view class='circle circle-sawtooth'></view> | |
| 5 | - <view class='circle circle-sawtooth'></view> | |
| 6 | - <view class='circle circle-sawtooth'></view> | |
| 7 | - <view class='circle circle-sawtooth'></view> | |
| 8 | - <view class='circle circle-sawtooth'></view> | |
| 9 | - <view class='circle circle-sawtooth'></view> | |
| 10 | - <view class='circle circle-sawtooth'></view> | |
| 11 | - <view class='circle circle-sawtooth'></view> | |
| 12 | - <view class='circle circle-sawtooth'></view> | |
| 13 | - <view class='circle circle-sawtooth'></view> | |
| 14 | - <view class='circle circle-sawtooth'></view> | |
| 15 | - <view class='circle circle-sawtooth'></view> | |
| 16 | - <view class='circle circle-sawtooth'></view> | |
| 17 | - <view class='circle circle-sawtooth'></view> | |
| 18 | - <view class='circle circle-sawtooth'></view> | |
| 19 | - <view class='circle circle-sawtooth'></view> | |
| 20 | - <view class='circle circle-sawtooth'></view> | |
| 21 | - <view class='circle circle-sawtooth'></view> | |
| 22 | - <view class='circle circle-sawtooth'></view> | |
| 3 | + <view wx:for="{{20}}" class='circle circle-sawtooth'></view> | |
| 23 | 4 | </view> | 
| 24 | 5 | \ No newline at end of file | ... | ... | 
pages/cart/cart2/juchi_part.wxml
| 1 | 1 | <!-- 锯齿 --> | 
| 2 | 2 | <view class="circle-frame abs"> | 
| 3 | - <view class='circle circle-sawtooth'></view> | |
| 4 | - <view class='circle circle-sawtooth'></view> | |
| 5 | - <view class='circle circle-sawtooth'></view> | |
| 6 | - <view class='circle circle-sawtooth'></view> | |
| 7 | - <view class='circle circle-sawtooth'></view> | |
| 8 | - <view class='circle circle-sawtooth'></view> | |
| 9 | - <view class='circle circle-sawtooth'></view> | |
| 10 | - <view class='circle circle-sawtooth'></view> | |
| 11 | - <view class='circle circle-sawtooth'></view> | |
| 12 | - <view class='circle circle-sawtooth'></view> | |
| 13 | - <view class='circle circle-sawtooth'></view> | |
| 14 | - <view class='circle circle-sawtooth'></view> | |
| 15 | - <view class='circle circle-sawtooth'></view> | |
| 16 | - <view class='circle circle-sawtooth'></view> | |
| 17 | - <view class='circle circle-sawtooth'></view> | |
| 18 | - <view class='circle circle-sawtooth'></view> | |
| 19 | - <view class='circle circle-sawtooth'></view> | |
| 20 | - <view class='circle circle-sawtooth'></view> | |
| 21 | - <view class='circle circle-sawtooth'></view> | |
| 22 | - <view class='circle circle-sawtooth'></view> | |
| 3 | + <view wx:for="{{20}}" class='circle circle-sawtooth'></view> | |
| 23 | 4 | </view> | 
| 24 | 5 | \ No newline at end of file | ... | ... | 
pages/giftpack/giftpacklist/giftpacklist.js
| ... | ... | @@ -1100,7 +1100,7 @@ Page({ | 
| 1100 | 1100 | // 8.商品标题 | 
| 1101 | 1101 | context.setFontSize(20 * unit); | 
| 1102 | 1102 | context.setFillStyle('#898989'); | 
| 1103 | - this.draw_Text(context, this.data.giftTitle, 54 * unit, 800 * unit, 240 * unit, 280 * unit, unit, 1); | |
| 1103 | + getApp().draw_Text(context, this.data.giftTitle, 54 * unit, 800 * unit, 240 * unit, 280 * unit, unit, 1); | |
| 1104 | 1104 | |
| 1105 | 1105 | // 9.小程序码 | 
| 1106 | 1106 | context.drawImage(vpath, 375 * unit, 660 * unit, 120 * unit, 120 * unit); | 
| ... | ... | @@ -1115,37 +1115,6 @@ Page({ | 
| 1115 | 1115 | context.fill(); | 
| 1116 | 1116 | }, | 
| 1117 | 1117 | |
| 1118 | - //文本换行 参数:1、canvas对象,2、文本 3、距离左侧的距离 4、距离顶部的距离 5、6、文本的宽度 | |
| 1119 | - draw_Text: function (ctx, str, leftWidth, initHeight, titleHeight, canvasWidth, unit, lineNum) { | |
| 1120 | - var lineWidth = 0; | |
| 1121 | - var lastSubStrIndex = 0; //每次开始截取的字符串的索引 | |
| 1122 | - var han = 0; | |
| 1123 | - for (let i = 0; i < str.length; i++) { | |
| 1124 | - if(lineNum) { | |
| 1125 | - if(han == lineNum) return; | |
| 1126 | - }; | |
| 1127 | - if (han == 2) return; | |
| 1128 | - //lineWidth += ctx.measureText(str[i]).width; | |
| 1129 | - lineWidth += ut.measureText(str[i], 21.3 * unit); | |
| 1130 | - if (lineWidth > canvasWidth) { | |
| 1131 | - han++; | |
| 1132 | - | |
| 1133 | - if (han == 2 || han == lineNum) | |
| 1134 | - ctx.fillText(str.substring(lastSubStrIndex, i) + '...', leftWidth, initHeight); //绘制截取部分 | |
| 1135 | - else | |
| 1136 | - ctx.fillText(str.substring(lastSubStrIndex, i), leftWidth, initHeight); | |
| 1137 | - | |
| 1138 | - initHeight += 22; //22为字体的高度 | |
| 1139 | - lineWidth = 0; | |
| 1140 | - lastSubStrIndex = i; | |
| 1141 | - titleHeight += 20; | |
| 1142 | - } | |
| 1143 | - if (i == str.length - 1) { //绘制剩余部分 | |
| 1144 | - ctx.fillText(str.substring(lastSubStrIndex, i + 1), leftWidth, initHeight); | |
| 1145 | - } | |
| 1146 | - }; | |
| 1147 | - }, | |
| 1148 | - | |
| 1149 | 1118 | //--获取商品图片的本地缓存,回调写法-- | 
| 1150 | 1119 | get_goods_temp: function (tt) { | 
| 1151 | 1120 | var ee = this; | 
| ... | ... | @@ -1174,101 +1143,11 @@ Page({ | 
| 1174 | 1143 | showPoster: false, | 
| 1175 | 1144 | }); | 
| 1176 | 1145 | }, | 
| 1177 | - | |
| 1178 | 1146 | // 保存图片到手机 | 
| 1179 | 1147 | savePic() { | 
| 1180 | - console.log('保存图片'); | |
| 1181 | - var self = this; | |
| 1182 | - // 获取用户的当前设置,返回值中有小程序已经向用户请求过的权限 | |
| 1183 | - this.getSetting().then((res) => { | |
| 1184 | - // 判断用户是否授权了保存到相册的权限,如果没有发起授权 | |
| 1185 | - if (!res.authSetting['scope.writePhotosAlbum']) { | |
| 1186 | - this.authorize().then(() => { | |
| 1187 | - // 同意授权后保存下载文件 | |
| 1188 | - this.saveImage(self.data.shareImgPath) | |
| 1189 | - .then(() => { | |
| 1190 | - self.setData({ | |
| 1191 | - showPoster: false | |
| 1192 | - }); | |
| 1193 | - }); | |
| 1194 | - }) | |
| 1195 | - } else { | |
| 1196 | - // 如果已经授权,保存下载文件 | |
| 1197 | - this.saveImage(self.data.shareImgPath) | |
| 1198 | - .then(() => { | |
| 1199 | - self.setData({ | |
| 1200 | - showPoster: false | |
| 1201 | - }); | |
| 1202 | - }); | |
| 1203 | - } | |
| 1204 | - | |
| 1205 | - }) | |
| 1148 | + getApp().savePic(this); | |
| 1206 | 1149 | }, | 
| 1207 | 1150 | |
| 1208 | - // 获取用户已经授予了哪些权限 | |
| 1209 | - getSetting() { | |
| 1210 | - return new Promise((resolve, reject) => { | |
| 1211 | - wx.getSetting({ | |
| 1212 | - success: res => { | |
| 1213 | - resolve(res) | |
| 1214 | - } | |
| 1215 | - }) | |
| 1216 | - }) | |
| 1217 | - }, | |
| 1218 | - // 发起首次授权请求 | |
| 1219 | - authorize() { | |
| 1220 | - // isFirst 用来记录是否为首次发起授权, | |
| 1221 | - // 如果首次授权拒绝后,isFirst赋值为1 | |
| 1222 | - let isFirst = wx.getStorageSync('isFirst') || 0; | |
| 1223 | - return new Promise((resolve, reject) => { | |
| 1224 | - wx.authorize({ | |
| 1225 | - scope: 'scope.writePhotosAlbum', | |
| 1226 | - // 同意授权 | |
| 1227 | - success: () => { | |
| 1228 | - resolve(); | |
| 1229 | - }, | |
| 1230 | - // 拒绝授权,这里是用户拒绝授权后的回调 | |
| 1231 | - fail: res => { | |
| 1232 | - if (isFirst === 0) { | |
| 1233 | - wx.setStorageSync('isFirst', 1); | |
| 1234 | - wx.showToast({ | |
| 1235 | - title: '保存失败', | |
| 1236 | - icon: 'none', | |
| 1237 | - duration: 1000 | |
| 1238 | - }) | |
| 1239 | - } else { | |
| 1240 | - this.showModal(); | |
| 1241 | - } | |
| 1242 | - console.log('拒绝授权'); | |
| 1243 | - reject(); | |
| 1244 | - } | |
| 1245 | - }) | |
| 1246 | - }) | |
| 1247 | - }, | |
| 1248 | - // 保存图片到系统相册 | |
| 1249 | - saveImage(saveUrl) { | |
| 1250 | - var self = this; | |
| 1251 | - return new Promise((resolve, reject) => { | |
| 1252 | - wx.saveImageToPhotosAlbum({ | |
| 1253 | - filePath: saveUrl, | |
| 1254 | - success: (res) => { | |
| 1255 | - wx.showToast({ | |
| 1256 | - title: '保存成功', | |
| 1257 | - duration: 1000, | |
| 1258 | - }); | |
| 1259 | - self.setData({ | |
| 1260 | - showPlaybill: 'true' | |
| 1261 | - }); | |
| 1262 | - resolve(); | |
| 1263 | - }, | |
| 1264 | - fail: () => { | |
| 1265 | - wx.showToast({ | |
| 1266 | - title: '保存失败', | |
| 1267 | - duration: 1000, | |
| 1268 | - }); | |
| 1269 | - } | |
| 1270 | - }) | |
| 1271 | - }) | |
| 1272 | - }, | |
| 1151 | + | |
| 1273 | 1152 | |
| 1274 | 1153 | }); | 
| 1275 | 1154 | \ No newline at end of file | ... | ... | 
pages/goods/goodsInfo/buy_pt.wxml
| ... | ... | @@ -98,16 +98,6 @@ | 
| 98 | 98 | |
| 99 | 99 | |
| 100 | 100 | <view> | 
| 101 | - <!--<view bindtap="getmendian" class="quhuo logistics-item" hidden="{{ismend==1}}">--> | |
| 102 | - <!--<view wx:if="{{sto_sele_name==''}}">取货门店--> | |
| 103 | - <!--<text class='small'>(选择门店)</text>--> | |
| 104 | - <!--</view>--> | |
| 105 | - <!--<view wx:else>{{sto_sele_name}}</view>--> | |
| 106 | - <!--<view class="item-img">--> | |
| 107 | - <!--<image class="wh100" src="{{iurl}}/miniapp/images/icon-arrowdown.png"></image>--> | |
| 108 | - <!--</view>--> | |
| 109 | - <!--</view>--> | |
| 110 | - | |
| 111 | 101 | |
| 112 | 102 | <view class="b_num" hidden="{{ismend==1}}" style="margin-top: 20rpx"> | 
| 113 | 103 | <view>购买数量</view> | ... | ... | 
pages/goods/goodsInfo/goodsInfo.js
| ... | ... | @@ -596,7 +596,7 @@ Page({ | 
| 596 | 596 | icon: 'none', | 
| 597 | 597 | }); | 
| 598 | 598 | } | 
| 599 | - ; | |
| 599 | + | |
| 600 | 600 | if (plist && plist.CanOutQty - lock > 0) { | 
| 601 | 601 | ee.CanOutQty = plist.CanOutQty - lock; | 
| 602 | 602 | } else { | 
| ... | ... | @@ -1031,7 +1031,6 @@ Page({ | 
| 1031 | 1031 | |
| 1032 | 1032 | setTimeout(()=>{ | 
| 1033 | 1033 | wx.createSelectorQuery().selectAll(".showArea, .hideArea").boundingClientRect(res => { | 
| 1034 | - // console.log('node@@@@@@@', res); | |
| 1035 | 1034 | if(res.length != 0) { | 
| 1036 | 1035 | this.setData({ | 
| 1037 | 1036 | showFold: res[0].height < res[1].height, | 
| ... | ... | @@ -4651,10 +4650,6 @@ Page({ | 
| 4651 | 4650 | if (this.data.is_go_to_team_show) return false; | 
| 4652 | 4651 | this.data.is_go_to_team_show = 1; | 
| 4653 | 4652 | wx.showLoading(); | 
| 4654 | - /*-- | |
| 4655 | - wx.redirectTo({ | |
| 4656 | - url: "/pages/team/team_success/team_success?ordersn=" + odr.order_sn, | |
| 4657 | - });--*/ | |
| 4658 | 4653 | |
| 4659 | 4654 | getApp().goto("/pages/team/team_success/team_success?ordersn=" + odr.order_sn); | 
| 4660 | 4655 | |
| ... | ... | @@ -4806,12 +4801,7 @@ Page({ | 
| 4806 | 4801 | } | 
| 4807 | 4802 | quan_list[ind].start = start; | 
| 4808 | 4803 | quan_list[ind].end = end; | 
| 4809 | - // var start = ut.formatTime(ep.use_start_time, "yyyy-MM-dd"); | |
| 4810 | - // var end = ut.formatTime(ep.use_end_time, "yyyy-MM-dd"); | |
| 4811 | - // start = start.replace("00:00:00", ""); | |
| 4812 | - // end = end.replace("00:00:00", ""); | |
| 4813 | - // quan_list[ind].start = start; | |
| 4814 | - // quan_list[ind].end = end; | |
| 4804 | + | |
| 4815 | 4805 | } | 
| 4816 | 4806 | } | 
| 4817 | 4807 | |
| ... | ... | @@ -5013,24 +5003,10 @@ Page({ | 
| 5013 | 5003 | |
| 5014 | 5004 | }; | 
| 5015 | 5005 | |
| 5016 | - //---市场价划掉--- | |
| 5017 | - /*--- | |
| 5018 | - context.setFillStyle("gray") | |
| 5019 | - context.setFontSize(22 * unit) | |
| 5020 | - var pri0 = "¥" + this.data.data.market_price.toFixed(2); | |
| 5021 | - var wd2 = this.data.screenWidth - ut.measureText(pri0, 22 * unit) - 25; | |
| 5022 | - context.fillText(pri0, 54 * unit, 770 * unit); | |
| 5023 | - | |
| 5024 | - context.setStrokeStyle('gray'); | |
| 5025 | - context.setLineWidth(1 * unit); | |
| 5026 | - context.moveTo(54 * unit, 763 * unit); | |
| 5027 | - context.lineTo(ut.measureText(pri0, 22 * unit) + 50, 763 * unit); | |
| 5028 | - context.stroke();--*/ | |
| 5029 | - | |
| 5030 | 5006 | // 8.商品标题 | 
| 5031 | 5007 | context.setFontSize(20 * unit); | 
| 5032 | 5008 | context.setFillStyle('#898989'); | 
| 5033 | - this.draw_Text(context, this.data.data.goods_name, 54 * unit, 800 * unit, 240 * unit, 280 * unit, unit, 1); | |
| 5009 | + getApp().draw_Text(context, this.data.data.goods_name, 54 * unit, 800 * unit, 240 * unit, 280 * unit, unit, 1); | |
| 5034 | 5010 | |
| 5035 | 5011 | // 9.小程序码 | 
| 5036 | 5012 | context.drawImage(vpath, 375 * unit, 660 * unit, 120 * unit, 120 * unit); | 
| ... | ... | @@ -5185,7 +5161,7 @@ Page({ | 
| 5185 | 5161 | if (type != 4 && type != 0 && type != 1 && type != 2 && type != 3) { | 
| 5186 | 5162 | context.setFillStyle("black"); | 
| 5187 | 5163 | context.setFontSize(21.3 * unit) | 
| 5188 | - th.draw_Text(context, share_title, | |
| 5164 | + getApp().draw_Text(context, share_title, | |
| 5189 | 5165 | 38 * unit, 180 * unit, 200 * unit, 279 * unit, unit); | 
| 5190 | 5166 | |
| 5191 | 5167 | //------产品的价格------- | 
| ... | ... | @@ -5222,7 +5198,7 @@ Page({ | 
| 5222 | 5198 | } else if (type == 4 && type != 0 && type != 1 && type != 2 && type != 3) { | 
| 5223 | 5199 | context.setFillStyle("black"); | 
| 5224 | 5200 | context.setFontSize(21.3 * unit) | 
| 5225 | - th.draw_Text(context, share_title, | |
| 5201 | + getApp().draw_Text(context, share_title, | |
| 5226 | 5202 | 38 * unit, 170 * unit, 20 * unit, 300 * unit, unit); | 
| 5227 | 5203 | //------ 产品的价格 ----- | 
| 5228 | 5204 | var pri0 = th.data.prom_act.addmoney; | 
| ... | ... | @@ -5443,13 +5419,7 @@ Page({ | 
| 5443 | 5419 | context.fillText("满" + item.rynum + "人", 40 * unit + wi, 786 * unit); | 
| 5444 | 5420 | } | 
| 5445 | 5421 | //----------------下面部分---------------- | 
| 5446 | - // context.setFillStyle("gray") | |
| 5447 | - // context.fillText("快来和我一起拼团吧!", 40 * unit, 830 * unit); | |
| 5448 | - // context.setFillStyle("black") | |
| 5449 | - // context.font = 'normal bold 18px sans-serif'; | |
| 5450 | - // context.setFontSize(22 * unit) | |
| 5451 | - // context.fillText("长按识别二维码,立即参团", 40 * unit, 860 * unit); | |
| 5452 | - //context.setFillStyle("gray") | |
| 5422 | + | |
| 5453 | 5423 | context.setFillStyle("black") | 
| 5454 | 5424 | context.fillText("快来和我一起拼团吧!", 40 * unit, 820 * unit); | 
| 5455 | 5425 | //context.font = 'normal bold 18px sans-serif'; | 
| ... | ... | @@ -5577,10 +5547,6 @@ Page({ | 
| 5577 | 5547 | return false; | 
| 5578 | 5548 | } | 
| 5579 | 5549 | |
| 5580 | - // wx.previewImage({ | |
| 5581 | - // //将图片预览出来 | |
| 5582 | - // urls: [that.data.shareImgPath] | |
| 5583 | - // }); | |
| 5584 | 5550 | that.setData({ | 
| 5585 | 5551 | showPoster: true, | 
| 5586 | 5552 | }); | 
| ... | ... | @@ -5601,37 +5567,6 @@ Page({ | 
| 5601 | 5567 | }, | 
| 5602 | 5568 | |
| 5603 | 5569 | |
| 5604 | - //文本换行 参数:1、canvas对象,2、文本 3、距离左侧的距离 4、距离顶部的距离 5、6、文本的宽度 | |
| 5605 | - draw_Text: function (ctx, str, leftWidth, initHeight, titleHeight, canvasWidth, unit, lineNum) { | |
| 5606 | - var lineWidth = 0; | |
| 5607 | - var lastSubStrIndex = 0; //每次开始截取的字符串的索引 | |
| 5608 | - var han = 0; | |
| 5609 | - for (let i = 0; i < str.length; i++) { | |
| 5610 | - if(lineNum) { | |
| 5611 | - if(han == lineNum) return; | |
| 5612 | - }; | |
| 5613 | - if (han == 2) return; | |
| 5614 | - //lineWidth += ctx.measureText(str[i]).width; | |
| 5615 | - lineWidth += ut.measureText(str[i], 21.3 * unit); | |
| 5616 | - if (lineWidth > canvasWidth) { | |
| 5617 | - han++; | |
| 5618 | - | |
| 5619 | - if (han == 2 || han == lineNum) | |
| 5620 | - ctx.fillText(str.substring(lastSubStrIndex, i) + '...', leftWidth, initHeight); //绘制截取部分 | |
| 5621 | - else | |
| 5622 | - ctx.fillText(str.substring(lastSubStrIndex, i), leftWidth, initHeight); | |
| 5623 | - | |
| 5624 | - initHeight += 22; //22为字体的高度 | |
| 5625 | - lineWidth = 0; | |
| 5626 | - lastSubStrIndex = i; | |
| 5627 | - titleHeight += 20; | |
| 5628 | - } | |
| 5629 | - if (i == str.length - 1) { //绘制剩余部分 | |
| 5630 | - ctx.fillText(str.substring(lastSubStrIndex, i + 1), leftWidth, initHeight); | |
| 5631 | - } | |
| 5632 | - }; | |
| 5633 | - }, | |
| 5634 | - | |
| 5635 | 5570 | // ----视频图片---- | 
| 5636 | 5571 | // 图片计数器 | 
| 5637 | 5572 | swiperChange: function (e) { | 
| ... | ... | @@ -6024,7 +5959,6 @@ Page({ | 
| 6024 | 5959 | title: item.pickup_name + '库存不足!', | 
| 6025 | 5960 | icon: 'none', | 
| 6026 | 5961 | }); | 
| 6027 | - // getApp().my_warnning(item.pickup_name + "库存不足!", 0, th); | |
| 6028 | 5962 | |
| 6029 | 5963 | } | 
| 6030 | 5964 | }, | 
| ... | ... | @@ -6101,33 +6035,6 @@ Page({ | 
| 6101 | 6035 | break | 
| 6102 | 6036 | } | 
| 6103 | 6037 | |
| 6104 | - /*-- | |
| 6105 | - if (openindstore == 1) { | |
| 6106 | - th.setData({ | |
| 6107 | - openSpecModal: !0, | |
| 6108 | - openSpecModal_ind: openindstore, | |
| 6109 | - }); | |
| 6110 | - } else if (openindstore == 2) { | |
| 6111 | - th.setData({ | |
| 6112 | - openSpecModal: !0, | |
| 6113 | - openSpecModal_ind: openindstore, | |
| 6114 | - }); | |
| 6115 | - } | |
| 6116 | - else if (openindstore == 4) { //4就是拼团 | |
| 6117 | - th.setData({ | |
| 6118 | - openSpecModal_pt: 1, //打开拼团购买界面 | |
| 6119 | - store: 0, //关闭门店 | |
| 6120 | - choice_sort_store: 0, //关闭门店2级 | |
| 6121 | - sort_store: 0, //关闭门店2级 | |
| 6122 | - }); | |
| 6123 | - } | |
| 6124 | - else { | |
| 6125 | - th.setData({ | |
| 6126 | - store: 0, | |
| 6127 | - choice_sort_store: 0, | |
| 6128 | - sort_store: 0 | |
| 6129 | - }) | |
| 6130 | - }--*/ | |
| 6131 | 6038 | //如果商品没有其他活动,要取一下线下价格 | 
| 6132 | 6039 | th.get_off_price(); | 
| 6133 | 6040 | }) | 
| ... | ... | @@ -6487,103 +6394,10 @@ Page({ | 
| 6487 | 6394 | |
| 6488 | 6395 | // 保存图片到手机 | 
| 6489 | 6396 | savePic() { | 
| 6490 | - console.log('保存图片'); | |
| 6491 | - var self = this; | |
| 6492 | - // 获取用户的当前设置,返回值中有小程序已经向用户请求过的权限 | |
| 6493 | - this.getSetting().then((res) => { | |
| 6494 | - // 判断用户是否授权了保存到相册的权限,如果没有发起授权 | |
| 6495 | - if (!res.authSetting['scope.writePhotosAlbum']) { | |
| 6496 | - this.authorize().then(() => { | |
| 6497 | - // 同意授权后保存下载文件 | |
| 6498 | - this.saveImage(self.data.shareImgPath) | |
| 6499 | - .then(() => { | |
| 6500 | - self.setData({ | |
| 6501 | - showPoster: false | |
| 6502 | - }); | |
| 6503 | - }); | |
| 6504 | - }) | |
| 6505 | - } else { | |
| 6506 | - // 如果已经授权,保存下载文件 | |
| 6507 | - this.saveImage(self.data.shareImgPath) | |
| 6508 | - .then(() => { | |
| 6509 | - self.setData({ | |
| 6510 | - showPoster: false | |
| 6511 | - }); | |
| 6512 | - }); | |
| 6513 | - } | |
| 6514 | - | |
| 6515 | - }) | |
| 6516 | - }, | |
| 6517 | - | |
| 6518 | - // 获取用户已经授予了哪些权限 | |
| 6519 | - getSetting() { | |
| 6520 | - return new Promise((resolve, reject) => { | |
| 6521 | - wx.getSetting({ | |
| 6522 | - success: res => { | |
| 6523 | - resolve(res) | |
| 6524 | - } | |
| 6525 | - }) | |
| 6526 | - }) | |
| 6527 | - }, | |
| 6528 | - | |
| 6529 | - // 发起首次授权请求 | |
| 6530 | - authorize() { | |
| 6531 | - // isFirst 用来记录是否为首次发起授权, | |
| 6532 | - // 如果首次授权拒绝后,isFirst赋值为1 | |
| 6533 | - let isFirst = wx.getStorageSync('isFirst') || 0; | |
| 6534 | - return new Promise((resolve, reject) => { | |
| 6535 | - wx.authorize({ | |
| 6536 | - scope: 'scope.writePhotosAlbum', | |
| 6537 | - // 同意授权 | |
| 6538 | - success: () => { | |
| 6539 | - resolve(); | |
| 6540 | - }, | |
| 6541 | - // 拒绝授权,这里是用户拒绝授权后的回调 | |
| 6542 | - fail: res => { | |
| 6543 | - if (isFirst === 0) { | |
| 6544 | - wx.setStorageSync('isFirst', 1); | |
| 6545 | - wx.showToast({ | |
| 6546 | - title: '保存失败', | |
| 6547 | - icon: 'none', | |
| 6548 | - duration: 1000 | |
| 6549 | - }) | |
| 6550 | - } else { | |
| 6551 | - this.showModal(); | |
| 6552 | - } | |
| 6553 | - console.log('拒绝授权'); | |
| 6554 | - reject(); | |
| 6555 | - } | |
| 6556 | - }) | |
| 6557 | - }) | |
| 6397 | + getApp().savePic(this); | |
| 6558 | 6398 | }, | 
| 6559 | 6399 | |
| 6560 | 6400 | |
| 6561 | - // 保存图片到系统相册 | |
| 6562 | - saveImage(saveUrl) { | |
| 6563 | - var self = this; | |
| 6564 | - return new Promise((resolve, reject) => { | |
| 6565 | - wx.saveImageToPhotosAlbum({ | |
| 6566 | - filePath: saveUrl, | |
| 6567 | - success: (res) => { | |
| 6568 | - wx.showToast({ | |
| 6569 | - title: '保存成功', | |
| 6570 | - duration: 1000, | |
| 6571 | - }); | |
| 6572 | - self.setData({ | |
| 6573 | - showPlaybill: 'true' | |
| 6574 | - }); | |
| 6575 | - resolve(); | |
| 6576 | - }, | |
| 6577 | - fail: () => { | |
| 6578 | - wx.showToast({ | |
| 6579 | - title: '保存失败', | |
| 6580 | - duration: 1000, | |
| 6581 | - }); | |
| 6582 | - } | |
| 6583 | - }) | |
| 6584 | - }) | |
| 6585 | - }, | |
| 6586 | - | |
| 6587 | 6401 | previewImage(e) { | 
| 6588 | 6402 | this.data.show_prew_img = 1; | 
| 6589 | 6403 | getApp().pre_img(this.data.sele_g.original_img); | ... | ... | 
pages/payment/pay_success/pay_success.json
pages/template/index.js
| ... | ... | @@ -92,21 +92,10 @@ Page({ | 
| 92 | 92 | |
| 93 | 93 | }, | 
| 94 | 94 | |
| 95 | - | |
| 96 | 95 | onPullDownRefresh: function(e) { | 
| 97 | 96 | |
| 98 | 97 | }, | 
| 99 | - onUnload: function() { | |
| 100 | - | |
| 101 | - }, | |
| 102 | - setCountTime: function(e) { | |
| 103 | - | |
| 104 | - }, | |
| 105 | - | |
| 106 | 98 | |
| 107 | - onPageScroll: function(e) { | |
| 108 | - | |
| 109 | - }, | |
| 110 | 99 | |
| 111 | 100 | onShareAppMessage:async function(e) { | 
| 112 | 101 | getApp().globalData.no_clear=1; | ... | ... | 
pages/user/address_list/address_list.js
| ... | ... | @@ -110,21 +110,12 @@ Page({ | 
| 110 | 110 | data: { user_id: oo.user_id, is_pickup: 0 }, | 
| 111 | 111 | isShowLoading:0, | 
| 112 | 112 | success: function (s) { | 
| 113 | - // var add_arr = th.data.addresses; | |
| 114 | - // for (var i in add_arr){ | |
| 115 | - // add_arr[i].is_pickup=0; | |
| 116 | - // } | |
| 117 | - // th.setData({addresses:add_arr}); | |
| 118 | 113 | |
| 119 | 114 | a.is_pickup = 1; | 
| 120 | 115 | t.put("/api/weshop/useraddress/updateById", { | 
| 121 | 116 | data: a, | 
| 122 | 117 | isShowLoading: 0, | 
| 123 | 118 | success: function (s) { | 
| 124 | - // var obj={}; | |
| 125 | - // var txt = "addresses[" + index +"].is_pickup"; | |
| 126 | - // obj[txt]=1; | |
| 127 | - // th.setData(obj); | |
| 128 | 119 | |
| 129 | 120 | th.data.isloading=0 | 
| 130 | 121 | if (th.data.is_back) { | ... | ... | 
pages/user/assistance/assistance_success.js
pages/user/assistance/friend_assistance.js
pages/user/assistance/task_assistance.js
| ... | ... | @@ -135,14 +135,6 @@ Page({ | 
| 135 | 135 | }, | 
| 136 | 136 | |
| 137 | 137 | |
| 138 | - | |
| 139 | - /** | |
| 140 | - * 生命周期函数--监听页面初次渲染完成 | |
| 141 | - */ | |
| 142 | - onReady: function () { | |
| 143 | - | |
| 144 | - }, | |
| 145 | - | |
| 146 | 138 | /** | 
| 147 | 139 | * 生命周期函数--监听页面显示 | 
| 148 | 140 | */ | 
| ... | ... | @@ -243,10 +235,6 @@ Page({ | 
| 243 | 235 | } | 
| 244 | 236 | }) | 
| 245 | 237 | |
| 246 | - // 分享的 | |
| 247 | - // setTimeout(function() { | |
| 248 | - // th.shareFrends(); | |
| 249 | - // }, 1000) | |
| 250 | 238 | |
| 251 | 239 | //会员任务列表 | 
| 252 | 240 | this.user_task_list(); | 
| ... | ... | @@ -601,19 +589,6 @@ Page({ | 
| 601 | 589 | clearInterval(this.data.timer); | 
| 602 | 590 | }, | 
| 603 | 591 | |
| 604 | - /** | |
| 605 | - * 生命周期函数--监听页面卸载 | |
| 606 | - */ | |
| 607 | - onUnload: function () { | |
| 608 | - | |
| 609 | - }, | |
| 610 | - | |
| 611 | - /** | |
| 612 | - * 页面相关事件处理函数--监听用户下拉动作 | |
| 613 | - */ | |
| 614 | - onPullDownRefresh: function () { | |
| 615 | - | |
| 616 | - }, | |
| 617 | 592 | //----助力任务的时间----- | 
| 618 | 593 | countDown() { | 
| 619 | 594 | if (!this.data.is_timer) return false; | 
| ... | ... | @@ -661,12 +636,7 @@ Page({ | 
| 661 | 636 | return param < 10 ? '0' + param : param; | 
| 662 | 637 | }, | 
| 663 | 638 | |
| 664 | - /** | |
| 665 | - * 页面上拉触底事件的处理函数 | |
| 666 | - */ | |
| 667 | - onReachBottom: function () { | |
| 668 | 639 | |
| 669 | - }, | |
| 670 | 640 | |
| 671 | 641 | /** | 
| 672 | 642 | * 用户点击右上角分享 | 
| ... | ... | @@ -1091,22 +1061,7 @@ Page({ | 
| 1091 | 1061 | getApp().goto("/pages/test/zhuli_test?taskId="+task_id); | 
| 1092 | 1062 | }, | 
| 1093 | 1063 | |
| 1094 | - | |
| 1095 | - // imgH:function(e){ | |
| 1096 | - | |
| 1097 | - // var winWid = wx.getSystemInfoSync().windowWidth; //获取当前屏幕的宽度 | |
| 1098 | - // var imgh = e.detail.height; //图片高度 | |
| 1099 | - // var imgw = e.detail.width; | |
| 1100 | - // var swiperH = winWid*0.827*imgh/imgw + "px" //等比设置swiper的高度。 即 屏幕宽度 / swiper高度 = 图片宽度 / 图片高度 ==》swiper高度 = 屏幕宽度 * 图片高度 / 图片宽度 | |
| 1101 | - // console.log('imgload',winWid, imgh, imgw, swiperH); | |
| 1102 | - // this.setData({ | |
| 1103 | - // Hei:swiperH //设置高度 | |
| 1104 | - // }) | |
| 1105 | - | |
| 1106 | - // imgs | |
| 1107 | - // }, | |
| 1108 | - | |
| 1109 | - | |
| 1064 | + | |
| 1110 | 1065 | imageLoad: function(e) { | 
| 1111 | 1066 | var winWid = wx.getSystemInfoSync().windowWidth; | 
| 1112 | 1067 | var imgwidth = e.detail.width; | ... | ... | 
pages/user/cardinfo/cardinfo.js
| ... | ... | @@ -691,26 +691,7 @@ Page({ | 
| 691 | 691 | |
| 692 | 692 | }, | 
| 693 | 693 | |
| 694 | - /** | |
| 695 | - * 生命周期函数--监听页面隐藏 | |
| 696 | - */ | |
| 697 | - onHide: function () { | |
| 698 | - | |
| 699 | - }, | |
| 700 | - | |
| 701 | - /** | |
| 702 | - * 生命周期函数--监听页面卸载 | |
| 703 | - */ | |
| 704 | - onUnload: function () { | |
| 705 | 694 | |
| 706 | - }, | |
| 707 | - | |
| 708 | - /** | |
| 709 | - * 页面相关事件处理函数--监听用户下拉动作 | |
| 710 | - */ | |
| 711 | - onPullDownRefresh: function () { | |
| 712 | - | |
| 713 | - }, | |
| 714 | 695 | |
| 715 | 696 | /** | 
| 716 | 697 | * 页面上拉触底事件的处理函数 | ... | ... | 
