Compare commits

...

121 Commits

Author SHA1 Message Date
Enzo 5902d68d4e 提现图片显示 5 years ago
Enzo bd57197ef0 优化 5 years ago
Enzo a112814826 商品详情 多规格样式优化 5 years ago
Enzo f24ed161d3 Merge branch 'new' into threedate 5 years ago
邓平艺 c32bc0c011 [优化] 联系客服页面 5 years ago
邓平艺 1e7018f40b [优化] 邀请成为分销达人页面优化没有图片时的处理 5 years ago
邓平艺 e704e98d7f [优化] 首页在没有tab的情况下的优化 5 years ago
Enzo c8692b7463 三期多规格购买 5 years ago
Enzo 7ad4cbfab5 三期商品购买 5 years ago
邓平艺 c93613717a [完善] 首页分享绑定 5 years ago
Enzo aa99c12f02 三期规格选择 5 years ago
邓平艺 2ce9f2d29b [优化] 商品详情页分享小程序卡片也要触发绑定关系 5 years ago
Enzo 7f19095138 动态获取会员价格 5 years ago
Enzo 4d56667c70 Merge branch 'new' of http://8.134.10.79:3000/Leadfyy.co/uniapp-shikongwang into new 5 years ago
Enzo da6553943f 钱包提现图片显示 5 years ago
邓平艺 f49df35baf Merge branch 'new' of http://8.134.10.79:3000/Leadfyy.co/uniapp-shikongwang into new 5 years ago
邓平艺 27cb44f097 优化商品详情页生成海报 5 years ago
Enzo 314c04a32f Merge branch 'new' of http://8.134.10.79:3000/Leadfyy.co/uniapp-shikongwang into new 5 years ago
Enzo 4bec2aebf5 商品自付钱 5 years ago
邓平艺 8f7e4a73a2 Merge branch 'new' of http://8.134.10.79:3000/Leadfyy.co/uniapp-shikongwang into new 5 years ago
邓平艺 14f0ef096f [优化] 商品详情页生成海报高度 5 years ago
Enzo b325c8a585 粉丝列表时间优化 5 years ago
邓平艺 71b873f4f2 [优化] 商品详情页保存到相册按钮优化层级 5 years ago
Enzo b064851b42 Merge branch 'new' of http://8.134.10.79:3000/Leadfyy.co/uniapp-shikongwang into new 5 years ago
Enzo ac09a2a8d4 海报提示 5 years ago
邓平艺 4628b8d13b 优化商品详情页代码 5 years ago
Enzo cb9fe5739f 商品详情海报生成 5 years ago
邓平艺 6652ce1dc9 优化商品详情页生成海报 5 years ago
Enzo 705257c30c Merge branch 'new' of http://8.134.10.79:3000/Leadfyy.co/uniapp-shikongwang into new 5 years ago
Enzo 35fa766a98 商品详情 5 years ago
邓平艺 c9a542dabd [优化] 生成token多传入用户id 5 years ago
邓平艺 e447f06522 Merge branch 'new' of http://8.134.10.79:3000/Leadfyy.co/uniapp-shikongwang into new 5 years ago
邓平艺 be704c0c26 [新增] 场景值 5 years ago
Enzo 1226ca54a7 Merge branch 'new' of http://8.134.10.79:3000/Leadfyy.co/uniapp-shikongwang into new 5 years ago
Enzo 28aa770a9b 钱包记录优化 邀请达人海报生成优化 5 years ago
邓平艺 b486598b6e Merge branch 'new' of http://8.134.10.79:3000/Leadfyy.co/uniapp-shikongwang into new 5 years ago
邓平艺 9216539f37 [修改] 页面分享参数改成使用token的形式 5 years ago
Enzo 370d35b3e9 海报层级样式 5 years ago
Enzo ea4ee8bdbf 提现接口完成 5 years ago
Enzo de29d69374 Merge branch 'new' of http://8.134.10.79:3000/Leadfyy.co/uniapp-shikongwang into new 5 years ago
Enzo ed227cb9fb 提现优化 5 years ago
邓平艺 86d16ed10a Merge branch 'new' of http://8.134.10.79:3000/Leadfyy.co/uniapp-shikongwang into new 5 years ago
邓平艺 b80374285d [优化] 商品详情页吸底层级优化 5 years ago
Enzo b71e6e3252 提现 5 years ago
Enzo 0b434a1502 提现接口完成 5 years ago
Enzo 598aaf2757 邀请达人海报优化 5 years ago
Enzo 7d5ed7d65e Merge branch 'new' of http://8.134.10.79:3000/Leadfyy.co/uniapp-shikongwang into new 5 years ago
Enzo 093de95c18 提现参数获取 5 years ago
邓平艺 2e173c1a0e Merge branch 'new' of http://8.134.10.79:3000/Leadfyy.co/uniapp-shikongwang into new 5 years ago
邓平艺 a1566fd8b1 [优化] 商品详情页跳转增加参数 5 years ago
Enzo 8f00aafd77 钱包优化 商品海报 5 years ago
Enzo 39bb728f1d Merge branch 'new' of http://8.134.10.79:3000/Leadfyy.co/uniapp-shikongwang into new 5 years ago
Enzo d74564cfa0 商品海报 5 years ago
邓平艺 131f2d371a Merge branch 'new' of http://8.134.10.79:3000/Leadfyy.co/uniapp-shikongwang into new 5 years ago
邓平艺 d3fb0a647a [优化] 商品详情页生成海报 5 years ago
Enzo b72ab285e7 海报设计 5 years ago
邓平艺 36815edf28 Merge branch 'new' of http://8.134.10.79:3000/Leadfyy.co/uniapp-shikongwang into new 5 years ago
邓平艺 dac3922c42 [优化] 路由分发成为分销达人传参 5 years ago
Enzo bbe9dbd71f Merge branch 'new' of http://8.134.10.79:3000/Leadfyy.co/uniapp-shikongwang into new 5 years ago
Enzo 75dfb1593d 商品海报 5 years ago
邓平艺 43967ee831 [优化] 商品详情页吸底层级BUG 5 years ago
Enzo 350e9ef733 分享海报优化 5 years ago
Enzo 343ca3c53e Merge branch 'dev' into new 5 years ago
Enzo 3203a966f6 钱包优化 提现 5 years ago
Enzo 02636da593 钱包余额优化 5 years ago
Enzo 75a2bc99ca 二期海报分享 5 years ago
Enzo f744b89193 支付接口修改 海报分享二维码接口修改 充值会员接口 支付结果逻辑修改 5 years ago
Enzo be1cc91439 用户详情绑定关系 商品海报绑定关系 5 years ago
Enzo 9a35e4b45d 邀请成为分销达人 5 years ago
Enzo f40771edab Merge branch 'twodate' of http://8.134.10.79:3000/Leadfyy.co/uniapp-shikongwang into twodate 5 years ago
Enzo 9088bfd6af 钱包余额 佣金记录 提取记录接口(提取记录接口待后端优化) 5 years ago
邓平艺 d0e15db403 [优化] 提取佣金页面样式 5 years ago
邓平艺 4c3df84af3 [优化] 成为分销达人页面UI 5 years ago
邓平艺 30871f32f6 [优化] 我的钱包页面,部分手机UI兼容性问题 5 years ago
邓平艺 53cd02aa10 Merge branch 'twodate' of http://8.134.10.79:3000/Leadfyy.co/uniapp-shikongwang into twodate 5 years ago
邓平艺 5e6be42ce4 [修改] 首页商品列表抢购0%进度条也显示 5 years ago
Enzo bd0cebd18c 粉丝列表下拉加载优化 5 years ago
Enzo 0ab03d0ea1 Merge branch 'twodate' of http://8.134.10.79:3000/Leadfyy.co/uniapp-shikongwang into twodate 5 years ago
Enzo 06d26dcd02 商品海报二维码 邀请成为分销达人二维码 成为分销达人页面 5 years ago
邓平艺 059a80ba7b [优化] 我的钱包页面UI 5 years ago
邓平艺 a7e34bc4ca [完善] 商品详情路由分发 5 years ago
Enzo 221544b4e5 Merge branch 'twodate' of http://8.134.10.79:3000/Leadfyy.co/uniapp-shikongwang into twodate 5 years ago
Enzo 093a2d31a7 微信小程序太阳码生成 5 years ago
邓平艺 727b095ed0 [优化] 粉丝列表页面获取手机屏幕可用高度问题 5 years ago
邓平艺 adb72805be [优化] 粉丝列表页面 5 years ago
邓平艺 1a1171910e Merge branch 'twodate' of http://8.134.10.79:3000/Leadfyy.co/uniapp-shikongwang into twodate 5 years ago
邓平艺 6caa56808c [优化] 首页没有tabs的情况,提示 5 years ago
Enzo 0a808134d1 列表相关页面下拉刷新上拉加载添加 5 years ago
邓平艺 144cc8d94a [优化] 路由分发页,兼容扫描小程序码进入小程序的情况 5 years ago
邓平艺 31d98fae2d [新增] 申请退款页面增加已输入的字数显示 5 years ago
Enzo 07715e8a38 粉丝页面 我的钱包 提现页面 邀请好友 我的页面 5 years ago
Enzo 1149e3bc1b 正式域名添加 5 years ago
Enzo 7e1d101f1b 提取佣金 我的钱包页面 5 years ago
Enzo e280c86a56 二期我的钱包页面 5 years ago
Enzo 578eb62230 二期我的页面 5 years ago
Enzo ff6cf6f7f9 二期海报 5 years ago
Enzo d7789e10da 二期海报 5 years ago
Enzo 23eed81642 Haibao二期 5 years ago
邓平艺 ec82b0f78c [优化] 商品详情页库存剩余判断显示,大于100份就不显示 5 years ago
邓平艺 c9d912ad93 [添加] 个人中心页面添加虚拟id判断显示 5 years ago
邓平艺 860bc38f7b 修改万能校验函数 5 years ago
Enzo b9c043c249 二期海报修改 5 years ago
Enzo 815b4a9ae1 二维码海报 5 years ago
Enzo bdea625d67 二期海报 5 years ago
Enzo 62ac8d5b43 订单列表 返回数组置空 5 years ago
Enzo e107cb2433 Merge branch 'dev' of http://8.134.10.79:3000/Leadfyy.co/uniapp-shikongwang into dev 5 years ago
Enzo 4a25180e9c 商品样式修改 订单限购 5 years ago
邓平艺 4f47a26e6c [修复] 列表页面滚动BUG 5 years ago
Enzo 7b1272af8c 二期海报 5 years ago
邓平艺 f04c709629 [优化] 商品详情页打开地图 5 years ago
邓平艺 a6138f70f9 [修复] uview框架的tabs组件,切换tab的bug 5 years ago
Enzo 831b841ac0 Merge branch 'dev' of http://8.134.10.79:3000/Leadfyy.co/uniapp-shikongwang into dev 5 years ago
Enzo c014b2ac49 商品详情图片优化 5 years ago
邓平艺 c014ad381e [优化] 商家订单列表增加滑动页面切换tab的能力 5 years ago
邓平艺 81c242febe Merge branch 'dev' of http://8.134.10.79:3000/Leadfyy.co/uniapp-shikongwang into dev 5 years ago
邓平艺 3fe0724e19 [优化] 首页滑动切换tab多请求了一次接口 5 years ago
Enzo 1515212190 商家图标样式修改/我的收藏商家图标大小调整 5 years ago
Enzo 9b3c6cc1a2 Merge branch 'dev' of http://8.134.10.79:3000/Leadfyy.co/uniapp-shikongwang into dev 5 years ago
Enzo 536aeb3e0c 1收藏页面爱心下面添加文字2 菜单的协议颜色统一 商品详情页地图跳转 5 years ago
邓平艺 6bb13c3c94 [新增] 全局获取手机信息的方法,并导出屏幕各个部位可用高度 5 years ago
Enzo 1997a3ec80 【优化】 个人中心电话样式修改 订单状态按钮修改 支付状态按钮修改 订单和首页图片显示格式修改 5 years ago
  1. 30
      App.vue
  2. 27
      common/api.js
  3. 8
      common/http.js
  4. 5
      common/scene.js
  5. 187
      common/shareMD5.js
  6. 34
      common/shared.js
  7. 10
      common/styles/iconfont.css
  8. 3
      main.js
  9. 2
      manifest.json
  10. 47
      pages.json
  11. 350
      pages/bill/bill.vue
  12. 175
      pages/center/bestar.vue
  13. 124
      pages/center/fans.vue
  14. 52
      pages/center/index.vue
  15. 359
      pages/center/invite.vue
  16. 281
      pages/center/wallet.vue
  17. 158
      pages/center/widthdraw.vue
  18. 33
      pages/collect/index.vue
  19. 12
      pages/contactService/index.vue
  20. 692
      pages/goodsDetail/index.vue
  21. 201
      pages/index/index.vue
  22. 6
      pages/login/index.vue
  23. 4
      pages/order/apply-details.vue
  24. 25
      pages/order/apply-refund.vue
  25. 6
      pages/order/confirm-atonce.vue
  26. 58
      pages/order/confirm-order.vue
  27. 206
      pages/order/index.vue
  28. 10
      pages/order/order-details.vue
  29. 16
      pages/order/pay-success.vue
  30. 3
      pages/order/unpay-details.vue
  31. 76
      pages/route/index - 副本.vue
  32. 47
      pages/route/index.vue
  33. 144
      pages/shopOrder/index.vue
  34. BIN
      static/center/fans.png
  35. BIN
      static/center/invite.png
  36. BIN
      static/center/wallet.png
  37. BIN
      static/images/bill.png
  38. BIN
      static/images/poster-1.jpg
  39. 6
      uview-ui/components/u-tabs/u-tabs.vue

30
App.vue

@ -1,10 +1,16 @@
<script>
export default {
globalData: {
wxlogin: () => {}
wxlogin: () => {}, //
screenWidth: 0, //
statusBarH: 0, //
screenHeight: 0, //
customBarH: 0, //
windowHeight: 0, // -
},
onLaunch: function() {
this.disableConsole();
this.getSystemInfo();
this.getUserInfo();
},
onShow: function() {
@ -13,6 +19,28 @@
// #endif
},
methods: {
//
getSystemInfo(){
let res = uni.getSystemInfoSync();
this.globalData.screenWidth = res.screenWidth;
this.globalData.statusBarH = res.statusBarHeight;
this.globalData.screenHeight = res.screenHeight;
this.globalData.customBarH = res.statusBarHeight + 45;
this.globalData.windowHeight = res.windowHeight - (res.statusBarHeight - 20);
// #ifdef MP
setTimeout(() => {
let custom = uni.getMenuButtonBoundingClientRect()
this.globalData.customBarH = custom.bottom + custom.top - res.statusBarHeight;
if (this.globalData.customBarH <= 0) {
this.globalData.customBarH = 40 + this.globalData.statusBarH;
}
}, 30);
// #endif
// #ifdef MP-ALIPAY
this.globalData.customBarH = res.statusBarHeight + res.titleBarHeight;
// #endif
},
//
getUserInfo(){
this.globalData.wxlogin = this.wxlogin;

27
common/api.js

@ -2,13 +2,14 @@
export const DEV = "dev"; // dev 测试 | prod 正式
export const VERSION = '1.0.0'; // 版本号
export const DEVURL = 'https://gxsky.lanzulive.com'; // 测试服请求地址
// export const DEVURL = 'http://192.168.3.8'; // 测试服请求地址, 韦港电脑
export const PRODURL = ''; // 正式服请求地址
// export const DEVURL = 'http://192.168.3.23'; // 测试服请求地址, 韦港电脑
export const PRODURL = 'https://mall.gxsky.com'; // 正式服请求地址
/* 首页相关接口 */
export const API_CATEGORY_LIST = '/api/category/list'; // 首页-分类
export const API_GOODS_LIST = '/api/goods/list'; // 首页-分类下商品列表
export const API_SHARE_HOME = '/api/share/home'; // 首页分享信息
export const API_SALESMAN_BINDALL = '/api/salesman/bindAll'; // 点击链接就可以被绑定
// 用户订单
export const API_USERORDER = '/api/order/list';
@ -57,6 +58,26 @@ export const API_WECHAT_SETPHONE = '/api/wechat/setPhone'; // 用户授权手机
export const API_WECHAT_SETPROFILE = '/api/wechat/setProfile'; // 用户授权微信信息提交(返回用户信息)
export const API_WXLOGIN_VIEW = '/api/wxlogin/view'; // 获取登录页协议
export const API_ARTICLE_DETAIL = '/api/article/detail'; // 协议文章详情
export const API_WXCODE = '/api/salesman/qrcode'//小程序二维码
export const API_INCOMELIST = '/api/salesman/income'//获取佣金记录
export const API_EXTRACTLIST = '/api/salesman/extract'//获取提取记录
export const API_FANS = '/api/salesman/fans'//获取粉丝列表
export const API_BINDGOODS = '/api/salesman/share'//商品海报分享绑定
export const API_BINDSALES = '/api/salesman/shareMan'//分销海报分享绑定
export const API_BILLBACKGROUND = '/api/share/img'//海报背景图接口
export const API_WXBILL = '/api/salesman/qrcode'//微信小程序太阳码
export const API_MEMBERPRICE = '/api/getSetting'//会员价格
/* 商户相关 */
export const API_CONFIRM_CODE = '/api/confirm/code'; // 扫码核销
export const API_CONFIRM_CODE = '/api/confirm/code'; // 扫码核销
export const API_WIDTHDRAW = '/api/income/extract'; // 提现
export const API_WIDTHDRAWIMG = '/api/share/img'; // 提现图片
/* token相关 */
export const API_WAREHOUSE_SET = '/api/warehouse/set'; // 存储token
export const API_WAREHOUSE_GET = '/api/warehouse/get'; // 获取token

8
common/http.js

@ -18,8 +18,12 @@ function getsign(params) {
arr.push(k + '=' + v);
}
s_data = arr.join('&');
let sign = sha1(SparkMD5.hash(s_data) + 'lanzu@123');
//测试
// let sign = sha1(SparkMD5.hash(s_data) + 'lanzu@123');
//正式
let sign = sha1(SparkMD5.hash(s_data) + 'base64:8oVqQuUYKI+Fg2iPP1VZwqTbMvpphc/oqhU5+Hzul+4=');
params.sign = sign;
return params;
}

5
common/scene.js

@ -0,0 +1,5 @@
// 分享相关场景值
export const V2_GOODS_SHAREBUTTON = "101";
export const V2_GOODS_SHAREPOSTER = "102";
export const V2_HOME_SHAREBUTTON = "103";
export const V2_INVITE_SHAREPOSTER = "104";

187
common/shareMD5.js

@ -0,0 +1,187 @@
// 源出处:https://blog.csdn.net/lijia_yong/article/details/111641251
export function md5(string,bit) {
function md5_RotateLeft(lValue, iShiftBits) {
return (lValue << iShiftBits) | (lValue >>> (32 - iShiftBits));
}
function md5_AddUnsigned(lX, lY) {
var lX4, lY4, lX8, lY8, lResult;
lX8 = (lX & 0x80000000);
lY8 = (lY & 0x80000000);
lX4 = (lX & 0x40000000);
lY4 = (lY & 0x40000000);
lResult = (lX & 0x3FFFFFFF) + (lY & 0x3FFFFFFF);
if (lX4 & lY4) {
return (lResult ^ 0x80000000 ^ lX8 ^ lY8);
}
if (lX4 | lY4) {
if (lResult & 0x40000000) {
return (lResult ^ 0xC0000000 ^ lX8 ^ lY8);
} else {
return (lResult ^ 0x40000000 ^ lX8 ^ lY8);
}
} else {
return (lResult ^ lX8 ^ lY8);
}
}
function md5_F(x, y, z) {
return (x & y) | ((~x) & z);
}
function md5_G(x, y, z) {
return (x & z) | (y & (~z));
}
function md5_H(x, y, z) {
return (x ^ y ^ z);
}
function md5_I(x, y, z) {
return (y ^ (x | (~z)));
}
function md5_FF(a, b, c, d, x, s, ac) {
a = md5_AddUnsigned(a, md5_AddUnsigned(md5_AddUnsigned(md5_F(b, c, d), x), ac));
return md5_AddUnsigned(md5_RotateLeft(a, s), b);
};
function md5_GG(a, b, c, d, x, s, ac) {
a = md5_AddUnsigned(a, md5_AddUnsigned(md5_AddUnsigned(md5_G(b, c, d), x), ac));
return md5_AddUnsigned(md5_RotateLeft(a, s), b);
};
function md5_HH(a, b, c, d, x, s, ac) {
a = md5_AddUnsigned(a, md5_AddUnsigned(md5_AddUnsigned(md5_H(b, c, d), x), ac));
return md5_AddUnsigned(md5_RotateLeft(a, s), b);
};
function md5_II(a, b, c, d, x, s, ac) {
a = md5_AddUnsigned(a, md5_AddUnsigned(md5_AddUnsigned(md5_I(b, c, d), x), ac));
return md5_AddUnsigned(md5_RotateLeft(a, s), b);
};
function md5_ConvertToWordArray(string) {
var lWordCount;
var lMessageLength = string.length;
var lNumberOfWords_temp1 = lMessageLength + 8;
var lNumberOfWords_temp2 = (lNumberOfWords_temp1 - (lNumberOfWords_temp1 % 64)) / 64;
var lNumberOfWords = (lNumberOfWords_temp2 + 1) * 16;
var lWordArray = Array(lNumberOfWords - 1);
var lBytePosition = 0;
var lByteCount = 0;
while (lByteCount < lMessageLength) {
lWordCount = (lByteCount - (lByteCount % 4)) / 4;
lBytePosition = (lByteCount % 4) * 8;
lWordArray[lWordCount] = (lWordArray[lWordCount] | (string.charCodeAt(lByteCount) << lBytePosition));
lByteCount++;
}
lWordCount = (lByteCount - (lByteCount % 4)) / 4;
lBytePosition = (lByteCount % 4) * 8;
lWordArray[lWordCount] = lWordArray[lWordCount] | (0x80 << lBytePosition);
lWordArray[lNumberOfWords - 2] = lMessageLength << 3;
lWordArray[lNumberOfWords - 1] = lMessageLength >>> 29;
return lWordArray;
};
function md5_WordToHex(lValue) {
var WordToHexValue = "", WordToHexValue_temp = "", lByte, lCount;
for (lCount = 0; lCount <= 3; lCount++) {
lByte = (lValue >>> (lCount * 8)) & 255;
WordToHexValue_temp = "0" + lByte.toString(16);
WordToHexValue = WordToHexValue + WordToHexValue_temp.substr(WordToHexValue_temp.length - 2, 2);
}
return WordToHexValue;
};
function md5_Utf8Encode(string) {
string = string.replace(/\r\n/g, "\n");
var utftext = "";
for (var n = 0; n < string.length; n++) {
var c = string.charCodeAt(n);
if (c < 128) {
utftext += String.fromCharCode(c);
} else if ((c > 127) && (c < 2048)) {
utftext += String.fromCharCode((c >> 6) | 192);
utftext += String.fromCharCode((c & 63) | 128);
} else {
utftext += String.fromCharCode((c >> 12) | 224);
utftext += String.fromCharCode(((c >> 6) & 63) | 128);
utftext += String.fromCharCode((c & 63) | 128);
}
}
return utftext;
};
var x = Array();
var k, AA, BB, CC, DD, a, b, c, d;
var S11 = 7, S12 = 12, S13 = 17, S14 = 22;
var S21 = 5, S22 = 9, S23 = 14, S24 = 20;
var S31 = 4, S32 = 11, S33 = 16, S34 = 23;
var S41 = 6, S42 = 10, S43 = 15, S44 = 21;
string = md5_Utf8Encode(string);
x = md5_ConvertToWordArray(string);
a = 0x67452301; b = 0xEFCDAB89; c = 0x98BADCFE; d = 0x10325476;
for (k = 0; k < x.length; k += 16) {
AA = a; BB = b; CC = c; DD = d;
a = md5_FF(a, b, c, d, x[k + 0], S11, 0xD76AA478);
d = md5_FF(d, a, b, c, x[k + 1], S12, 0xE8C7B756);
c = md5_FF(c, d, a, b, x[k + 2], S13, 0x242070DB);
b = md5_FF(b, c, d, a, x[k + 3], S14, 0xC1BDCEEE);
a = md5_FF(a, b, c, d, x[k + 4], S11, 0xF57C0FAF);
d = md5_FF(d, a, b, c, x[k + 5], S12, 0x4787C62A);
c = md5_FF(c, d, a, b, x[k + 6], S13, 0xA8304613);
b = md5_FF(b, c, d, a, x[k + 7], S14, 0xFD469501);
a = md5_FF(a, b, c, d, x[k + 8], S11, 0x698098D8);
d = md5_FF(d, a, b, c, x[k + 9], S12, 0x8B44F7AF);
c = md5_FF(c, d, a, b, x[k + 10], S13, 0xFFFF5BB1);
b = md5_FF(b, c, d, a, x[k + 11], S14, 0x895CD7BE);
a = md5_FF(a, b, c, d, x[k + 12], S11, 0x6B901122);
d = md5_FF(d, a, b, c, x[k + 13], S12, 0xFD987193);
c = md5_FF(c, d, a, b, x[k + 14], S13, 0xA679438E);
b = md5_FF(b, c, d, a, x[k + 15], S14, 0x49B40821);
a = md5_GG(a, b, c, d, x[k + 1], S21, 0xF61E2562);
d = md5_GG(d, a, b, c, x[k + 6], S22, 0xC040B340);
c = md5_GG(c, d, a, b, x[k + 11], S23, 0x265E5A51);
b = md5_GG(b, c, d, a, x[k + 0], S24, 0xE9B6C7AA);
a = md5_GG(a, b, c, d, x[k + 5], S21, 0xD62F105D);
d = md5_GG(d, a, b, c, x[k + 10], S22, 0x2441453);
c = md5_GG(c, d, a, b, x[k + 15], S23, 0xD8A1E681);
b = md5_GG(b, c, d, a, x[k + 4], S24, 0xE7D3FBC8);
a = md5_GG(a, b, c, d, x[k + 9], S21, 0x21E1CDE6);
d = md5_GG(d, a, b, c, x[k + 14], S22, 0xC33707D6);
c = md5_GG(c, d, a, b, x[k + 3], S23, 0xF4D50D87);
b = md5_GG(b, c, d, a, x[k + 8], S24, 0x455A14ED);
a = md5_GG(a, b, c, d, x[k + 13], S21, 0xA9E3E905);
d = md5_GG(d, a, b, c, x[k + 2], S22, 0xFCEFA3F8);
c = md5_GG(c, d, a, b, x[k + 7], S23, 0x676F02D9);
b = md5_GG(b, c, d, a, x[k + 12], S24, 0x8D2A4C8A);
a = md5_HH(a, b, c, d, x[k + 5], S31, 0xFFFA3942);
d = md5_HH(d, a, b, c, x[k + 8], S32, 0x8771F681);
c = md5_HH(c, d, a, b, x[k + 11], S33, 0x6D9D6122);
b = md5_HH(b, c, d, a, x[k + 14], S34, 0xFDE5380C);
a = md5_HH(a, b, c, d, x[k + 1], S31, 0xA4BEEA44);
d = md5_HH(d, a, b, c, x[k + 4], S32, 0x4BDECFA9);
c = md5_HH(c, d, a, b, x[k + 7], S33, 0xF6BB4B60);
b = md5_HH(b, c, d, a, x[k + 10], S34, 0xBEBFBC70);
a = md5_HH(a, b, c, d, x[k + 13], S31, 0x289B7EC6);
d = md5_HH(d, a, b, c, x[k + 0], S32, 0xEAA127FA);
c = md5_HH(c, d, a, b, x[k + 3], S33, 0xD4EF3085);
b = md5_HH(b, c, d, a, x[k + 6], S34, 0x4881D05);
a = md5_HH(a, b, c, d, x[k + 9], S31, 0xD9D4D039);
d = md5_HH(d, a, b, c, x[k + 12], S32, 0xE6DB99E5);
c = md5_HH(c, d, a, b, x[k + 15], S33, 0x1FA27CF8);
b = md5_HH(b, c, d, a, x[k + 2], S34, 0xC4AC5665);
a = md5_II(a, b, c, d, x[k + 0], S41, 0xF4292244);
d = md5_II(d, a, b, c, x[k + 7], S42, 0x432AFF97);
c = md5_II(c, d, a, b, x[k + 14], S43, 0xAB9423A7);
b = md5_II(b, c, d, a, x[k + 5], S44, 0xFC93A039);
a = md5_II(a, b, c, d, x[k + 12], S41, 0x655B59C3);
d = md5_II(d, a, b, c, x[k + 3], S42, 0x8F0CCC92);
c = md5_II(c, d, a, b, x[k + 10], S43, 0xFFEFF47D);
b = md5_II(b, c, d, a, x[k + 1], S44, 0x85845DD1);
a = md5_II(a, b, c, d, x[k + 8], S41, 0x6FA87E4F);
d = md5_II(d, a, b, c, x[k + 15], S42, 0xFE2CE6E0);
c = md5_II(c, d, a, b, x[k + 6], S43, 0xA3014314);
b = md5_II(b, c, d, a, x[k + 13], S44, 0x4E0811A1);
a = md5_II(a, b, c, d, x[k + 4], S41, 0xF7537E82);
d = md5_II(d, a, b, c, x[k + 11], S42, 0xBD3AF235);
c = md5_II(c, d, a, b, x[k + 2], S43, 0x2AD7D2BB);
b = md5_II(b, c, d, a, x[k + 9], S44, 0xEB86D391);
a = md5_AddUnsigned(a, AA);
b = md5_AddUnsigned(b, BB);
c = md5_AddUnsigned(c, CC);
d = md5_AddUnsigned(d, DD);
}
if(bit==32){
return (md5_WordToHex(a) + md5_WordToHex(b) + md5_WordToHex(c) + md5_WordToHex(d)).toLowerCase();
}
return (md5_WordToHex(b) + md5_WordToHex(c)).toLowerCase();
}

34
common/shared.js

@ -1,6 +1,7 @@
/*
全局共享实用方法 shared.js
*/
let shareMD5 = require("./shareMD5.js"); // 签名加密js文件
// 判断对错/是否显示,万能校验
export function isRight(obj) {
@ -11,6 +12,8 @@ export function isRight(obj) {
}
} else if (isValueType(obj) === 'number' && (isValueType(obj) === "number" && !isNaN(obj)) && obj !== 0) {
return true;
} else if (isValueType(obj) === 'boolean') {
return obj
}
for (var key in obj) {
return true;
@ -22,4 +25,35 @@ export function isRight(obj) {
export function isValueType(value) {
let str = Object.prototype.toString.call(value);
return str.match(/\[object (.*?)\]/)[1].toLowerCase();
}
// 生成随机唯一token
export function createToken(par = {}){
const date = new Date(); // 获取时间对象
let fullYear = date.getFullYear(); // 年
let month = String(date.getMonth() + 1); // 月
month = fillZero(month);
let getdate = String(date.getDate()); // 日
getdate = fillZero(getdate);
let hours = String(date.getHours()); // 时
hours = fillZero(hours);
let minutes = String(date.getMinutes()); // 分
minutes = fillZero(minutes);
let seconds = String(date.getSeconds()); // 秒
seconds = fillZero(seconds);
let randomStr = Math.random().toString(32).substr(2); // 随机字符串
let tmp = `${fullYear}/${month}/${getdate} ${hours}:${minutes}:${seconds} ${randomStr}`;
for(let i in par){
tmp += par[i];
}
let token = shareMD5.md5(tmp, 16);
return token;
}
//不足2位补0
export function fillZero(time) {
if (time <= 9) {
time = '0' + time;
}
return time;
}

10
common/styles/iconfont.css

@ -1,8 +1,8 @@
@font-face {
font-family: "lf-iconfont"; /* Project id 2631569 */
src: url('//at.alicdn.com/t/font_2631569_eny3iiapmkl.woff2?t=1625043087841') format('woff2'),
url('//at.alicdn.com/t/font_2631569_eny3iiapmkl.woff?t=1625043087841') format('woff'),
url('//at.alicdn.com/t/font_2631569_eny3iiapmkl.ttf?t=1625043087841') format('truetype');
src: url('//at.alicdn.com/t/font_2631569_seikzobrfas.woff2?t=1626243885395') format('woff2'),
url('//at.alicdn.com/t/font_2631569_seikzobrfas.woff?t=1626243885395') format('woff'),
url('//at.alicdn.com/t/font_2631569_seikzobrfas.ttf?t=1626243885395') format('truetype');
}
.lf-iconfont {
@ -13,6 +13,10 @@
-moz-osx-font-smoothing: grayscale;
}
.lf-icon-weixinzhifu:before {
content: "\e689";
}
.lf-icon-shuaxin1:before {
content: "\e6d2";
}

3
main.js

@ -2,6 +2,7 @@ import Vue from 'vue'
import App from './App'
import mixin from '@/common/mixin.js';
import * as API from '@/common/api.js';
import * as $scene from '@/common/scene.js';
import * as $shared from '@/common/shared.js';
import { uploadFile } from '@/common/uploadFile.js'
@ -12,6 +13,8 @@ Vue.mixin(mixin);
// 将API注入全局
Vue.prototype.API = API;
// 场景值
Vue.prototype.$scene = $scene;
// 全局共享方法
Vue.prototype.$shared = $shared;

2
manifest.json

@ -62,7 +62,7 @@
"quickapp" : {},
/* */
"mp-weixin" : {
"appid" : "wxb35ef055a4dd8ad4",
"appid" : "wx1031981885c80917",
"setting" : {
"urlCheck" : false,
"postcss" : true,

47
pages.json

@ -7,21 +7,30 @@
"path": "pages/index/index",
"style": {
"navigationBarTitleText": "首页",
"enablePullDownRefresh": true
"enablePullDownRefresh": false,
"disableScroll": true
}
},
{
"path": "pages/bill/bill",
"style": {
"navigationBarTitleText": "生成海报"
}
},
{
"path": "pages/order/index",
"style": {
"navigationBarTitleText": "我的订单",
"enablePullDownRefresh": true
"enablePullDownRefresh": false,
"disableScroll": true
}
},
{
"path": "pages/shopOrder/index",
"style": {
"navigationBarTitleText": "商户订单",
"enablePullDownRefresh": true
"enablePullDownRefresh": false,
"disableScroll": true
}
},
{
@ -84,6 +93,38 @@
"navigationBarTitleText": "我的"
}
},
{
"path": "pages/center/fans",
"style": {
"navigationBarTitleText": "粉丝列表",
"disableScroll": true
}
},
{
"path": "pages/center/invite",
"style": {
"navigationBarTitleText": "邀请成为分销达人"
}
},
{
"path": "pages/center/bestar",
"style": {
"navigationBarTitleText": "成为分销达人"
}
},
{
"path": "pages/center/widthdraw",
"style": {
"navigationBarTitleText": "提取佣金"
}
},
{
"path": "pages/center/wallet",
"style": {
"navigationBarTitleText": "我的钱包",
"disableScroll": true
}
},
{
"path": "pages/goodsDetail/index",
"style": {

350
pages/bill/bill.vue

@ -0,0 +1,350 @@
<template>
<view>
<button class='zfbtn m_l' @tap='formSubmit()'>
分享
</button>
<button class='zfbtn m_l' @tap='saveAvatar()'>
保存头像
</button>
<image :src="info.avatar" mode="aspectFill"></image>
<tki-qrcode v-if="info.avatar" ref="qrcode" @result="qrR" :val="checkArea" :size="115" unit="px" background="#fff"
foreground="#000" pdground="#000" :onval="true" :loadMake="true" :icon="info.avatar" />
<tki-qrcode v-else ref="qrcode" @result="qrR" :val="checkArea" :size="115" unit="px" background="#fff"
foreground="#000" pdground="#000" :onval="true" :loadMake="true" :icon="require('@/static/images/system/payfail.png')" />
<view class="canvas-box">
<canvas style="width: 375px;height: 667px;position:fixed;top:9999px" canvas-id="mycanvas" />
</view>
<view class='imagePathBox' v-if="maskHidden == true && imagePath" @click="maskHidden = false ">
<image :src="imagePath" class='shengcheng' mode="aspectFill"></image>
<button class='baocun' @click.stop="saveBill()">保存相册分享到朋友圈</button>
</view>
</view>
</template>
<script>
import tkiQrcode from "tki-qrcode"; //
export default {
components: {
tkiQrcode
},
data() {
return {
base64Img: '',
checkArea: 'Cannot find module',
inputValue: "",
maskHidden: false,
name: "kk",
info: {
avatar: '',
nickname: '',
id: '',
tel: '',
tags: []
},
showLogin: true,
imagePath: '',
userToken: ''
}
},
methods: {
saveAvatar() {
var that = this
console.log(that.info.avatar)
wx.saveImageToPhotosAlbum({
filePath: that.info.avatar,
success(res) {
wx.showModal({
content: '图片已保存到相册,赶紧晒一下吧~',
showCancel: false,
confirmText: '好的',
confirmColor: '#333',
success: function(res) {
if (res.confirm) {
console.log('用户点击确定');
that.maskHidden = false
}
},
fail: function(res) {
that.maskHidden = false
console.log(res)
}
})
},
fail(err) {
console.log(err)
}
})
},
qrR(data) {
this.base64Img = data;
console.log('base64',this.base64Img)
},
verifyUserInfo() {
let userInfo = uni.getStorageSync('userinfo') || {};
if (!userInfo.id || !userInfo.nickname || !userInfo.avatar) {
if (this.showLogin) {
this.showLogin = false;
this.$url('/pages/login/index?type=userinfo');
} else {
this.showLogin = true;
this.$url('/pages/index/index', {
type: 'switch'
});
}
}
},
getData() {
let userinfo = uni.getStorageSync('userinfo') || {};
if (userinfo) {
this.info = userinfo
console.log('用户数据缓存',this.info)
} else {
this.$http(this.API.API_USER_CENTER).then(res => {
this.info = res.data;
console.log('用户数据接口',this.info)
})
}
},
createNewImg() {
var that = this;
var context = wx.createCanvasContext('mycanvas');
var path = "../../static/images/poster-1.jpg";
context.drawImage(path, 0, 0, 375, 667);
//
context.drawImage(that.base64Img, 24, 530,120, 120);
//
// context.setFontSize(24);
// context.setFillStyle('#fff');
// context.setTextAlign('center');
// context.fillText(name, 34, 620);
context.stroke();
context.draw();
//
setTimeout(function() {
wx.canvasToTempFilePath({
canvasId: 'mycanvas',
success: function(res) {
that.imagePath = res.tempFilePath;
if(that.imagePath) {
that.canvasHidden = true
that.maskHidden = true
}
console.log('海报生成成功')
console.log(res)
console.log('图片链接', that.imagePath)
},
fail: function(res) {
console.log(res);
}
});
}, 200);
},
saveBill() {
var that = this
wx.saveImageToPhotosAlbum({
filePath: that.imagePath,
success(res) {
wx.showModal({
content: '图片已保存到相册,赶紧晒一下吧~',
showCancel: false,
confirmText: '好的',
confirmColor: '#333',
success: function(res) {
if (res.confirm) {
console.log('用户点击确定');
that.maskHidden = false
}
},
fail: function(res) {
that.maskHidden = false
}
})
}
})
},
formSubmit() {
var that = this;
wx.showToast({
title: '生成海报中...',
icon: 'loading',
duration: 1000
});
wx.hideToast()
that.createNewImg()
}
},
onLoad(options) {
this.qrcode = 'dadaa'
this.verifyUserInfo();
this.getData();
}
}
</script>
<style>
.bgImg {
display: block;
width: 100%;
height: 366rpx;
}
.mine {
display: block;
text-align: center;
color: #333;
margin-top: 44rpx;
}
.code {
display: block;
text-align: center;
color: #333;
font-size: 76rpx;
font-weight: bold;
margin-top: 30rpx;
}
.who {
display: block;
margin-top: 80rpx;
font-size: 32rpx;
color: #333;
text-align: center;
}
.inputBox {
text-align: center;
margin-top: 44rpx;
}
.input {
text-align: center;
width: 440rpx;
height: 88rpx;
border-radius: 44rpx;
background: #f5f5f5;
font-size: 32rpx;
display: inline-block;
}
.btn {
width: 160rpx;
height: 88rpx;
border-radius: 44rpx;
background: linear-gradient(90deg, rgba(255, 226, 0, 1), rgba(255, 200, 11, 1));
box-shadow: 0px 4px 8px 0px rgba(255, 200, 11, 0.5);
color: #333;
font-size: 32rpx;
display: inline-block;
line-height: 88rpx;
margin-left: 40rpx;
}
button[class="btn"]::after {
border: 0;
}
.tishi {
display: block;
text-align: center;
color: #999;
margin-top: 30rpx;
}
.shareText {
display: block;
text-align: center;
color: #333;
font-size: 28rpx;
margin-top: 100rpx;
}
.imgBox {
text-align: center;
width: 100%;
margin-top: 60rpx;
padding-bottom: 120rpx;
}
.img {
display: inline-block;
width: 100%;
height: 100%;
}
.m_l {
margin-left: 180rpx;
}
.zfbtn {
display: inline-block;
width: 120rpx;
height: 120rpx;
border-radius: 50%;
background: transparent;
outline: none;
border: 0;
padding: 0;
}
button[class="zfbtn"]::after {
border: 0;
}
button[class="zfbtn m_l"]::after {
border: 0;
}
.imagePathBox {
width: 100%;
height: 100%;
background: rgba(0, 0, 0, 0.7);
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
z-index: 10;
}
.shengcheng {
width: 80%;
height: 80%;
position: fixed;
top: 50rpx;
left: 50%;
margin-left: -40%;
z-index: 10;
}
.baocun {
display: block;
width: 80%;
height: 80rpx;
padding: 0;
line-height: 80rpx;
text-align: center;
position: fixed;
bottom: 50rpx;
left: 10%;
background: #ffe200;
color: #333;
font-size: 32rpx;
border-radius: 44rpx;
}
button[class="baocun"]::after {
border: 0;
}
</style>
}
</style>

175
pages/center/bestar.vue

@ -0,0 +1,175 @@
<template>
<view>
<view class="flex lf-p-30">
<view>
<image :src="info.avatar" style="height: 120rpx;width: 120rpx;border-radius: 50%;" mode="aspectFill"></image>
</view>
<view class="flex flex-direction lf-p-l-20 justify-center">
<view class="lf-font-32 lf-m-b-10 text-black1 lf-line-2">{{info.nickname}}</view>
<view class="lf-font-28 lf-color-gray" v-if="!info.isTalnet">会员未开通</view>
<view class="lf-font-28 lf-color-gray" v-else>会员已开通</view>
</view>
</view>
<self-line/>
<view>
<view class="lf-p-t-30 lf-p-l-32 lf-flex-wrap">
<view class="paynum" style="overflow: hidden;">
<view class="lf-color-white flex justify-center" style="background-color: #F93A3A;border-radius: 0 0 10rpx 0;width: 168rpx;height: 46rpx;">
<text class="lf-font-24" style="padding: 6rpx 12rpx;">成为分销达人</text>
</view>
<view class="lf-m-t-28 text-black lf-font-24 lf-m-l-20">
需要支付
</view>
<view class="lf-m-l-20 lf-m-t-16"><text class="lf-font-60 lf-font-bold">{{prcie || 0}}</text></view>
</view>
</view>
</view>
<view class="lf-p-l-32 lf-m-t-40 lf-font-32 text-black1 solid-bottom lf-p-b-20">
支付方式
</view>
<view class="flex justify-between align-center text-center lf-p-l-32 lf-p-r-32 lf-p-t-30 lf-p-b-30 solid-bottom">
<view class="flex justify-around align-center text-center">
<view class="lf-row-center">
<text class="lf-iconfont lf-icon-weixinzhifu lf-font-48" style="color: #09BB07;"></text>
</view>
<view class="lf-font-36 lf-m-l-20 lf-w-100 text-black1">微信支付</view>
</view>
<view>
<view>
<checkbox-group @change="checkboxChangepay" style="display: inline-block;">
<checkbox class="lf-text-vertical" style="" :checked="checkedpay"></checkbox>
</checkbox-group>
</view>
</view>
</view>
<view class="btn-bottom" style="bottom: 60rpx;">
<view class="padding-lr-lg lf-m-b-18" v-if="agreement">
<checkbox-group @change="checkboxChange" style="display: inline-block;">
<checkbox class="lf-text-vertical" style="" :checked="checked"></checkbox>
</checkbox-group>
<view class="lf-m-l-10 lf-font-24 lf-color-gray" style="display: inline-block;">
<text>已阅读并同意</text>
<text @click="enterAgree" class="text-orange">{{agreement.title}}</text>
</view>
</view>
<view class="padding-lr-lg">
<button class="cu-btn block bg-orange lg" style="border-radius: 42rpx;" @tap="subimitApply()">
<text class="lf-font-32 text-white">购买并支付¥{{prcie || 0}}</text>
</button>
</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
checked: false, //
info: {},
ifPay: true,
checkedpay: true,
agreement: '',
prcie: ''
}
},
methods: {
getPrice(){
this.$http(this.API.API_MEMBERPRICE).then(res => {
this.prcie = res.data.price || 0
})
},
//
checkboxChange(event){
this.checked = event.detail.value.length > 0;
},
//
checkboxChangepay(event){
this.checkedpay = event.detail.value.length > 0;
},
getAgree(){
this.$http(this.API.API_WXLOGIN_VIEW,{type: 'vip'}).then(res => {
this.agreement = res.data.agreement;
})
},
//
enterAgree(){
this.$url('/pages/agreement/agreement?id='+ this.agreement.article_id);
},
getData(){
this.$http(this.API.API_USER_CENTER).then(res => {
this.info = res.data;
})
},
subimitApply() {
if(!this.checkedpay) {
this.$msg('请选择付款方式!')
return
}
if(!this.checked) {
this.$msg('请认真阅读并同意协议!')
return
}
if(!this.ifPay) return;
this.ifPay = false;
this.$http(this.API.API_PRPAID, {
goods_id: 0,
goods_specs_id: 0,
number: 1,
payment_desc: 3,
share_one: this.info.id
}).then(res => {
this.order_id = res.data.order_id
uni.requestPayment({
orderInfo: res.data.order_num,
timeStamp: res.data.timeStamp,
nonceStr: res.data.nonceStr,
package: res.data.package,
signType: res.data.signType,
paySign: res.data.paySign,
success: (res) => {
this.ifPay = true
this.$url('/pages/order/pay-success?ifSuccess=1&type=3&order_id='+this.order_id,{type: 'redirect'})
},
fail: (err) => {
this.ifPay = true
this.$url('/pages/order/pay-success?ifSuccess=2&type=3&order_id='+this.order_id,{type: 'redirect'})
},
})
}).catch(err => {
this.ifPay = true
if(err.code == 9997) {
uni.showModal({
title: '提示',
content: '是否同意前往手机授权?',
success: e => {
if (!e.confirm) return;
this.$routerGo('/pages/login/index?type=phone')
}
});
}
});
}
},
onLoad() {
this.getData()
this.getAgree()
this.getPrice()
}
}
</script>
<style>
.paynum {
width: 280rpx;
height: 280rpx;
border: 1px solid #FE9903;
background-color: #FFF4E4;
border-radius: 10rpx;
}
</style>

124
pages/center/fans.vue

@ -0,0 +1,124 @@
<template>
<view>
<view class="bg-white lf-p-t-40 lf-p-b-40 flex justify-around align-center text-center solid-bottom">
<view class="tab-item"
:class="current==index?'text-orange':'text-black1'"
v-for="(item, index) in tab_list" :key="index"
@click="changeTab(index)">{{ item.name }}
</view>
</view>
<scroll-view :style="{height: 'calc('+ windowHeight +'px - 120rpx)'}"
:scroll-y="true" :refresher-enabled="true"
:refresher-triggered="isRefresher"
@scrolltolower="onScrolltolower"
@refresherrefresh="onRefresherrefresh"
v-for="(tabItem, tabIndex) in tab_list" :key="tabIndex"
v-if="tabIndex == current">
<view class="flex lf-p-30 solid-bottom" v-for="(item, index) in tabItem.list" :key="index">
<view>
<image :src="item.avatar" style="height: 120rpx;width: 120rpx;" mode="aspectFill"></image>
</view>
<view class="flex flex-direction justify-around lf-p-l-20">
<view class="lf-font-32 text-black1">{{item.username}} <text class="bg-red lf-font-24 lf-m-l-10" style="border-radius: 30rpx;padding: 5rpx 16rpx;">{{item.state}}</text></view>
<view class="lf-font-24 lf-color-gray">{{item.share_time || 0}}</view>
</view>
</view>
<!-- 空数据的情况 -->
<view class="loading-more">
<text v-if="tabItem.list.length" :class="{'loading-more-text': tabItem.loadingClass}">{{ tabItem.loadingText }}</text>
<my-nocontent v-else></my-nocontent>
</view>
</scroll-view>
</view>
</template>
<script>
export default {
data() {
return {
current: 0, // tab
pageSize: 10,
isRefresher: false, // scroll-view
windowHeight: 0,
tab_list: [{
name: '内部粉丝',
list: [],
page: 1,
isPage: false,
loadingClass: false,
loadingText: '已加载全部数据'
},{
name: '外部粉丝',
list: [],
page: 1,
isPage: false,
loadingClass: true,
loadingText: '正在加载中'
}]
}
},
onLoad(){
this.windowHeight = uni.getSystemInfoSync().windowHeight;
this.getInFans()
},
methods: {
changeTab(index) {
if(this.current == index) {
return
}else {
this.current = index
this.getInFans()
}
},
getInFans() {
let per_page = this.pageSize;
let tab_item = this.tab_list[this.current];
let fansType = this.current+1
this.$http(this.API.API_FANS, {
page: tab_item.page,
limit: per_page,
type: fansType
}).then(res => {
this.isRefresher = false;
let isPage = res.data.has_more_page;
tab_item.isPage = isPage;
if(!isPage){
tab_item.loadingClass = false;
tab_item.loadingText = '没有更多数据啦~';
}
if(tab_item.page == 1){
tab_item.list = res.data.items;
}else{
tab_item.list.push(...res.data.items);
}
})
},
//
onScrolltolower(){
let tab_item = this.tab_list[this.current];
if(tab_item.isPage){
tab_item.page = tab_item.page + 1;
this.getInFans()
}
},
// scroll-view
onRefresherrefresh(){
this.isRefresher = true;
this.getInFans()
}
}
}
</script>
<style lang="scss" scoped>
.tab-item{
width: 50%;
box-sizing: border-box;
font-size: 32rpx;
&:first-child{
border-right: 2rpx solid rgba(0, 0, 0, 0.1);
}
}
</style>

52
pages/center/index.vue

@ -9,8 +9,22 @@
<text class="user-label" v-for="(item, index) in info.tags" :key="index">{{ item }}</text>
</view>
<view class="lf-m-t-20 lf-font-28" style="color: #555555;">
<text>ID {{ info.id }}</text>
<text class="lf-m-l-30">{{ hidePhone(info.tel) }}</text>
<text class="lf-m-r-30" v-if="isRight(info.virtual_id)">ID {{ info.virtual_id }}</text>
<text>{{ hidePhone(info.tel) }}</text>
</view>
</view>
</view>
<view class="list">
<view class="lf-row-between list-item" hover-class="lf-opacity" @click="$url('/pages/center/wallet')">
<view class="lf-row-center">
<image class="icon-img" src="../../static/center/wallet.png"></image>
<text class="lf-text-vertical lf-m-l-20 lf-font-32">我的钱包</text>
</view>
<view class="flex">
<view class="lf-font-14 text-gray lf-m-r-10">
{{info.income || 0}}
</view>
<text class="lf-iconfont lf-icon-xiangyou-copy lf-color-gray lf-font-32"></text>
</view>
</view>
</view>
@ -24,6 +38,40 @@
<text class="lf-iconfont lf-icon-xiangyou-copy lf-color-gray lf-font-32"></text>
</view>
</view>
<view class="lf-row-between list-item" hover-class="lf-opacity" @click="$url('/pages/center/fans')">
<view class="lf-row-center">
<image class="icon-img" src="../../static/center/fans.png"></image>
<text class="lf-text-vertical lf-m-l-20 lf-font-32">粉丝列表</text>
</view>
<view>
<text class="lf-iconfont lf-icon-xiangyou-copy lf-color-gray lf-font-32"></text>
</view>
</view>
<view class="lf-row-between list-item" v-if="info.isTalnet" hover-class="lf-opacity" @click="$url('/pages/center/invite')">
<view class="lf-row-center">
<image class="icon-img" src="../../static/center/invite.png"></image>
<text class="lf-text-vertical lf-m-l-20 lf-font-32">邀请成为分销达人</text>
</view>
<view>
<text class="lf-iconfont lf-icon-xiangyou-copy lf-color-gray lf-font-32"></text>
</view>
</view>
<view class="lf-row-between list-item" v-else hover-class="lf-opacity" @click="$url('/pages/center/bestar')">
<view class="lf-row-center">
<image class="icon-img" src="../../static/center/invite.png"></image>
<text class="lf-text-vertical lf-m-l-20 lf-font-32">成为分销达人</text>
</view>
<view>
<text class="lf-iconfont lf-icon-xiangyou-copy lf-color-gray lf-font-32"></text>
</view>
</view>
</view>
<view class="list">
<view class="lf-row-between list-item" hover-class="lf-opacity" @click="$url('/pages/contactService/index')">
<view class="lf-row-center">
<image class="icon-img" src="../../static/center/service.png"></image>

359
pages/center/invite.vue

@ -0,0 +1,359 @@
<template>
<view>
<view class="flex justify-center lf-m-t-20">
<!-- <image src="../../static/images/bill.png" mode="widthFix" style="height: 1220rpx;width: 686rpx;"></image> -->
<image v-if="imagePath" :src="imagePath" mode="widthFix"></image>
</view>
<view class="canvas-box">
<canvas style="width: 375px;height: 600px;position:fixed;top:9999px" canvas-id="mycanvas" />
</view>
<view class="btn-bottom" style="bottom: 40rpx;">
<view class="padding-lr-lg">
<button class="cu-btn block bg-orange lg" style="border-radius: 42rpx;" @tap="saveBill()">
<text class="lf-font-32 text-white">保存</text>
</button>
</view>
<!-- <view class="flex justify-center align-center lf-m-t-30">
<view class="lf-color-gray lf-font-28">https//hbdsufiewhuifusikj.com</view>
<view class="lf-font-24 text-orange lf-m-l-30" @click="copy('https://hbdsufiewhuifusikj.com')">复制</view>
</view> -->
</view>
</view>
</template>
<script>
export default {
data() {
return {
base64Img: '',
checkArea: 'Cannot find module',
maskHidden: false,
info: {
avatar: '',
nickname: '',
id: '',
tel: '',
tags: []
},
showLogin: true,
imagePath: '',
userToken: '',
wxCode: '',
onceCode: '',
backgroundImg: ''
}
},
onLoad() {
wx.showToast({
title: '生成海报中...',
icon: 'loading',
duration: 100000
});
this.getWxCode()
this.getBackground()
},
methods: {
getBackground() {
let _this = this
_this.$http(_this.API.API_BILLBACKGROUND, {
type: 'telent_share'
}).then(res => {
let img = res.data?.img_url; // ?.
if (img) {
wx.getImageInfo({
src: img,
success: function(sres) {
_this.backgroundImg = sres.path
console.log('临时路径',_this.backgroundImg)
}
})
}
})
},
getWxCode() {
let userInfo = uni.getStorageSync('userinfo') || {};
const token = this.$shared.createToken({user_id: userInfo.id});
let options = {
route: 'home',
pt: 2,
share_id: userInfo.id,
scene_code: this.$scene.V2_INVITE_SHAREPOSTER
}
this.generateKooken(token, options); // token
this.$http(this.API.API_WXBILL, {
scene: token,
page: 'pages/route/index',
width: '2800'
}).then(res => {
this.wxCode = res.data.base_url
if (this.wxCode) {
this.getwxCodeImg()
}
})
},
generateKooken(token, options){
options.version = this.API.VERSION;
let values = JSON.stringify(options);
values = encodeURIComponent(values);
this.$http(this.API.API_WAREHOUSE_SET, {
key: token,
value: values
}).then(res => {
console.log("res", token, res);
});
},
//
getwxCodeImg() {
var imgSrc = this.wxCode; //base64
var save = wx.getFileSystemManager();
var number = Math.random();
save.writeFile({
filePath: wx.env.USER_DATA_PATH + '/pic' + number + '.jpg',
data: imgSrc,
encoding: 'base64',
success: res => {
this.onceCode = wx.env.USER_DATA_PATH + '/pic' + number + '.jpg'
console.log(this.onceCode)
if (this.onceCode && this.backgroundImg) {
this.createNewImg()
}else if(!this.onceCode){
this.$msg('小程序码生成失败!')
}else if(!this.backgroundImg){
this.$msg('海报背景图生成失败!')
}
},
fail: err => {
console.log(err)
}
})
},
createNewImg() {
var that = this;
var context = wx.createCanvasContext('mycanvas');
console.log('画布', that.backgroundImg)
var path = that.backgroundImg;
context.drawImage(path, 0, 0, 375, 600);
//
let wxcode = that.onceCode
context.drawImage(wxcode, 18, 460, 120, 120);
//
// context.setFontSize(24);
// context.setFillStyle('#fff');
// context.setTextAlign('center');
// context.fillText(name, 34, 620);
context.stroke();
context.draw();
//
setTimeout(function() {
wx.canvasToTempFilePath({
canvasId: 'mycanvas',
success: function(res) {
that.imagePath = res.tempFilePath;
if (that.imagePath) {
that.canvasHidden = true
that.maskHidden = true
wx.hideToast()
}
console.log('海报生成成功,图片链接', that.imagePath)
},
fail: function(res) {
console.log(res);
}
});
}, 900);
},
saveBill() {
var that = this
wx.saveImageToPhotosAlbum({
filePath: that.imagePath,
success(res) {
wx.showModal({
content: '图片已保存到相册,赶紧晒一下吧~',
showCancel: false,
confirmText: '好的',
confirmColor: '#333',
success: function(res) {
if (res.confirm) {
console.log('用户点击确定');
that.maskHidden = false
}
},
fail: function(res) {
that.maskHidden = false
}
})
}
})
},
//
copy(text) {
uni.setClipboardData({
data: text
});
},
}
}
</script>
<style>
.bgImg {
display: block;
width: 100%;
height: 366rpx;
}
.mine {
display: block;
text-align: center;
color: #333;
margin-top: 44rpx;
}
.code {
display: block;
text-align: center;
color: #333;
font-size: 76rpx;
font-weight: bold;
margin-top: 30rpx;
}
.who {
display: block;
margin-top: 80rpx;
font-size: 32rpx;
color: #333;
text-align: center;
}
.inputBox {
text-align: center;
margin-top: 44rpx;
}
.input {
text-align: center;
width: 440rpx;
height: 88rpx;
border-radius: 44rpx;
background: #f5f5f5;
font-size: 32rpx;
display: inline-block;
}
.btn {
width: 160rpx;
height: 88rpx;
border-radius: 44rpx;
background: linear-gradient(90deg, rgba(255, 226, 0, 1), rgba(255, 200, 11, 1));
box-shadow: 0px 4px 8px 0px rgba(255, 200, 11, 0.5);
color: #333;
font-size: 32rpx;
display: inline-block;
line-height: 88rpx;
margin-left: 40rpx;
}
button[class="btn"]::after {
border: 0;
}
.tishi {
display: block;
text-align: center;
color: #999;
margin-top: 30rpx;
}
.shareText {
display: block;
text-align: center;
color: #333;
font-size: 28rpx;
margin-top: 100rpx;
}
.imgBox {
text-align: center;
width: 100%;
margin-top: 60rpx;
padding-bottom: 120rpx;
}
.img {
display: inline-block;
width: 100%;
height: 100%;
}
.m_l {
margin-left: 180rpx;
}
.zfbtn {
display: inline-block;
width: 120rpx;
height: 120rpx;
border-radius: 50%;
background: transparent;
outline: none;
border: 0;
padding: 0;
}
button[class="zfbtn"]::after {
border: 0;
}
button[class="zfbtn m_l"]::after {
border: 0;
}
.imagePathBox {
width: 100%;
height: 100%;
background: rgba(0, 0, 0, 0.7);
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
z-index: 10;
}
.shengcheng {
width: 80%;
height: 80%;
position: fixed;
top: 50rpx;
left: 50%;
margin-left: -40%;
z-index: 10;
}
.baocun {
display: block;
width: 80%;
height: 80rpx;
padding: 0;
line-height: 80rpx;
text-align: center;
position: fixed;
bottom: 50rpx;
left: 10%;
background: #ffe200;
color: #333;
font-size: 32rpx;
border-radius: 44rpx;
}
button[class="baocun"]::after {
border: 0;
}
</style>

281
pages/center/wallet.vue

@ -0,0 +1,281 @@
<template>
<view>
<!-- 钱包余额信息 -->
<view class="wallet-top">
<view class="bg-white wallet-wraptop flex-direction flex justify-around align-center text-center">
<view class="text-black1 text-price1" style="font-size: 72rpx;">{{walletBalance}}</view>
<view class="text-gray lf-font-24 lf-m-b-20">佣金</view>
<view>
<button class="btn" @click="getWidthdraw()">提取佣金</button>
</view>
</view>
</view>
<!-- tabs -->
<view class="bg-white lf-p-t-40 lf-p-b-40 flex justify-around align-center text-center solid-bottom">
<view class="tab-item" :class="current==index?'text-orange':'text-black1'"
v-for="(item, index) in tab_list" :key="index"
@click="changeTab(index)">{{ item.name }}
</view>
</view>
<!-- scroll page -->
<block v-if="current == 0">
<scroll-view :style="{height: 'calc('+ windowHeight +'px - 530rpx)'}"
class="scroll-view"
:scroll-y="true" :refresher-enabled="true"
:refresher-triggered="isRefresher"
@scrolltolower="onScrolltolower"
@refresherrefresh="onRefresherrefresh">
<view class="flex flex-direction justify-between lf-p-t-20 lf-p-b-20 lf-p-l-32 lf-p-r-32 solid-bottom" v-for="(item, index) in tab_list[current].list" :key="item">
<view class="flex align-center text-center justify-between">
<view class="lf-font-36 lf-color-price">+¥{{item.add_price || 0}}</view>
<view class="lf-font-32 text-black1">结余 ¥{{item.final_price || 0}}</view>
</view>
<view class="flex align-center text-center justify-between lf-m-t-10">
<view class="lf-font-24 lf-color-999">{{item.reffer || 0}}</view>
<view class="lf-font-24 lf-color-999">{{item.created_at || 0}}</view>
</view>
</view>
<!-- 空数据的情况 -->
<view class="loading-more">
<text v-if="tab_list[0].list.length" :class="{'loading-more-text': tab_list[0].loadingClass}">{{ tab_list[0].loadingText }}</text>
<my-nocontent v-else></my-nocontent>
</view>
</scroll-view>
</block>
<block v-else>
<scroll-view :style="{height: 'calc('+ windowHeight +'px - 524rpx)'}"
:scroll-y="true" :refresher-enabled="true"
:refresher-triggered="isRefresher"
@scrolltolower="onScrolltolower"
@refresherrefresh="onRefresherrefresh">
<view class="flex flex-direction justify-between lf-p-t-20 lf-p-b-20 lf-p-l-32 lf-p-r-32 solid-bottom" v-for="(item, index) in tab_list[current].list" :key="item">
<view class="flex align-center text-center justify-between">
<view class="lf-font-36 lf-color-price">+¥{{item.extract_price || 0}}</view>
<view class="lf-font-28 text-orange">{{item.state || 0}}</view>
</view>
<view class="flex align-center text-center justify-between lf-m-t-10">
<view class="lf-font-24 lf-color-999">流水号 {{item.order_no || 0}}</view>
<view class="lf-font-24 lf-color-999">{{item.created_at || 0}}</view>
</view>
</view>
<!-- 空数据的情况 -->
<view class="loading-more">
<text v-if="tab_list[1].list.length" :class="{'loading-more-text': tab_list[1].loadingClass}">{{ tab_list[1].loadingText }}</text>
<my-nocontent v-else></my-nocontent>
</view>
</scroll-view>
</block>
<view class='imagePathBox' v-if="maskHidden == true" @click="maskHidden = false ">
<image :src="widthdrawImg" mode="widthFix" class='shengcheng'></image>
</view>
</view>
</template>
<script>
export default {
data() {
return {
current: 0,
pageSize: 10,
isRefresher: false, // scroll-view
tab_list: [{
name: '佣金记录',
list: [],
page: 1,
isPage: false,
loadingClass: false,
loadingText: '已加载全部数据'
},{
name: '提取记录',
list: [],
page: 1,
isPage: false,
loadingClass: true,
loadingText: '正在加载中'
}],
windowHeight: 0,
walletBalance: 0,
widthdrawImg: '',
maskHidden: false
}
},
onLoad(){
this.windowHeight = uni.getSystemInfoSync().windowHeight;
this.getIncomeList()
},
methods: {
getWidthdraw() {
let userInfo = uni.getStorageSync('userinfo') || {};
this.$http(this.API.API_WIDTHDRAWIMG, {
token: userInfo.token,
type: 'extract_img'
}).then(res => {
this.widthdrawImg = res.data.img_url
console.log(this.widthdrawImg)
if(this.widthdrawImg) {
this.maskHidden = true
}
})
},
changeTab(index) {
if(this.current == index) {
return
}else {
this.current = index
if(index == 0) {
this.getIncomeList()
}else {
this.getWidthList()
}
}
},
//
getWidthList() {
let per_page = this.pageSize;
let tab_item = this.tab_list[this.current];
this.$http(this.API.API_EXTRACTLIST, {
page: tab_item.page,
limit: per_page
}).then(res => {
this.isRefresher = false;
let isPage = res.data.has_more_page;
tab_item.isPage = isPage;
if(!isPage){
tab_item.loadingClass = false;
tab_item.loadingText = '没有更多数据啦~';
}
if(tab_item.page == 1){
tab_item.list = res.data.items;
}else{
tab_item.list.push(...res.data.items);
}
})
},
//
getIncomeList() {
let per_page = this.pageSize;
let tab_item = this.tab_list[this.current];
this.$http(this.API.API_INCOMELIST, {
page: tab_item.page,
limit: per_page
}).then(res => {
this.isRefresher = false;
this.walletBalance = res.data.income || 0
let isPage = res.data.has_more_page;
tab_item.isPage = isPage;
if(!isPage){
tab_item.loadingClass = false;
tab_item.loadingText = '没有更多数据啦~';
}
if(tab_item.page == 1){
tab_item.list = res.data.items;
}else{
tab_item.list.push(...res.data.items);
}
})
},
//
onScrolltolower(){
let tab_item = this.tab_list[this.current];
if(tab_item.isPage){
tab_item.page = tab_item.page + 1;
this.getIncomeList()
}
console.log('加载下一页')
},
// scroll-view
onRefresherrefresh(){
this.isRefresher = true;
if(this.current == 0) {
this.getIncomeList()
}else {
this.getWidthList()
}
}
}
}
</script>
<style scoped lang="scss">
.imagePathBox {
width: 100%;
height: 100%;
background: rgba(0, 0, 0, 0.7);
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
z-index: 10;
}
.shengcheng {
width: 80%;
height: 80%;
position: fixed;
top: 240rpx;
left: 50%;
margin-left: -40%;
z-index: 10;
}
.baocun {
display: block;
width: 80%;
height: 80rpx;
padding: 0;
line-height: 80rpx;
text-align: center;
position: fixed;
bottom: 50rpx;
left: 10%;
background: #ffe200;
color: #333;
font-size: 32rpx;
border-radius: 44rpx;
}
button[class="baocun"]::after {
border: 0;
}
.tab-item{
font-size: 32rpx;
width: 50%;
box-sizing: border-box;
&:first-child{
border-right: 2rpx solid rgba(0, 0, 0, 0.1);
}
}
.com {
height: 900rpx;
}
.wallet-top {
height: 404rpx;
width: 100%;
padding: 28rpx 32rpx;
background-color: #FE9903;
}
.wallet-wraptop {
width: 100%;
height: 100%;
border-radius: 10rpx;
padding: 46rpx 0 44rpx 0;
}
.btn{
margin: 0;
padding: 0;
width: 320rpx;
height: 84rpx;
background-color: #FE9903;
color: #FFFFFF;
line-height: 84rpx;
font-size: 32rpx;
border-radius: 42rpx;
}
.scroll-view{
padding-bottom: constant(safe-area-inset-bottom);
padding-bottom: env(safe-area-inset-bottom);
}
</style>

158
pages/center/widthdraw.vue

@ -0,0 +1,158 @@
<template>
<view class="wrap">
<view class="lf-p-l-30 lf-p-r-30 lf-m-t-30" style="height: auto;">
<view class="bg-white lf-h-100 lf-p-30 flex align-center" style="border-radius: 10rpx; box-sizing: border-box;">
<view>
<img :src="info.avatar" mode="aspectFill" style="height: 120rpx;width: 120rpx;border-radius: 50%;"></img>
</view>
<view class="lf-m-l-20 text-black1 lf-font-32">
{{info.nickname || ''}}
</view>
</view>
</view>
<view class="lf-p-l-30 lf-p-r-30 lf-m-t-30" style="height: auto;">
<view class="bg-white lf-h-100 lf-p-l-30 lf-p-r-30 flex flex-direction" style="border-radius: 10rpx; box-sizing: border-box;padding-bottom: 50rpx;padding-top: 34rpx;">
<view class="flex align-start flex-direction solid-bottom">
<view class="text-black lf-font-28 lf-m-b-30">支付宝姓名</view>
<input type="text" v-model="name" placeholder="请输入您的姓名" class="lf-font-28 lf-color-999">
</view>
<view style="margin-top: 60rpx;" class="flex align-start flex-direction solid-bottom">
<view class="text-black lf-font-28 lf-m-b-30">支付宝账号</view>
<input type="text" v-model="account" placeholder="请输入支付宝账号" class="lf-font-28 lf-color-999">
</view>
</view>
</view>
<view class="lf-p-30" style="height: 408rpx;">
<view class="bg-white lf-h-100" style="border-radius: 10rpx;">
<view class="text-black lf-font-28 lf-p-l-30 lf-p-t-30">提取金额</view>
<view class="lf-p-l-20 flex solid-bottom align-center" style="padding-top: 90rpx;">
<text class="text-black lf-font-48 unit"></text>
<!-- <u-input v-model="num" :type="type" :border="border" :height="height" :auto-height="autoHeight"/> -->
<input type="number" v-model="num" class="lf-p-l-10 text-black1" style="width: 80%;padding-right: 30rpx;font-size: 72rpx;height: 100rpx;" />
<view v-if="num != ''">
<u-icon @click="clearAble()" name="close-circle" color="#999999" size="40"></u-icon>
</view>
</view>
<view class="lf-font-28 lf-color-999 lf-p-t-26 lf-p-l-30" v-if="!ifshow">
可用余额
<text>{{info.income || 0}}</text>
</view>
<view v-else class="lf-color-price lf-font-28 lf-p-t-26 lf-p-l-30">输入金额超过可用余额</view>
</view>
</view>
<view class="lf-p-l-30 lf-p-r-30 lf-p-b-30" style="height: auto;">
<view class="bg-white lf-h-100 lf-p-30" style="border-radius: 10rpx; box-sizing: border-box;">
<view class="text-black lf-font-28">提现说明</view>
<view class="flex flex-direction justify-around lf-p-t-20">
<view class="lf-font-28" style="color: #555;">
1提现到账时间为T+1
</view>
<view class="lf-font-28" style="color: #555;">
2提现最高单笔金额为1000元
</view>
<view class="lf-font-28" style="color: #555;">
3提现手续费单笔收费10%
</view>
</view>
</view>
</view>
<view class="lf-m-b-30">
<view class="padding-lr-lg">
<button class="cu-btn block bg-orange lg" style="border-radius: 42rpx;" @tap="submitWidthdraw()">
<text class="lf-font-32 text-white">提现</text>
</button>
</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
userInfo: '',
info: '',
name: '',
account: '',
num: ''
}
},
computed: {
ifshow() {
if(Number(this.num) > Number(this.info.income)) {
return true
}else {
return false
}
}
},
methods: {
getData(){
this.$http(this.API.API_USER_CENTER).then(res => {
this.info = res.data;
console.log(this.info)
})
},
clearAble() {
this.num = ''
this.showClean = false
},
submitWidthdraw() {
if(!this.name) {
this.$msg('请输入支付宝姓名!')
return
}
if(!this.account) {
this.$msg('请输入支付宝账号!')
return
}
if(!this.num) {
this.$msg('请输入提现金额!')
return
}
this.$http(this.API.API_WIDTHDRAW, {
account: this.account,
username: this.name,
extract_price:this.num,
channel:'alipay',
token: this.userInfo.token
}).then(res => {
this.$msg(res.data)
this.name = ''
this.account = ''
this.num = ''
})
}
},
onLoad(e) {
this.userInfo = uni.getStorageSync('userinfo') || {};
this.getData()
}
}
</script>
<style>
page{
background-color: #F5F5F5;
}
</style>
<style scoped>
.wrap {
height: 100%;
width: 100%;
background-color: #F5F5F5;
}
.unit{
display: flex;
height: 100rpx;
align-items: flex-end;
box-sizing: border-box;
padding-bottom: 10rpx;
}
</style>

33
pages/collect/index.vue

@ -3,18 +3,26 @@
<skeleton :loading="skeletonLoading" :row="6" :showAvatar="false" :showTitle="true">
<view class="list-box">
<view class="lf-row-between list-item" v-for="(item, index) in list" :key="item.id">
<image class="goods-img" :src="item.goods.cover" @click="enterDetail(index)"></image>
<image class="goods-img" mode="aspectFill" :src="item.goods.cover" @click="enterDetail(index)"></image>
<view style="width: 480rpx;">
<view class="lf-font-32 lf-line-1" @click="enterDetail(index)">{{ item.goods.name }}</view>
<view class="lf-row-between lf-m-t-20">
<view class="lf-flex">
<image class="shop-img" :src="item.goods.store.cover" v-if="item.goods.store.cover"></image>
<image class="shop-img" src="../../static/center/shop-logo.png" v-else></image>
<image class="shop-img" mode="aspectFill" :src="item.goods.store.cover" v-if="item.goods.store.cover"></image>
<image class="shop-img" mode="aspectFill" src="../../static/center/shop-logo.png" v-else></image>
<view class="lf-m-l-10 lf-font-28 lf-line-1 shop-name">{{ item.goods.store.name }}</view>
</view>
<view @click="switchCollect(index)" class="lf-font-40">
<u-icon name="heart-fill" color="#ff0f00" v-if="item.is_collect"></u-icon>
<u-icon name="heart" v-else></u-icon>
<view v-if="item.is_collect" class="flex flex-direction justify-around align-center text-center" style="width: 100%;">
<u-icon name="heart-fill" color="#ff0f00"></u-icon>
<text class="collect-btn">取消收藏</text>
</view>
<view v-else class="flex flex-direction justify-around align-center text-center" style="width: 100%;">
<u-icon name="heart"></u-icon>
<text class="collect-btn">添加收藏</text>
</view>
</view>
</view>
<view class="lf-m-t-20 lf-font-24 lf-color-gray">{{ item.created_at_text }}</view>
@ -115,14 +123,21 @@
border-radius: 20rpx;
}
.shop-img{
width: 60rpx;
height: 60rpx;
border-radius: 10rpx;
width: 50rpx;
height: 50rpx;
border-radius: 50%;
}
.shop-name{
width: 340rpx;
width: 305rpx;
color: #555555;
}
}
}
.collect-btn{
display: inline-block;
padding: 2rpx 9rpx;
border: 1rpx solid #333333;
border-radius: 20rpx;
font-size: 22rpx;
}
</style>

12
pages/contactService/index.vue

@ -6,22 +6,23 @@
</view>
<view class="lf-row-between item">
<view class="lf-color-gray">服务时间</view>
<view>{{ info.service_period }}</view>
<view>{{ info.service_period || '-' }}</view>
</view>
<view class="lf-row-between item" @click="makePhoneCall">
<view class="lf-color-gray">客服电话</view>
<view>{{ info.phone }}</view>
<view style="color: #1E89FF!important;">{{ info.phone || '-' }}</view>
</view>
<view class="lf-row-between item">
<view class="lf-color-gray">联系地址</view>
<view style="max-width: 500rpx;">{{ info.address }}</view>
<view style="max-width: 500rpx;">{{ info.address || '-' }}</view>
</view>
<view class="lf-row-between item">
<view class="lf-color-gray">客服微信</view>
<view>
<view v-if="info.wechat">
<text>{{ info.wechat }}</text>
<text class="lf-m-l-20 lf-color-primary" @click="copy">复制</text>
</view>
<view v-else>-</view>
</view>
<view class="lf-row-between item">
<view class="lf-color-gray">当前版本</view>
@ -46,11 +47,12 @@
//
getInfo(){
this.$http(this.API.API_CONTACT).then(res => {
this.info = res.data;
this.info = res.data || {};
})
},
//
makePhoneCall(){
if(!this.info?.phone) return;
uni.makePhoneCall({
phoneNumber: this.info.phone
})

692
pages/goodsDetail/index.vue

@ -3,27 +3,42 @@
<skeleton :loading="skeletonLoading" :row="12" :showAvatar="false" :showTitle="true">
<block v-if="isRight(goods_detail)">
<!-- 商品图片轮播 -->
<swiper :current="current" :indicator-dots="goods_detail.banners.length > 1 ? true : false" :circular="true" class="swiper-box" indicator-active-color="#FE9903">
<swiper :current="current" :indicator-dots="goods_detail.banners.length > 1 ? true : false"
:circular="true" class="swiper-box" indicator-active-color="#FE9903">
<swiper-item v-for="(item, index) in goods_detail.banners" :key="item.id">
<image :src="item.cover" style="width: 100%; height: 100%;" @click="lookImg(index)"></image>
<image mode="aspectFill" :src="item.cover" style="width: 100%; height: 100%;"
@click="lookImg(index)"></image>
</swiper-item>
</swiper>
<view class="bill-position" @tap='formSubmit()'>
<button class="cu-btn1 margin-left-sm lf-font-28 lf-m-20">
分享海报
</button>
</view>
<!-- 商品主要信息 -->
<view class="head-info">
<view class="lf-font-40">{{ goods_detail.name }}</view>
<view class="lf-row-between lf-font-24 lf-m-t-30 lf-p-b-20">
<view class="lf-flex price">
<lf-price :price="goods_detail.specs[0].selling_price"></lf-price>
<view class="lf-m-l-20">¥{{ goods_detail.specs[0].original_price }}</view>
<view v-if="goods_detail.specs[0].cost">{{ goods_detail.specs[0].cost }}</view>
<view v-for="(item,index) of goods_detail.specs" v-if="index == chooseTag">
<view class="lf-row-between lf-font-24 lf-m-t-30 lf-p-b-20" style="height: 84rpx;">
<view class="lf-flex price">
<lf-price :price="item.selling_price"></lf-price>
<view class="lf-m-l-20">¥{{ item.original_price }}</view>
<view v-if="item.cost">{{ item.cost }}</view>
</view>
<view class="lf-font-24 lf-text-right">
<view class="lf-color-gray">{{ item.sold_stock_text }}</view>
<view class="lf-color-primary" v-if="item.stock && item.stock < 100">{{ item.stock_text }}</view>
</view>
</view>
<view class="lf-font-24 lf-text-right">
<view class="lf-color-gray">{{ goods_detail.specs[0].sold_stock_text }}</view>
<view class="lf-color-primary">{{ goods_detail.specs[0].stock_text }}</view>
</view>
<view class="flex lf-p-b-20">
<view v-for="(item,i) of goods_detail.specs">
<view class="lf-tag lf-m-r-20" :class="chooseTag==i?'bg-orange':''" @click="getChooseTag(i)">{{item.name}}</view>
</view>
</view>
<view class="label-box" v-if="goods_detail.tags && goods_detail.tags.length">
<view class="label-item" v-for="(item, index) in goods_detail.tags" :key="index">{{ item }}</view>
<view class="label-item" v-for="(item, index) in goods_detail.tags" :key="index">{{ item }}
</view>
</view>
</view>
<!-- 地址信息 -->
@ -31,9 +46,12 @@
<view class="lf-font-32 lf-font-bold">适用门店</view>
<view class="lf-m-t-20 lf-row-between">
<view class="lf-flex">
<image class="lf-fle shop-img" :src="goods_detail.store.cover" v-if="goods_detail.store.cover"></image>
<image class="lf-fle shop-img" src="../../static/center/shop-logo.png" v-else></image>
<view class="lf-font-32 lf-m-l-20 lf-line-1" style="max-width: 512rpx;">{{ goods_detail.store.name }}</view>
<image mode="aspectFill" class="lf-fle shop-img" :src="goods_detail.store.cover"
v-if="goods_detail.store.cover"></image>
<image mode="aspectFill" class="lf-fle shop-img" src="../../static/center/shop-logo.png"
v-else></image>
<view class="lf-font-32 lf-m-l-20 lf-line-1" style="max-width: 512rpx;">
{{ goods_detail.store.name }}</view>
</view>
<view @click="makePhoneCall(goods_detail.store.tel)">
<text class="lf-iconfont lf-icon-dianhua lf-font-40" style="color: #3A62FF;"></text>
@ -43,30 +61,36 @@
<view style="width: 60rpx; height: 60rpx;" class="lf-row-center">
<text class="lf-iconfont lf-icon-dizhi lf-font-40" style="color: #555555;"></text>
</view>
<view class="lf-m-l-20 lf-font-28" style="color: #555555;">{{ goods_detail.store.address }}</view>
<view class="lf-m-l-20 lf-font-28" style="color: #555555;">{{ goods_detail.store.address }}
</view>
</view>
</view>
<!-- 商品详情 -->
<view class="goods-detail">
<view class="lf-font-32 lf-font-bold lf-m-b-20">商品详情</view>
<rich-text :nodes="formatRichText(goods_detail.content)" v-if="goods_detail.content_type == 'rich_text'"></rich-text>
<image class="goods-img" :src="item" v-for="(item, index) in goods_detail.content" :key="index" v-if="goods_detail.content_type == 'img'"></image>
<rich-text :nodes="afterDone"
v-if="goods_detail.content_type == 'rich_text'"></rich-text>
<image class="goods-img" :src="item" v-for="(item, index) in goods_detail.content" :key="index"
v-if="goods_detail.content_type == 'img'"></image>
</view>
<!-- 修饰专用 -->
<view class="extra"></view>
<!-- 吸底操作按钮 -->
<view class="lf-row-between fixed-bottom">
<view class="lf-flex lf-p-t-10 lf-p-b-10">
<view class="lf-flex-column lf-row-center icon-item" @click="$url('/pages/index/index', {type: 'switch'})">
<view class="lf-flex-column lf-row-center icon-item"
@click="$url('/pages/index/index', {type: 'switch'})">
<image class="icon-img" src="../../static/center/home.png"></image>
<view class="lf-m-t-1">首页</view>
</view>
<view class="lf-flex-column lf-row-center icon-item" @click="$url('/pages/contactService/index')">
<view class="lf-flex-column lf-row-center icon-item"
@click="$url('/pages/contactService/index')">
<image class="icon-img" src="../../static/center/service.png"></image>
<view class="lf-m-t-1">客服</view>
</view>
<view class="lf-flex-column lf-row-center icon-item" @click="switchCollect">
<image class="icon-img" src="../../static/center/collect-active.png" v-if="is_collect"></image>
<image class="icon-img" src="../../static/center/collect-active.png" v-if="is_collect">
</image>
<image class="icon-img" src="../../static/center/collect.png" v-else></image>
<view class="lf-m-t-1">{{ is_collect ? '已收藏' : '收藏' }}</view>
</view>
@ -79,40 +103,320 @@
</view>
<!-- 回到顶部 -->
<!-- <u-back-top :scroll-top="pageScrollTop" :custom-style="{background: 'rgba(51, 51 51, 0.3)'}" :icon-style="{color: '#ffffff'}"></u-back-top> -->
<u-back-top :scroll-top="pageScrollTop" :custom-style="{background: 'rgba(51, 51 51, 0.3)'}"></u-back-top>
<u-back-top :scroll-top="pageScrollTop" :custom-style="{background: 'rgba(51, 51 51, 0.3)'}">
</u-back-top>
</block>
</skeleton>
<view class="canvas-box">
<canvas style="width: 375px;height: 496px;position:fixed;top:9999px" canvas-id="mycanvas" />
</view>
<view class='imagePathBox' v-if="maskHidden == true && imagePath" @click="maskHidden = false ">
<image :src="imagePath" class='shengcheng' mode="widthFix"></image>
<button class='baocun' @click.stop="saveBill()">保存相册分享到朋友圈</button>
</view>
</view>
</template>
<script>
let SparkMD5 = require("@/common/SparkMD5.js"); // js
export default {
data(){
data() {
return {
current: 0, //
goods_id: 0,
goods_detail: {},
is_collect: 0, // 10
skeletonLoading: true
skeletonLoading: true,
base64Img: '',
checkArea: 'Cannot find module',
maskHidden: false,
info: {
avatar: '',
nickname: '',
id: '',
tel: '',
tags: []
},
showLogin: true,
imagePath: '',
userToken: '',
wxCode: '',
onceCode: '',
pt: 1,
afterDone: '',
backgroundImg: '',
goodShare: '',
s_id: '',
userInfo: {},
chooseTag: 0,//
}
},
computed: {
isRight(){
return function(val){
isRight() {
return function(val) {
return this.$shared.isRight(val);
}
}
},
onLoad(options){
onLoad(options) {
this.goods_id = options.id;
this.pt = options.pt || 1;
this.s_id = options.share_id || '';
this.userInfo = uni.getStorageSync('userinfo') || {};
this.getGoodsDetail();
},
methods: {
getGoodsDetail(){
getChooseTag(i) {
this.chooseTag = i
},
getBackground() {
let _this = this
return new Promise((resolve, reject) => {
_this.$http(_this.API.API_BILLBACKGROUND, {
type: 'goods'
}).then(res => {
let img = res.data.img_url
if (img) {
uni.getImageInfo({
src: img,
success: function(sres) {
uni.showLoading({title:'生成海报中...'})
_this.backgroundImg = sres.path;
resolve(); //
}
})
}
}).catch(err => reject(err));
})
},
//
getGoodsBackground() {
let _this = this
let goods = _this.goods_detail;
let imageUrl = goods.share_cover || goods.cover;
uni.getImageInfo({
src: imageUrl,
success: function(sres) {
_this.goodShare = sres.path
console.log('商品分享图',_this.goodShare)
}
})
console.log('商品分享图',_this.goodShare)
},
//
bindGoods() {
var _this = this;
let yy = new Date().getFullYear();
let mm = new Date().getMonth()+1;
let dd = new Date().getDate();
let hh = new Date().getHours();
let mf = new Date().getMinutes()<10 ? '0'+new Date().getMinutes() : new Date().getMinutes();
let ss = new Date().getSeconds()<10 ? '0'+new Date().getSeconds() : new Date().getSeconds();
let gettime = yy+'-'+mm+'-'+dd+' '+hh+':'+mf+':'+ss;
let userInfo = uni.getStorageSync('userinfo') || {};
let timeDate = Math.round(new Date().getTime() / 1000).toString();
console.log(SparkMD5)
let md5TimeDate = SparkMD5.hash(timeDate)
let nowTime = new Date().toLocaleString();
_this.$http(_this.API.API_BINDGOODS, {
deed: md5TimeDate,
sid: _this.s_id,
gid: _this.goods_id,
gn: _this.goods_detail.name,
t: gettime
}).then(res => {
console.log(res)
}).catch(err => {
console.log(err)
})
},
getWxCode() {
let that = this;
this.$http(this.API.API_GOODS_DETAIL, {goods_id: this.goods_id}).then(res => {
uni.showLoading({
title: '生成海报中...'
})
return new Promise((resolve, reject) => {
const token = that.$shared.createToken({
user_id: that.userInfo.id,
goods_id: that.goods_id
});
let options = {
route: 'goods',
pt: 2,
id: that.goods_id,
share_id: that.userInfo.id,
scene_code: that.$scene.V2_GOODS_SHAREPOSTER
}
that.generateKooken(token, options); // token
that.$http(that.API.API_WXBILL, {
scene: token,
page: 'pages/route/index',
width: '28'
}).then(res => {
that.wxCode = res.data.base_url
if (that.wxCode) {
that.getwxCodeImg(resolve, reject); // /
}
}).catch(err => reject());
})
},
//
//
getwxCodeImg(resolve, reject) {
var imgSrc = this.wxCode; //base64
var save = uni.getFileSystemManager();
var number = Math.random();
uni.showLoading({
title: '生成海报中...'
})
var filePath = wx.env.USER_DATA_PATH + '/pic' + number + '.jpg';
save.writeFile({
filePath: filePath,
data: imgSrc,
encoding: 'base64',
success: res => {
this.onceCode = filePath;
resolve(); //
console.log('二维码临时路径',this.onceCode)
},
fail: err => {
console.log(err);
reject(); //
}
})
},
createNewImg() {
var that = this;
var context = uni.createCanvasContext('mycanvas', this);
let goods = that.goods_detail;
let title = goods.name;
let price = '¥'+goods.specs[this.chooseTag].selling_price;
//
var path = that.backgroundImg;
// context.setFillStyle("#fff")
// context.fillRect(0, 0, 375, 600)
let goodsBackground = that.goodShare
context.drawImage(path, 0, 0, 375, 496);
context.drawImage(goodsBackground, 10, 10, 355, 300);
//
let wxcode = that.onceCode
context.drawImage(wxcode, 244, 324, 120, 120);
let message = '长按识别小程序码'
context.setFontSize(16);
context.setFillStyle('#999');
context.setTextAlign('center');
context.fillText(message,300,470);
//
context.setFontSize(40);
context.setFillStyle('#FF0000');
context.setTextAlign('left');
context.fillText(price,6, 366);
if(title.length <= 11){
context.setFontSize(20);
context.setFillStyle('#222');
context.setTextAlign('left');
context.fillText(title, 10, 470);
}else{
let str = title;
if(str.length > 22){
str = str.substr(0, 21) + '...';
}
let before = str.substr(0, 11);
let last = str.substr(11, str.length);
context.setFontSize(20);
context.setFillStyle('#222');
context.setTextAlign('left');
context.fillText(before, 10, 448);
context.fillText(last, 10, 472);
}
context.stroke();
context.draw();
//
setTimeout(function() {
wx.canvasToTempFilePath({
canvasId: 'mycanvas',
success: function(res) {
that.imagePath = res.tempFilePath;
if (that.imagePath) {
that.canvasHidden = true
that.maskHidden = true
}
uni.hideLoading()
console.log('海报生成成功')
console.log(res)
console.log('图片链接', that.imagePath)
},
fail: function(res) {
console.log(res);
}
});
}, 200);
},
saveBill() {
var that = this
uni.saveImageToPhotosAlbum({
filePath: that.imagePath,
success(res) {
uni.showModal({
content: '图片已保存到相册,赶紧晒一下吧~',
showCancel: false,
confirmText: '好的',
confirmColor: '#333',
success: function(res) {
if (res.confirm) {
console.log('用户点击确定');
that.maskHidden = false
}
},
fail: function(res) {
that.maskHidden = false
}
})
}
})
},
formSubmit() {
var that = this;
uni.showLoading({
title: '生成海报中...'
});
if(that.backgroundImg && that.onceCode){
that.createNewImg();
}else {
Promise.all([that.getWxCode(), that.getBackground()]).then(res => {
that.createNewImg();
}).catch(err => {
this.$msg('生成失败,请稍后重试!');
})
}
},
//
getGoodsDetail() {
let that = this;
this.$http(this.API.API_GOODS_DETAIL, {
goods_id: this.goods_id
}).then(res => {
this.skeletonLoading = false;
this.goods_detail = res.data;
if(this.goods_detail) {
this.getGoodsBackground()
if(this.pt == 2) {
this.bindGoods()
}
}
this.afterDone = this.formatRichText(this.goods_detail.content)
this.is_collect = Boolean(res.data.user.is_collect);
}).catch(err => {
this.skeletonLoading = false;
@ -122,40 +426,43 @@
})
},
//
switchCollect(){
switchCollect() {
let userInfo = uni.getStorageSync('userinfo') || {};
if(!userInfo.id || !userInfo.nickname || !userInfo.avatar){
if (!userInfo.id || !userInfo.nickname || !userInfo.avatar) {
this.$url('/pages/login/index?type=userinfo');
return;
}
this.$http(this.API.API_COLLECT_DEAL, {goods_id: this.goods_id}).then(res => {
this.$http(this.API.API_COLLECT_DEAL, {
goods_id: this.goods_id
}).then(res => {
this.$msg(res.msg);
this.is_collect = Boolean(res.data.user.is_collect);
})
},
//
makePhoneCall(phoneStr){
makePhoneCall(phoneStr) {
uni.makePhoneCall({
phoneNumber: String(phoneStr)
})
},
//
openMap(){
return;
let { address, lat, lng } = this.goods_detail?.store || {};
uni.openLocation({
longitude: 108.36637,
latitude: 22.817746,
scale: 18
})
longitude: Number(lat),
latitude: Number(lng),
scale: 20,
name: address
});
},
//
toAddOrder(){
toAddOrder() {
let goods_id = this.goods_detail.id;
let goods_specs_id = this.goods_detail.specs[0].id
this.$url('/pages/order/confirm-order?goods_id='+ goods_id +'&goods_specs_id='+ goods_specs_id);
let goods_specs_id = this.goods_detail.specs[this.chooseTag].id
this.$url('/pages/order/confirm-order?goods_id=' + goods_id + '&goods_specs_id=' + goods_specs_id +'&pt='+ this.pt +'&share_id='+ this.s_id+'&choose_tag='+this.chooseTag);
},
//
lookImg(index){
lookImg(index) {
this.$u.throttle(() => {
let goods_banner = this.goods_detail.banners || [];
let banners = goods_banner.map(item => item.cover);
@ -166,32 +473,64 @@
}, 200);
},
//
formatRichText(richText){
if(richText != null){
let newRichText= richText.replace(/<img[^>]*>/gi, function(match, capture){
formatRichText(richText) {
if (richText != null) {
let newRichText = richText.replace(/<img[^>]*>/gi, function(match, capture) {
match = match.replace(/style="[^"]+"/gi, '').replace(/style='[^']+'/gi, '');
match = match.replace(/width="[^"]+"/gi, '').replace(/width='[^']+'/gi, '');
match = match.replace(/height="[^"]+"/gi, '').replace(/height='[^']+'/gi, '');
return match;
});
newRichText = newRichText.replace(/style="[^"]+"/gi,function(match, capture){
match = match.replace(/width:[^;]+;/gi, 'width:100%;').replace(/width:[^;]+;/gi, 'width:100%;');
newRichText = newRichText.replace(/style="[^"]+"/gi, function(match, capture) {
match = match.replace(/width:[^;]+;/gi, 'width:100%;').replace(/width:[^;]+;/gi,
'width:100%;');
return match;
});
newRichText = newRichText.replace(/<br[^>]*\/>/gi, '');
newRichText = newRichText.replace(/\<img/gi, '<img style="width:100%;height:auto;display:block;margin:10px 0;"');
newRichText = newRichText.replace(/\<img/gi,
'<img style="width:100%;height:auto;display:block;margin:10px 0;"');
return newRichText;
}else{
} else {
return null;
}
},
// token
generateKooken(token, options){
options.version = this.API.VERSION;
let values = JSON.stringify(options);
values = encodeURIComponent(values);
this.$http(this.API.API_WAREHOUSE_SET, {
key: token,
value: values
}).then(res => {
console.log("res", token, res);
});
}
},
onShareAppMessage(){
onShareAppMessage() {
const token = this.$shared.createToken({
user_id: this.userInfo.id,
goods_id: this.goods_id
});
let goods = this.goods_detail;
let options = {
id: goods.id,
route: 'goods',
scene_code: this.$scene.V2_GOODS_SHAREPOSTER,
share_id: this.userInfo.id,
pt: 2
}
this.generateKooken(token, options); // token
// let goods = this.goods_detail;
// let title = goods.name;
// let imageUrl = goods.share_cover || goods.cover;
// let path = '/pages/route/index?route=goods_detail&id=' + goods.id;
let title = goods.name;
let imageUrl = goods.share_cover || goods.cover;
let path = '/pages/route/index?route=goods_detail&id='+ goods.id;
let path = '/pages/route/index?token='+ token;
return {
title,
path,
@ -202,36 +541,73 @@
</script>
<style>
page{
page {
background-color: #f5f5f5;
overflow-x: hidden;
}
</style>
<style lang="scss" scoped="scoped">
.swiper-box{
.lf-tag {
border-radius: 30rpx;
width: max-content;
padding: 10rpx 20rpx;
background-color: #F5F5F5;
color: #222222;
font-size: 28rpx;
}
.bill-position {
position: absolute;
top: 0;
right: 0;
}
.cu-btn1 {
position: relative;
display: inline-flex;
align-items: center;
justify-content: center;
box-sizing: border-box;
padding: 0 30rpx;
font-size: 28rpx;
height: 64rpx;
line-height: 1;
text-align: center;
text-decoration: none;
overflow: visible;
margin-left: initial;
transform: translate(0upx, 0upx);
margin-right: initial;
background-color: rgba(0, 0, 0, 0.5);
color: #FFFFFF;
border-radius: 33rpx;
}
.swiper-box {
width: 750rpx;
height: 520rpx;
background-color: #FFFFFF;
}
.head-info{
.head-info {
width: 750rpx;
height: auto;
box-sizing: border-box;
padding: 0 32rpx;
padding-top: 20rpx;
background-color: #FFFFFF;
// .price>view:nth-of-type(1){
// color: #FF0000;
// margin-right: 22rpx;
// font-weight: bold;
// }
.price>view:nth-of-type(1){
.price>view:nth-of-type(1) {
text-decoration: line-through;
color: #777777;
margin-right: 22rpx;
}
.price>view:nth-of-type(2){
.price>view:nth-of-type(2) {
width: max-content;
padding: 0 18rpx;
height: 46rpx;
@ -242,14 +618,16 @@
align-items: center;
color: #FFFFFF;
}
.label-box{
.label-box {
min-height: 130rpx;
width: 100%;
border-top: 1rpx solid #E5E5E5;
display: flex;
flex-wrap: wrap;
padding: 30rpx 0 10rpx 0;
.label-item{
.label-item {
width: 156rpx;
height: 70rpx;
border-radius: 10rpx;
@ -264,45 +642,48 @@
}
}
}
.address-box{
.address-box {
width: 750rpx;
height: auto;
box-sizing: border-box;
background-color: #FFFFFF;
padding: 32rpx;
margin-top: 20rpx;
.shop-img{
.shop-img {
width: 60rpx;
height: 60rpx;
border-radius: 10rpx;
border-radius: 50%;
}
}
.goods-detail{
.goods-detail {
width: 750rpx;
height: auto;
background-color: #FFFFFF;
padding: 32rpx;
box-sizing: border-box;
margin-top: 20rpx;
.goods-img{
.goods-img {
width: 100%;
}
}
.extra{
.extra {
width: 100%;
height: 120rpx;
padding-bottom: constant(safe-area-inset-bottom);
padding-bottom: env(safe-area-inset-bottom);
box-sizing: content-box;
}
.fixed-bottom{
.fixed-bottom {
position: fixed;
bottom: 0;
left: 0;
z-index: 99;
background-color: #FFFFFF;
width: 100%;
height: auto;
@ -310,7 +691,8 @@
border-top: 1rpx solid #e5e5e5;
padding-bottom: constant(safe-area-inset-bottom);
padding-bottom: env(safe-area-inset-bottom);
.icon-item{
.icon-item {
margin-right: 16rpx;
background-color: transparent;
margin: 0;
@ -320,15 +702,18 @@
margin-right: 10rpx;
padding: 0;
width: 88rpx;
&:first-child{
&:first-child {
padding-left: 0;
}
.icon-img{
.icon-img {
height: 50rpx;
width: 50rpx;
}
}
.btn{
.btn {
margin: 0;
padding: 0;
width: 208rpx;
@ -340,4 +725,161 @@
border-radius: 42rpx;
}
}
</style>
//
.bgImg {
display: block;
width: 100%;
height: 366rpx;
}
.mine {
display: block;
text-align: center;
color: #333;
margin-top: 44rpx;
}
.code {
display: block;
text-align: center;
color: #333;
font-size: 76rpx;
font-weight: bold;
margin-top: 30rpx;
}
.who {
display: block;
margin-top: 80rpx;
font-size: 32rpx;
color: #333;
text-align: center;
}
.inputBox {
text-align: center;
margin-top: 44rpx;
}
.input {
text-align: center;
width: 440rpx;
height: 88rpx;
border-radius: 44rpx;
background: #f5f5f5;
font-size: 32rpx;
display: inline-block;
}
.btn {
width: 160rpx;
height: 88rpx;
border-radius: 44rpx;
background: rgba(254, 153, 3, 1);
color: #333;
font-size: 32rpx;
display: inline-block;
line-height: 88rpx;
margin-left: 40rpx;
}
button[class="btn"]::after {
border: 0;
}
.tishi {
display: block;
text-align: center;
color: #999;
margin-top: 30rpx;
}
.shareText {
display: block;
text-align: center;
color: #333;
font-size: 28rpx;
margin-top: 100rpx;
}
.imgBox {
text-align: center;
width: 100%;
margin-top: 60rpx;
padding-bottom: 120rpx;
}
.img {
display: inline-block;
width: 100%;
height: 100%;
}
.m_l {
margin-left: 180rpx;
}
.zfbtn {
display: inline-block;
width: 120rpx;
height: 120rpx;
border-radius: 50%;
background: transparent;
outline: none;
border: 0;
padding: 0;
}
button[class="zfbtn"]::after {
border: 0;
}
button[class="zfbtn m_l"]::after {
border: 0;
}
.imagePathBox {
width: 100%;
height: 100%;
background: rgba(0, 0, 0, 0.7);
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
z-index: 100;
}
.shengcheng {
width: 80%;
height: 80%;
position: fixed;
// top: 50rpx;
top: 140rpx;
left: 50%;
margin-left: -40%;
z-index: 100;
}
.baocun {
display: block;
width: 80%;
height: 80rpx;
padding: 0;
line-height: 80rpx;
text-align: center;
position: fixed;
bottom: 100rpx;
left: 10%;
background: rgba(254, 153, 3, 1);
color: #fff;
font-size: 32rpx;
border-radius: 44rpx;
z-index: 102;
}
button[class="baocun"]::after {
border: 0;
}
</style>

201
pages/index/index.vue

@ -1,62 +1,121 @@
<template>
<view class="lf-row-center lf-flex-column">
<view class="ctab" v-if="tab_list.length">
<u-tabs :list="tab_list" :is-scroll="true" :show-bar="false" :current="current" @change="change"></u-tabs>
</view>
<view class="com" v-for="(tab, tabIndex) in tab_list" v-if="tabIndex == current" :key="tab.id">
<view class="lf-row-between list" v-for="(item, index) in tab.list" :key="item.id" @click="toDetail(item)">
<view class="left">
<image :src="item.cover" mode="aspectFit"></image>
</view>
<view class="right">
<view class="lf-line-2 title">{{ item.name }}</view>
<view class="lf-flex tips">
<view class="lf-row-between lf-flex-1" v-if="item.specs[0]">
<view class="lf-flex">
<view class="u-line-progress" v-if="item.specs[0].sold_percent">
<u-line-progress :percent="item.specs[0].sold_percent" height="20" :striped="true" active-color="#FE9903" :show-percent="false" inactive-color="#F5F5F5"></u-line-progress>
</view>
<text class="progress lf-m-r-10">{{ item.specs[0].sold_percent_text }}</text>
<block v-if="tab_list.length">
<view class="ctab">
<u-tabs :list="tab_list" :is-scroll="true" :show-bar="false" :current="current" @change="change"></u-tabs>
</view>
<swiper :style="{height: 'calc('+ windowHeight +'px - 110rpx)', width: '750rpx'}" :current="current" @change="swiperChange">
<swiper-item v-for="(tab, tabIndex) in tab_list" :key="tabIndex">
<scroll-view class="com" :scroll-y="true" :refresher-enabled="true" :refresher-triggered="isRefresher" @scrolltolower="onScrolltolower" @refresherrefresh="onRefresherrefresh">
<view class="lf-row-between list" v-for="(item, index) in tab.list" :key="item.id" @click="toDetail(item)">
<view class="left">
<image :src="item.cover" mode="aspectFill"></image>
</view>
<view>
<text class="bought">{{ item.specs[0].sold_stock_text }}</text>
<view class="right">
<view class="lf-line-2 title">{{ item.name }}</view>
<view class="lf-flex tips">
<view class="lf-row-between lf-flex-1" v-if="item.specs[0]">
<view class="lf-flex">
<view class="u-line-progress">
<u-line-progress :percent="item.specs[0].sold_percent" height="20" :striped="true" active-color="#FE9903" :show-percent="false" inactive-color="#F5F5F5"></u-line-progress>
</view>
<text class="progress lf-m-r-10">{{ item.specs[0].sold_percent_text }}</text>
</view>
<view>
<text class="bought">{{ item.specs[0].sold_stock_text }}</text>
</view>
</view>
</view>
<view class="lf-row-between price">
<lf-price :price="item.specs[0].selling_price" v-if="item.specs[0]"></lf-price>
<text class="lf-font-24 original-price" v-if="item.specs[0]">{{ item.specs[0].original_price }}</text>
<text v-else></text>
<button>立即抢购</button>
</view>
</view>
</view>
</view>
<view class="lf-row-between price">
<lf-price :price="item.specs[0].selling_price" v-if="item.specs[0]"></lf-price>
<text class="lf-font-24 original-price" v-if="item.specs[0]">{{ item.specs[0].original_price }}</text>
<text v-else></text>
<button>立即抢购</button>
</view>
</view>
</view>
<!-- 加载 -->
<view class="loading-more">
<text v-if="tab.list.length" :class="{'loading-more-text': tab.loadingClass}">{{ tab.loadingText }}</text>
<my-nocontent v-else></my-nocontent>
</view>
<!-- 回到顶部 -->
<u-back-top :scroll-top="pageScrollTop" :custom-style="{background: 'rgba(51, 51 51, 0.3)'}"></u-back-top>
</view>
<!-- 空数据的情况 -->
<view class="loading-more">
<text v-if="tab.list.length" :class="{'loading-more-text': tab.loadingClass}">{{ tab.loadingText }}</text>
<my-nocontent v-else></my-nocontent>
</view>
<!-- 回到顶部 -->
<u-back-top :scroll-top="pageScrollTop" :custom-style="{background: 'rgba(51, 51 51, 0.3)'}"></u-back-top>
</scroll-view>
</swiper-item>
</swiper>
</block>
<block v-else>
<my-nocontent></my-nocontent>
</block>
</view>
</template>
<script>
let SparkMD5 = require("@/common/SparkMD5.js"); // js
export default {
data() {
return {
tab_list: [],
current: 0, // tab
pageSize: 10,
shareInfo: {}
shareInfo: {},
windowHeight: 0, //
isRefresher: false ,// scroll-view
pt: 1,
s_id: ''
}
},
onLoad() {
this.windowHeight = getApp().globalData.windowHeight;
this.getCategoryList();
this.getShareInfo();
//
let options = uni.getStorageSync('homePageOptions') || {};
if(Object.keys(options).length > 0){
this.pt = options.pt || 1;
this.s_id = options.share_id || '';
uni.removeStorageSync('homePageOptions');
if(this.pt == 2) {
this.bindUsders()
}else if(this.pt == 3){
this.bindAllUsders();
}
}
},
methods: {
//
bindUsders() {
var _this = this;
let yy = new Date().getFullYear();
let mm = new Date().getMonth()+1;
let dd = new Date().getDate();
let hh = new Date().getHours();
let mf = new Date().getMinutes()<10 ? '0'+new Date().getMinutes() : new Date().getMinutes();
let ss = new Date().getSeconds()<10 ? '0'+new Date().getSeconds() : new Date().getSeconds();
let gettime = yy+'-'+mm+'-'+dd+' '+hh+':'+mf+':'+ss;
let userInfo = uni.getStorageSync('userinfo') || {};
let timeDate = Math.round(new Date().getTime() / 1000).toString();
let md5TimeDate = SparkMD5.hash(timeDate)
let nowTime = new Date().toLocaleString();
_this.$http(_this.API.API_BINDSALES, {
deed: md5TimeDate,
sid: _this.s_id,
t: gettime
}).then(res => {
_this.$msg('提交审核成功');
}).catch(err => {
console.log(err)
})
},
//
bindAllUsders(){
this.$http(this.API.API_SALESMAN_BINDALL, {
pid: this.s_id
}).then(res => {
this.$msg('提交审核成功');
})
},
//
getShareInfo(){
this.$http(this.API.API_SHARE_HOME).then(res => {
@ -70,8 +129,16 @@
this.getGoodsList(); // tab
}
},
//
swiperChange(event){
this.current = event.detail.current;
if(event.detail.source == '') return; //
if(this.tab_list[event.detail.current].list.length <= 0){
this.getGoodsList(); // tab
}
},
// tab
getCategoryList(){
getCategoryList(options = {}){
this.$http(this.API.API_CATEGORY_LIST).then(res => {
let res_list = res.data || [];
let tab_list = res_list.map(item => {
@ -85,7 +152,12 @@
page: 1,
isPage: true
}
})
});
if(options.type == 'pageRefresh'){
uni.stopPullDownRefresh();
}else if(options.type == 'scrollRefresh'){
this.isRefresher = false;
}
this.tab_list = tab_list;
this.getGoodsList();
})
@ -94,6 +166,7 @@
getGoodsList(){
let per_page = this.pageSize;
let tab_item = this.tab_list[this.current];
if(this.$shared.isValueType(tab_item) == 'undefined') return;
this.$http(this.API.API_GOODS_LIST, {
category_id: tab_item.id,
type: tab_item.type,
@ -116,18 +189,36 @@
//
toDetail(item){
this.$url('/pages/goodsDetail/index?id='+ item.id);
},
//
onScrolltolower(){
let tab_item = this.tab_list[this.current];
if(tab_item.isPage){
tab_item.page = tab_item.page + 1;
this.getGoodsList();
}
},
// scroll-view
onRefresherrefresh(){
this.isRefresher = true;
this.getCategoryList({type: 'scrollRefresh'});
},
generateKooken(token, options){
options.version = this.API.VERSION;
let values = JSON.stringify(options);
values = encodeURIComponent(values);
this.$http(this.API.API_WAREHOUSE_SET, {
key: token,
value: values
}).then(res => {
console.log("res", token, res);
});
}
},
onReachBottom(){
let tab_item = this.tab_list[this.current];
if(tab_item.isPage){
tab_item.page = tab_item.page + 1;
this.getGoodsList();
}
},
// page
onPullDownRefresh(){
//
this.getCategoryList();
this.getCategoryList({type: 'pageRefresh'});
// tab
// let tab_item = this.tab_list[this.current];
@ -136,14 +227,23 @@
// tab_item.loadingClass = true;
// tab_item.loadingText = '';
// this.getGoodsList();
uni.stopPullDownRefresh()
},
onShareAppMessage(){
const userInfo = uni.getStorageSync('userinfo') || {};
const token = this.$shared.createToken({user_id: userInfo.id});
const scene_code = this.$scene.V2_HOME_SHAREBUTTON;
let options = {
route: 'home',
scene_code,
share_id: userInfo.id,
pt: 3
};
this.generateKooken(token, options); // token
let shareInfo = {
title: this.shareInfo.title || '欢迎使用时空网小程序',
path: '/pages/route/index?route=home'
path: '/pages/route/index?token='+ token
}
if(this.shareInfo.cover){
shareInfo.imageUrl = this.shareInfo.cover;
}
@ -169,6 +269,7 @@
//
.com{
width: 100%;
height: 100%;
overflow: hidden;
.list{
border-radius: 10rpx;

6
pages/login/index.vue

@ -29,9 +29,9 @@
</checkbox-group>
<view class="lf-m-l-10 lf-font-24 lf-color-gray" style="display: inline-block;">
<text>请认真阅读并同意</text>
<text @click="enterAgree" style="color: #5c6ed1;">{{ agreement.title }}</text>
<text @click="enterAgree" class="text-orange">{{ agreement.title }}</text>
<text>在小程序下单购买即表示您已默认同意</text>
<text @click="enterAgree" style="color: #5c6ed1;">{{ agreement.title }}</text>
<text @click="enterAgree" class="text-orange">{{ agreement.title }}</text>
<text>的所有条款</text>
</view>
</view>
@ -59,7 +59,7 @@
methods: {
//
getAgree(){
this.$http(this.API.API_WXLOGIN_VIEW).then(res => {
this.$http(this.API.API_WXLOGIN_VIEW,{type: 'login'}).then(res => {
this.agreement = res.data?.agreement;
})
},

4
pages/order/apply-details.vue

@ -8,7 +8,7 @@
<view class="flex justify-between align-start" style="padding: 32rpx 32rpx 30rpx 32rpx;">
<image :src="orderDetails.order.goods.cover" mode="aspectFill" style="width: 240rpx; height: 240rpx;border-radius: 10rpx;"></image>
<view class="flex-sub padding-left-sm">
<view class="bref-box text-black1 lf-font-32 lf-font-bold" style="height: 88rpx;line-height: 44rpx;" v-if="orderDetails.order.goods.name">
<view class="bref-box text-black1 lf-line-2 lf-font-32 lf-font-bold" style="height: 88rpx;line-height: 44rpx;" v-if="orderDetails.order.goods.name">
{{orderDetails.order.goods.name}}
</view>
<text class="block text-gray lf-font-28" style="margin-top: 20rpx;line-height: 40rpx;">数量 <text class="margin-left margin-right-xs text-gray">x</text>{{orderDetails.order.number}}</text>
@ -65,7 +65,7 @@
<view class="padding-lr bg-white" style="padding-top: 30rpx;" v-if="checkArea">
<view class="cu-self menu">
<view class="text-gray lf-font-28">
由于产品的特殊性在申请的过程中供应商会向您收取部分费用如有疑问可参产品的<text @tap="$routerGo('/pages/agreement/agreement?id='+checkAreaId)" class="text-orange">{{checkArea}}</text>或咨询客服
由于产品的特殊性在申请的过程中供应商会向您收取部分费用如有疑问可参产品的<text @tap="$routerGo('/pages/agreement/agreement?id='+checkAreaId)" class="text-orange">{{checkArea}}</text>或咨询客服
</view>
</view>
</view>

25
pages/order/apply-refund.vue

@ -8,7 +8,7 @@
<view class="flex justify-between align-start" style="padding: 32rpx 32rpx 30rpx 32rpx;">
<image :src="applyDetails.order.goods.cover" mode="aspectFill" style="width: 240rpx; height: 240rpx;border-radius: 10rpx;"></image>
<view class="flex-sub padding-left-sm">
<view class="bref-box text-black1 lf-font-32 lf-font-bold" style="height: 88rpx;line-height: 44rpx;" v-if="applyDetails.order.goods.name">
<view class="bref-box text-black1 lf-line-2 lf-font-32 lf-font-bold" style="height: 88rpx;line-height: 44rpx;" v-if="applyDetails.order.goods.name">
{{applyDetails.order.goods.name}}
</view>
<text class="block text-gray lf-font-28" style="margin-top: 20rpx;line-height: 40rpx;">数量 <text class="margin-left margin-right-xs text-gray">x</text>{{applyDetails.order.number}}</text>
@ -66,7 +66,7 @@
<view class="padding-top padding-lr bg-white" v-if="applyDetails.agreement.article_id">
<view class="cu-self menu">
<view class="text-gray lf-font-28">
由于产品的特殊性在申请的过程中供应商会向您收取部分费用如有疑问可参产品的<text class="text-orange" @tap="$routerGo('/pages/agreement/agreement?id='+applyDetails.agreement.article_id)">{{applyDetails.agreement.title}}</text>或咨询客服
由于产品的特殊性在申请的过程中供应商会向您收取部分费用如有疑问可参产品的<text class="text-orange" @tap="$routerGo('/pages/agreement/agreement?id='+applyDetails.agreement.article_id)">{{applyDetails.agreement.title}}</text>或咨询客服
</view>
</view>
</view>
@ -77,8 +77,9 @@
<view class="cu-self menu">
<view class="lf-font-32 text-black1">退款说明</view>
</view>
<view class="cu-self menu" style="margin-top: 30rpx;">
<textarea :cursor-spacing="120" :adjust-position="true" type="text" v-model="applyInfo" class="text-left lf-font-32 area-self" placeholder="请输入反馈信息" />
<view class="cu-self menu" style="margin-top: 30rpx;position: relative;">
<textarea :cursor-spacing="120" maxlength="300" :adjust-position="true" type="text" v-model="applyInfo" class="text-left lf-font-32 area-self" placeholder="请输入反馈信息" />
<view class="font-change">{{ dynamicLength() }}/300</view>
</view>
</view>
<view class="cu-form-group">
@ -143,6 +144,9 @@
},1000)
},
methods: {
dynamicLength(){
return parseInt(this.applyInfo.length);
},
getApplyDetails() {
this.$http(this.API.API_APPLY_DETAILS, {order_id: this.order_id}).then(res => {
if(res.code == 0) {
@ -339,10 +343,17 @@
}
.area-self {
width: 100%;
padding: 30rpx 0 0 30rpx;
color: #999999;
padding: 30rpx;
padding-bottom: 36rpx;
color: #333;
border: 1px solid #D0D0D0;
border-radius: 10rpx;
}
.font-change{
position: absolute;
right: 10rpx;
bottom: 10rpx;
width: max-content;
color: #777777;
}
</style>

6
pages/order/confirm-atonce.vue

@ -8,7 +8,7 @@
<view class="flex justify-between align-start padding-top-sm padding-lr">
<image :src="orderDetails.goods.cover" mode="aspectFill" style="width: 240rpx; height: 240rpx;border-radius: 10rpx;"></image>
<view class="flex-sub padding-left-sm">
<view class="bref-box margin-top-xs lf-font-32 lf-font-bold" style="height: 88rpx;line-height: 44rpx;color: #222;">
<view class="bref-box margin-top-xs lf-line-2 lf-font-32 lf-font-bold" style="height: 88rpx;line-height: 44rpx;color: #222;">
{{orderDetails.goods.name}}
</view>
<view class="flex justify-between align-center text-center">
@ -111,9 +111,8 @@
this.order_id = e.order_id;
this.goods_specs_id = e.goods_specs_id
this.num = e.order_number
if(this.goods_id && this.goods_specs_id) {
if(this.goods_id && this.goods_specs_id && this.order_id) {
this.getConfirmOrder()
this.submit()
}
},
@ -189,7 +188,6 @@
});
},
pay(){
console.log("this.order_id", this.order_id)
this.$http(this.API.API_PAYMENT_DIRECT, {order_id: this.order_id}).then(res => {
this.order_id = res.data.order_id
uni.requestPayment({

58
pages/order/confirm-order.vue

@ -8,7 +8,7 @@
<view class="flex justify-between align-start padding-top-sm padding-lr">
<image :src="orderDetails.goods.cover" mode="aspectFill" style="width: 240rpx; height: 240rpx;border-radius: 10rpx;"></image>
<view class="flex-sub padding-left-sm">
<view class="bref-box margin-top-xs lf-font-32 lf-font-bold" style="height: 88rpx;line-height: 44rpx;color: #222;">
<view class="bref-box lf-font-32 lf-line-2 lf-font-bold" style="height: 88rpx;line-height: 44rpx;color: #222;">
{{orderDetails.goods.name}}
</view>
<view class="flex justify-between align-center text-center">
@ -21,11 +21,11 @@
</view>
<view class="flex justify-between margin-top-sm">
<lf-price :price="orderDetails.goods.specs[0].selling_price" />
<lf-price :price="orderDetails.goods.specs[choose_tag].selling_price" />
<!-- <view class="text-red text-price lf-font-42 lf-font-bold" style="margin-top: 12rpx;">
{{Number(orderDetails.goods.specs[0].selling_price || 0)}}
{{Number(orderDetails.goods.specs[choose_tag].selling_price || 0)}}
</view> -->
</view>
</view>
@ -54,19 +54,20 @@
</view>
</checkbox-group>
<view class="lf-font-24 text-gray">
请认真阅读并同意<text @tap="$routerGo('/pages/agreement/agreement?id='+orderDetails.agreement.article_id)">{{orderDetails.agreement.title}}</text>在小程序下单购买即表示您已默认同意<text @tap="$routerGo('/pages/agreement/agreement?id='+orderDetails.agreement.article_id)">{{orderDetails.agreement.title}}</text>的所有条款
请认真阅读并同意<text @tap="$routerGo('/pages/agreement/agreement?id='+orderDetails.agreement.article_id)" class="text-orange">{{orderDetails.agreement.title}}</text>在小程序下单购买即表示您已默认同意<text class="text-orange" @tap="$routerGo('/pages/agreement/agreement?id='+orderDetails.agreement.article_id)">{{orderDetails.agreement.title}}</text>的所有条款
</view>
</view>
<view class="padding-lr padding-tb-sm bg-white flex justify-between align-center shadow">
<view class="flex align-center">
<text class="lf-font-28 text-gray">应付款</text>
<lf-price :price="total(num, orderDetails.goods.specs[0].selling_price)" />
<lf-price :price="total(num, orderDetails.goods.specs[choose_tag].selling_price)" />
<!-- <view class="text-red text-price lf-font-42 lf-font-bold">
{{ total(num, orderDetails.goods.specs[0].selling_price) }}
{{ total(num, orderDetails.goods.specs[choose_tag].selling_price) }}
</view> -->
</view>
<button class="cu-btn block bg-orange round shadow" @tap="submit">
<button class="btn" @tap="submit">
<text class="lf-font-32 text-white" v-if="type == 1">立即付款</text>
<text class="lf-font-32 text-white" v-else>下单付款</text>
</button>
@ -99,7 +100,10 @@
order_id: 0,
ifDo: 1,
ifPay: true,
limit: 1
limit: 1,
pt: 1,
share_id: 1,
choose_tag: 0
}
},
computed: {
@ -123,8 +127,12 @@
onLoad(e) {
this.type = e.type;
this.goods_id = e.goods_id;
this.pt = e.pt || 1;
this.order_id = e.order_id;
this.goods_specs_id = e.goods_specs_id
this.share_id = e.share_id
this.choose_tag = e.choose_tag
console.log('xuanze',this.choose_tag)
if(this.goods_id && this.goods_specs_id) {
this.getConfirmOrder()
}
@ -132,9 +140,13 @@
methods: {
changeNum(num) {
if(num > this.limit) {
this.$msg('该商品限购数量'+this.limit)
this.num = this.limit
return
if(this.limit == 0 || this.limit == '') {
this.num = num
}else {
this.$msg('该商品限购'+this.limit+'件')
this.num = this.limit
return
}
}else if(num < 1) {
this.num = 1
}
@ -142,20 +154,22 @@
getConfirmOrder() {
this.$http(this.API.API_COFIRMORDER_DETAILS, {goods_id: this.goods_id,goods_specs_id: this.goods_specs_id}).then(res => {
this.orderDetails = res.data
this.limit = res.data.goods.specs[0].limit
this.limit = res.data.goods.specs[this.choose_tag].limit
// this.limit = 10
this.skeletonLoading = false
})
},
reduce() {
if (this.num === 1) return
if (this.num === 1 || this.num === 0) return
this.num--
},
add() {
if(this.num < this.limit) {
this.num++
}else if(this.limit == 0 || this.limit == ''){
this.num++
}else {
this.$msg('该商品限购数量'+this.limit)
this.$msg('该商品限购'+this.limit+'件')
this.num = this.limit
return
}
@ -175,7 +189,7 @@
});
},
submit(){
if(this.total(this.num,this.orderDetails.goods.specs[0].selling_price) == 0) {
if(this.total(this.num,this.orderDetails.goods.specs[this.choose_tag].selling_price) == 0) {
this.num = 1
return this.$msg('商品数量格式不对!');
}
@ -190,6 +204,8 @@
goods_id: this.goods_id,
goods_specs_id: this.goods_specs_id,
number: this.num,
payment_desc: this.pt,
share_one: this.share_id || 0
}).then(res => {
this.order_id = res.data.order_id
uni.requestPayment({
@ -229,7 +245,6 @@
}
},
pay(){
console.log("this.order_id", this.order_id)
this.$http(this.API.API_PAYMENT_DIRECT, {order_id: this.order_id}).then(res => {
this.order_id = res.data.order_id
uni.requestPayment({
@ -267,6 +282,17 @@
</script>
<style lang="scss" scoped>
.btn{
margin: 0;
padding: 0;
width: 208rpx;
height: 80rpx;
background-color: #FE9903;
color: #FFFFFF;
line-height: 80rpx;
font-size: 32rpx;
border-radius: 42rpx;
}
.bref-box {
text-overflow: -o-ellipsis-lastline;
overflow: hidden;

206
pages/order/index.vue

@ -4,47 +4,51 @@
<view class="padding-lr" style="margin-bottom: 10rpx;margin-top: 20rpx;">
<me-tabs v-model="current" :tabs="tab_list" :fixed="true" @change="change"></me-tabs>
</view>
<view class="com" v-for="(tab, tabIndex) in tab_list" v-if="tabIndex == current" :key="tab.id">
<view class="flex-direction justify-around list" v-for="(item, index) in tab.list" :key="item.id" @tap="goDetails(tabIndex,index)">
<view class="lf-row-between">
<view class="left" style="position: relative;display: flex;">
<image :src="item.goods.cover" mode=""></image>
<view class="cu-tag badge tag-self lf-font-28 font-400" :style="{'background-color':item.state_text.bg_color,'color':item.state_text.color}">{{item.state_text.text}}</view>
</view>
<view class="right">
<view class="lf-line-2 title" style="line-height: 40rpx;">{{item.goods.name}}</view>
<view class="lf-flex tips" style="margin: 0!important;">
<text class="progress margin-right-xs">数量</text>
<text class="bought">x {{item.number}}</text>
<swiper :style="{height: 'calc('+ windowHeight +'px - 110rpx)', width: '750rpx'}" :current="current" @change="swiperChange">
<swiper-item v-for="(tab, tabIndex) in tab_list" :key="tabIndex">
<scroll-view class="com" :scroll-y="true" :refresher-enabled="true" :refresher-triggered="isRefresher" @scrolltolower="onScrolltolower" @refresherrefresh="onRefresherrefresh">
<view class="flex-direction justify-around list" v-for="(item, index) in tab.list" :key="item.id" @tap="goDetails(tabIndex,index)">
<view class="lf-row-between">
<view class="left" style="position: relative;display: flex;">
<image :src="item.goods.cover" mode="aspectFill"></image>
<view class="cu-tag badge tag-self lf-font-28 font-400" :style="{'background-color':item.state_text.bg_color,'color':item.state_text.color}">{{item.state_text.text}}</view>
</view>
<view class="right">
<view class="lf-line-2 title" style="line-height: 40rpx;">{{item.goods.name}}</view>
<view class="lf-flex tips" style="margin: 0!important;">
<text class="progress margin-right-xs">数量</text>
<text class="bought">x {{item.number}}</text>
</view>
<view class="lf-row-between price" style="padding-right: 6rpx;">
<lf-price :price="item.selling_price" style="margin-top: 10rpx;" />
<button v-if="item.state==1" class="lf-font-28" style="border-radius: 30rpx;" @tap.stop="$routerGo('/pages/order/confirm-atonce?type=1&goods_id='+item.goods_id+'&goods_specs_id='+item.goods_specs_id +'&order_id='+ item.id+'&order_number='+item.number)">立即付款</button>
<button v-if="item.state==2" style="border-radius: 30rpx;" class="cu-btn bg-green round margin-left-sm lf-font-28" @tap.stop="$routerGo('/pages/order/order-details?order_id='+item.id)">立即使用</button>
<button v-if="item.state==4" class="cu-btn1 border margin-left-sm lf-font-28" style="border-radius: 30rpx;">等待审核</button>
</view>
</view>
</view>
<view class="lf-row-between price" style="padding-right: 6rpx;">
<lf-price :price="item.selling_price" style="margin-top: 10rpx;" />
<button v-if="item.state==1" class="lf-font-28" @tap.stop="$routerGo('/pages/order/confirm-atonce?type=1&goods_id='+item.goods_id+'&goods_specs_id='+item.goods_specs_id +'&order_id='+ item.id+'&order_number='+item.number)">立即付款</button>
<button v-if="item.state==2" class="cu-btn bg-green round margin-left-sm lf-font-28" @tap.stop="$routerGo('/pages/order/order-details?order_id='+item.id)">立即使用</button>
<button v-if="item.state==4" class="cu-btn1 border round margin-left-sm lf-font-28">等待审核</button>
<view>
<view class="solid-top flex justify-between align-center text-center">
<view class="text-gray lf-font-28" style="padding: 20rpx;">
{{item.created_at_text}}
</view>
<view class="text-orange" v-if="item.state==1" style="padding: 20rpx 24rpx 20rpx 20rpx;">
{{item.comment_text}}
</view>
</view>
</view>
</view>
</view>
<view>
<view class="solid-top flex justify-between align-center text-center">
<view class="text-gray lf-font-28" style="padding: 20rpx;">
{{item.created_at_text}}
</view>
<view class="text-orange" v-if="item.state==1" style="padding: 20rpx 24rpx 20rpx 20rpx;">
{{item.comment_text}}
</view>
<!-- 空数据的情况 -->
<view class="loading-more">
<text v-if="tab.list.length"
:class="{'loading-more-text': tab.loadingClass}">{{ tab.loadingText }}</text>
<my-nocontent v-else></my-nocontent>
</view>
</view>
</view>
<!-- 加载 -->
<view class="loading-more">
<text v-if="tab.list.length"
:class="{'loading-more-text': tab.loadingClass}">{{ tab.loadingText }}</text>
<my-nocontent v-else></my-nocontent>
</view>
<!-- 回到顶部 -->
<u-back-top :scroll-top="pageScrollTop" :custom-style="{background: 'rgba(51, 51 51, 0.3)'}"></u-back-top>
</view>
<!-- 回到顶部 -->
<u-back-top :scroll-top="pageScrollTop" :custom-style="{background: 'rgba(51, 51 51, 0.3)'}"></u-back-top>
</scroll-view>
</swiper-item>
</swiper>
</view>
</template>
@ -100,20 +104,18 @@
pageSize: 10,
assetsType: '', //
orderType: [],
showLogin: true
showLogin: true,
windowHeight: 0, //
isRefresher: false // scroll-view
}
},
onLoad(e) {
this.windowHeight = getApp().globalData.windowHeight;
this.assetsType = e.type;
},
onShow() {
this.verifyUserInfo();
let tab_item = this.tab_list[this.current];
tab_item.page = 1;
tab_item.isPage = true;
tab_item.loadingClass = true;
tab_item.loadingText = '正在加载中';
this.getUserOrder();
this.refreshFn({});
},
methods: {
//
@ -134,6 +136,12 @@
this.current = index;
this.getUserOrder();
},
//
swiperChange(event){
this.current = event.detail.current;
if(event.detail.source == '') return; //
this.getUserOrder();
},
goDetails(tabIndex,index) {
console.log(tabIndex,index)
let item = this.tab_list[tabIndex].list[index]
@ -146,23 +154,8 @@
}
},
onReachBottom() {
let tab_item = this.tab_list[this.current];
if (tab_item.isPage) {
tab_item.page = tab_item.page + 1;
this.getUserOrder();
}
},
onPullDownRefresh() {
let tab_item = this.tab_list[this.current];
tab_item.page = 1;
tab_item.isPage = true;
tab_item.loadingClass = true;
tab_item.loadingText = '正在加载中';
this.getUserOrder();
uni.stopPullDownRefresh()
},
getUserOrder() {
getUserOrder(options = {}) {
let per_page = this.pageSize;
let tab_item = this.tab_list[this.current];
this.$http(this.API.API_USERORDER, {
@ -170,57 +163,55 @@
page: tab_item.page,
per_page
}).then(res => {
if (res.code == 0) {
console.log(res)
if( Object.keys(res.metal_data).length != 0 ) {
this.$routerGo('/pages/login/index?type=userinfo')
}else {
let isPage = res.data.has_more_page;
tab_item.isPage = isPage;
if (isPage) {
tab_item.loadingClass = true;
tab_item.loadingText = '正在加载中';
} else {
tab_item.loadingClass = false;
tab_item.loadingText = '没有更多数据啦~';
}
if (tab_item.page == 1) {
tab_item.list = res.data.items;
} else {
tab_item.list.push(...res.data.items);
}
if( Object.keys(res.metal_data).length != 0 ) {
this.$routerGo('/pages/login/index?type=userinfo')
}else {
let isPage = res.data.has_more_page;
tab_item.isPage = isPage;
if (!isPage) {
tab_item.loadingClass = false;
tab_item.loadingText = '没有更多数据啦~';
}
if(options.type == 'pageRefresh'){
uni.stopPullDownRefresh();
}else if(options.type == 'scrollRefresh'){
this.isRefresher = false;
}
if (tab_item.page == 1) {
tab_item.list = res.data.items;
} else {
tab_item.list.push(...res.data.items);
}
}
}).catch(err => {
});
})
},
//
back() {
if (this.assetsType === 'all2') {
// #ifdef H5
window.history.go(-2)
// #endif
// #ifndef H5
uni.navigateBack({
delta: 2
});
// #endif
} else {
// #ifdef H5
window.history.go(-1)
// #endif
// #ifndef H5
uni.navigateBack({
delta: 1
});
// #endif
//
onScrolltolower(){
let tab_item = this.tab_list[this.current];
if(tab_item.isPage){
tab_item.page = tab_item.page + 1;
this.getUserOrder();
}
},
// scroll-view
onRefresherrefresh(){
this.isRefresher = true;
this.refreshFn({type: 'scrollRefresh'});
},
//
refreshFn(options){
let tab_item = this.tab_list[this.current];
tab_item.page = 1;
tab_item.isPage = true;
tab_item.loadingClass = true;
tab_item.list = []
tab_item.loadingText = '正在加载中';
this.getUserOrder(options);
}
},
onPullDownRefresh() {
this.refreshFn({type: 'pageRefresh'});
}
}
</script>
@ -258,7 +249,7 @@
.title {
font-size: 28rpx;
color: $u-content-color;
height: 98rpx;
height: 80rpx;
}
// tab
@ -271,6 +262,7 @@
//
.com {
width: 100%;
height: 100%;
overflow: hidden;
.list {

10
pages/order/order-details.vue

@ -7,7 +7,7 @@
<view class="flex justify-between align-start" style="padding: 32rpx 32rpx 30rpx 32rpx;">
<image :src="orderDetails.goods.cover" mode="aspectFill" style="width: 240rpx; height: 240rpx;border-radius: 10rpx;"></image>
<view class="flex-sub padding-left-sm">
<view class="bref-box text-black1 lf-font-32 lf-font-bold" style="height: 88rpx;line-height: 44rpx;" v-if="orderDetails.goods.name">
<view class="bref-box lf-line-2 text-black1 lf-font-32 lf-font-bold" style="height: 88rpx;line-height: 44rpx;" v-if="orderDetails.goods.name">
{{orderDetails.goods.name}}
</view>
<text class="block text-gray lf-font-28" style="margin-top: 20rpx;line-height: 40rpx;">数量 <text class="margin-left margin-right-xs text-gray">x</text>{{orderDetails.number}}</text>
@ -17,7 +17,8 @@
<view>
<button v-if="orderDetails.state == 2" class="cu-btn line-orange text-orange round margin-left-sm lf-font-28" @tap="$routerGo('/pages/order/apply-refund?order_id='+orderDetails.id)">申请退款</button>
<button v-if="orderDetails.state == 1" class="cu-btn line-orange text-orange round margin-left-sm lf-font-28" @tap.stop="$routerGo('/pages/order/confirm-atonce?type=1&goods_id='+orderDetails.goods_id+'&goods_specs_id='+orderDetails.goods_specs_id +'&order_id='+ orderDetails.id+'&order_number='+orderDetails.number)">立即付款</button>
<button v-if="orderDetails.state != 1 && orderDetails.state != 2" class="cu-btn1 border round margin-left-sm lf-font-28">{{orderDetails.state_text.text}}</button>
<button v-if="orderDetails.state == 3" class="cu-btn1 margin-left-sm lf-font-28" style="width: 176rpx;height: 60rpx;line-height: 60rpx;border-radius: 30rpx;background: none;border: 1px solid #1E89FF;color: #1E89FF;">{{orderDetails.state_text.text}}</button>
<button v-if="orderDetails.state != 1 && orderDetails.state != 2 && orderDetails.state != 3" class="cu-btn1 border round margin-left-sm lf-font-28 text-gray" style="width: 176rpx;height: 60rpx;line-height: 60rpx;border-radius: 30rpx;background: none;">{{orderDetails.state_text.text}}</button>
</view>
</view>
</view>
@ -69,11 +70,14 @@
<view class="lf-font-32 text-black1">{{checkArea}} <text style="position: relative;left: 216rpx;top: -42rpx;display: inherit;" v-if="orderDetails.state == 2" class="text-orange lf-font-28" @tap="copy(checkArea)">复制</text></view>
</view>
<view v-if="orderDetails.state == 5 || orderDetails.state == 6" style="margin-top: 46rpx;" class="text-gray lf-font-28">
{{orderDetails.refund_text}}
已使用
</view>
<view v-else style="margin-top: 10rpx;" class="text-gray lf-font-28">
{{orderDetails.refund_text}}
</view>
<view v-if="orderDetails.state == 3" style="margin-top: 46rpx;" class="text-gray lf-font-28">
已使用
</view>
<view style="margin-top: 10rpx;">
<view class="text-green lf-font-32" v-if="orderDetails.state == 2">
{{orderDetails.confirm_code_text}}

16
pages/order/pay-success.vue

@ -5,7 +5,7 @@
<image src="@/static/images/system/paysuccess.png" mode="widthFix" style="height: 100px;width: 100px;"></image>
</view>
<view class="text-xxl margin-tb text-orange text-bold">订单支付成功</view>
<view class="text-gray">
<view class="text-gray" v-if="type!=3">
您可以在我的订单中查询订单详情
</view>
</view>
@ -14,19 +14,19 @@
<image src="@/static/images/system/payfail.png" mode="widthFix" style="height: 100px;width: 100px;"></image>
</view>
<view class="text-xxl margin-tb text-gray text-bold">订单支付失败</view>
<view class="text-gray">
<view class="text-gray" v-if="type!=3">
您可以在我的订单中查询订单详情
</view>
</view>
<view class="margin-top flex flex-direction justify-around">
<view class="padding-top padding-lr-lg">
<view class="padding-top padding-lr-lg" v-if="type!=3">
<button class="cu-btn block bg-orange lg margin-top round" @tap="$url('/pages/order/order-details?order_id='+order_id,{type: 'launch'})">
<text class="text-df text-white">查看订单</text>
<text class="lf-font-32 text-white">查看订单</text>
</button>
</view>
<view class="padding-top-sm padding-lr-lg">
<button class="cu-btn block bg-white border lg margin-top round" @tap="$url('/pages/index/index',{type: 'switch'})">
<text class="text-df text-black">返回首页</text>
<button class="cu-btn block bg-white lg margin-top round" style="border: 1px solid #555;" @tap="$url('/pages/index/index',{type: 'switch'})">
<text class="lf-font-32" style="color: #555!important;">返回首页</text>
</button>
</view>
</view>
@ -38,12 +38,14 @@
data() {
return {
ifpaySuccess:-1,
order_id: 1
order_id: 1,
type: -1
}
},
onLoad(e) {
this.ifpaySuccess = e.ifSuccess
this.order_id = e.order_id
this.type = e.type
}
}
</script>

3
pages/order/unpay-details.vue

@ -2,14 +2,13 @@
<view>
<!-- 商品信息 -->
<block v-if="isRight(orderDetails)">
<self-line/>
<view class="bg-white">
<skeleton :loading="skeletonLoading" :row="2" :showAvatar="false" :showTitle="true">
<view class="flex justify-between align-start" style="padding: 32rpx 32rpx 30rpx 32rpx;">
<image :src="orderDetails.goods.cover" mode="aspectFill" style="width: 240rpx; height: 240rpx;border-radius: 10rpx;"></image>
<view class="flex-sub padding-left-sm">
<view class="bref-box text-black1 lf-font-32 lf-font-bold" style="height: 88rpx;line-height: 44rpx;" v-if="orderDetails.goods.name">
<view class="bref-box text-black1 lf-line-2 lf-font-32 lf-font-bold" style="height: 88rpx;line-height: 44rpx;" v-if="orderDetails.goods.name">
{{orderDetails.goods.name}}
</view>
<text class="block text-gray lf-font-28" style="margin-top: 20rpx;line-height: 40rpx;">数量 <text class="margin-left margin-right-xs text-gray">x</text>{{orderDetails.number}}</text>

76
pages/route/index - 副本.vue

@ -0,0 +1,76 @@
<template>
<view></view>
</template>
<script>
/* 路由分发页面仅供跳转页面 */
export default {
onLoad(options){
console.log('wai',options)
if(this.$shared.isValueType(options.scene) != 'undefined'){
const scene = decodeURIComponent(options.scene); //
const par = this.strToObj(scene);
this.routeToPage(par);
console.log('内部',options)
console.log('====',par)
}else{
this.routeToPage(options); //
}
},
methods: {
//
routeToPage(options){
if(options.route == 'goods_detail' || options.route == 'goods'){
options.page_url = '/pages/goodsDetail/index';
this.joinPagePath(options);
}else if(options.route == 'home'){
options.page_url = '/pages/index/index';
options.is_tabbar = true; // tabbar
this.joinPagePath(options);
}else{
let obj = {
page_url: '/pages/index/index', //
is_tabbar: true
};
this.joinPagePath(obj);
}
},
//
joinPagePath(par){
let path = par.page_url;
let options = {}; // switch
let flag = true; //
for(let i in par){
if(i != 'route' && i != 'page_url' && i != 'is_tabbar'){ // routepage_urlis_tabbar
options[i] = par[i];
if(flag){
path += '?'+ i +'='+ par[i];
flag = false;
}else{
path += '&'+ i +'='+ par[i];
}
}
}
console.log(par);
if(par.is_tabbar){
uni.setStorageSync('homePageOptions', options);
this.$url(par.page_url, {type: 'switch'});
}else{
this.$url(path, {type: 'redirect'});
}
},
// key=value&key=value
strToObj(str){
let obj = {};
if(!str) return obj;
let arr = str.split('&');
arr.map(item => {
let a = item.split('=');
obj[a[0]] = a[1];
});
return obj;
}
}
}
</script>

47
pages/route/index.vue

@ -6,12 +6,37 @@
/* 路由分发页面仅供跳转页面 */
export default {
onLoad(options){
this.routeToPage(options);
console.log('wai',options)
if(this.$shared.isValueType(options.scene) != 'undefined'){
const scene = decodeURIComponent(options.scene); //
// const par = this.strToObj(scene);
// this.routeToPage(par);
// console.log('',options)
// console.log('====',par)
this.getTokenValue(scene);
}else{
// this.routeToPage(options);
//
this.getTokenValue(options.token);
}
},
methods: {
getTokenValue(token){
this.$http(this.API.API_WAREHOUSE_GET, {key: token}).then(res => {
console.log("getTokenValue", res);
let options = decodeURIComponent(res.data);
options = JSON.parse(options);
console.log("options", options)
this.routeToPage(options);
}).catch(err => {
// token
this.$url('/pages/index/index', {type: 'switch'});
})
},
//
routeToPage(options){
if(options.route == 'goods_detail'){
if(options.route == 'goods_detail' || options.route == 'goods'){
options.page_url = '/pages/goodsDetail/index';
this.joinPagePath(options);
}else if(options.route == 'home'){
@ -29,9 +54,11 @@
//
joinPagePath(par){
let path = par.page_url;
let options = {}; // switch
let flag = true; //
for(let i in par){
if(i != 'route' && i != 'page_url' && i != 'is_tabbar'){ // routepage_urlis_tabbar
options[i] = par[i];
if(flag){
path += '?'+ i +'='+ par[i];
flag = false;
@ -40,11 +67,25 @@
}
}
}
console.log(par);
if(par.is_tabbar){
this.$url(path, {type: 'switch'});
uni.setStorageSync('homePageOptions', options);
this.$url(par.page_url, {type: 'switch'});
}else{
this.$url(path, {type: 'redirect'});
}
},
// key=value&key=value
strToObj(str){
let obj = {};
if(!str) return obj;
let arr = str.split('&');
arr.map(item => {
let a = item.split('=');
obj[a[0]] = a[1];
});
return obj;
}
}
}

144
pages/shopOrder/index.vue

@ -3,44 +3,48 @@
<view class="padding-lr" style="margin-bottom: 10rpx;margin-top: 20rpx;">
<me-tabs v-model="current" :tabs="tab_list" :fixed="true" @change="change"></me-tabs>
</view>
<view class="com" v-for="(tab, tabIndex) in tab_list" v-if="tabIndex == current" :key="tab.id">
<view class="flex-direction justify-around list" v-for="(item, index) in tab.list" :key="item.id" @tap="goDetails(tabIndex,index)">
<view class="lf-row-between">
<view class="left" style="position: relative;">
<image :src="item.goods.cover" mode=""></image>
<view class="cu-tag badge tag-self lf-font-28" :style="{'background-color':item.state_text.bg_color,'color':item.state_text.color}">{{item.state_text.text}}</view>
</view>
<view class="right">
<view class="lf-line-2 title" style="line-height: 40rpx;">{{item.goods.name}}</view>
<view class="lf-flex tips" style="margin: 0!important;">
<text class="progress margin-right-xs">数量</text>
<text class="bought">x {{item.number}}</text>
<swiper :style="{height: 'calc('+ windowHeight +'px - 110rpx)', width: '750rpx'}" :current="current" @change="swiperChange">
<swiper-item v-for="(tab, tabIndex) in tab_list" :key="tabIndex">
<scroll-view class="com" :scroll-y="true" :refresher-enabled="true" :refresher-triggered="isRefresher" @scrolltolower="onScrolltolower" @refresherrefresh="onRefresherrefresh">
<view class="flex-direction justify-around list" v-for="(item, index) in tab.list" :key="item.id" @tap="goDetails(tabIndex,index)">
<view class="lf-row-between">
<view class="left" style="position: relative;">
<image :src="item.goods.cover" mode=""></image>
<view class="cu-tag badge tag-self lf-font-28" :style="{'background-color':item.state_text.bg_color,'color':item.state_text.color}">{{item.state_text.text}}</view>
</view>
<view class="right">
<view class="lf-line-2 title" style="line-height: 40rpx;">{{item.goods.name}}</view>
<view class="lf-flex tips" style="margin: 0!important;">
<text class="progress margin-right-xs">数量</text>
<text class="bought">x {{item.number}}</text>
</view>
<view class="lf-row-between price">
<lf-price :price="item.selling_price" style="margin-top: 10rpx;" />
</view>
</view>
</view>
<view class="lf-row-between price">
<lf-price :price="item.selling_price" style="margin-top: 10rpx;" />
<view>
<view class="u-border-top flex justify-between align-center text-center">
<view class="text-gray lf-font-28" style="padding: 20rpx;">
{{item.created_at_text}}
</view>
<view class="text-orange" v-if="item.state==1" style="padding: 20rpx;">
{{item.comment_text}}
</view>
</view>
</view>
</view>
</view>
<view>
<view class="u-border-top flex justify-between align-center text-center">
<view class="text-gray lf-font-28" style="padding: 20rpx;">
{{item.created_at_text}}
</view>
<view class="text-orange" v-if="item.state==1" style="padding: 20rpx;">
{{item.comment_text}}
</view>
<!-- 加载 -->
<view class="loading-more">
<text v-if="tab.list.length"
:class="{'loading-more-text': tab.loadingClass}">{{ tab.loadingText }}</text>
<my-nocontent v-else></my-nocontent>
</view>
</view>
</view>
<!-- 加载 -->
<view class="loading-more">
<text v-if="tab.list.length"
:class="{'loading-more-text': tab.loadingClass}">{{ tab.loadingText }}</text>
<my-nocontent v-else></my-nocontent>
</view>
<!-- 回到顶部 -->
<u-back-top :scroll-top="pageScrollTop" :custom-style="{background: 'rgba(51, 51 51, 0.3)'}"></u-back-top>
</view>
<!-- 回到顶部 -->
<u-back-top :scroll-top="pageScrollTop" :custom-style="{background: 'rgba(51, 51 51, 0.3)'}"></u-back-top>
</scroll-view>
</swiper-item>
</swiper>
</view>
</template>
@ -95,19 +99,17 @@
current: 0, // tab
pageSize: 10,
assetsType: '', //
orderType: []
orderType: [],
windowHeight: 0, //
isRefresher: false // scroll-view
}
},
onLoad(e) {
this.windowHeight = getApp().globalData.windowHeight;
this.assetsType = e.type
},
onShow() {
let tab_item = this.tab_list[this.current];
tab_item.page = 1;
tab_item.isPage = true;
tab_item.loadingClass = true;
tab_item.loadingText = '正在加载中';
this.getUserOrder();
this.refreshFn({});
},
methods: {
// tab
@ -115,27 +117,17 @@
this.current = index;
this.getUserOrder();
},
//
swiperChange(event){
this.current = event.detail.current;
if(event.detail.source == '') return; //
this.getUserOrder();
},
goDetails(tabIndex,index) {
let item = this.tab_list[tabIndex].list[index]
this.$routerGo('/pages/shopOrder/order-details?order_id=' + item.id)
},
onReachBottom() {
let tab_item = this.tab_list[this.current];
if (tab_item.isPage) {
tab_item.page = tab_item.page + 1;
this.getUserOrder();
}
},
onPullDownRefresh() {
let tab_item = this.tab_list[this.current];
tab_item.page = 1;
tab_item.isPage = true;
tab_item.loadingClass = true;
tab_item.loadingText = '正在加载中';
this.getUserOrder();
uni.stopPullDownRefresh()
},
getUserOrder() {
getUserOrder(options = {}) {
let per_page = this.pageSize;
let tab_item = this.tab_list[this.current];
this.$http(this.API.API_SHOPORDER, {
@ -145,21 +137,48 @@
}).then(res => {
let isPage = res.data.has_more_page;
tab_item.isPage = isPage;
if (isPage) {
tab_item.loadingClass = true;
tab_item.loadingText = '正在加载中';
} else {
if (!isPage) {
tab_item.loadingClass = false;
tab_item.loadingText = '没有更多数据啦~';
}
if(options.type == 'pageRefresh'){
uni.stopPullDownRefresh();
}else if(options.type == 'scrollRefresh'){
this.isRefresher = false;
}
if (tab_item.page == 1) {
tab_item.list = res.data.items;
} else {
tab_item.list.push(...res.data.items);
}
})
},
//
onScrolltolower(){
let tab_item = this.tab_list[this.current];
if(tab_item.isPage){
tab_item.page = tab_item.page + 1;
this.getUserOrder();
}
},
// scroll-view
onRefresherrefresh(){
this.isRefresher = true;
this.refreshFn({type: 'scrollRefresh'});
},
//
refreshFn(options){
let tab_item = this.tab_list[this.current];
tab_item.page = 1;
tab_item.isPage = true;
tab_item.loadingClass = true;
tab_item.loadingText = '正在加载中';
this.getUserOrder(options);
}
},
onPullDownRefresh() {
this.refreshFn({type: 'pageRefresh'});
},
}
</script>
@ -187,6 +206,7 @@
//
.com {
width: 100%;
height: 100%;
overflow: hidden;
.list {

BIN
static/center/fans.png

After

Width: 50  |  Height: 50  |  Size: 1.9 KiB

BIN
static/center/invite.png

After

Width: 50  |  Height: 50  |  Size: 1.9 KiB

BIN
static/center/wallet.png

After

Width: 50  |  Height: 50  |  Size: 1.2 KiB

BIN
static/images/bill.png

After

Width: 686  |  Height: 920  |  Size: 343 KiB

BIN
static/images/poster-1.jpg

After

Width: 549  |  Height: 984  |  Size: 185 KiB

6
uview-ui/components/u-tabs/u-tabs.vue

@ -178,7 +178,11 @@
// applist
list(n, o) {
// list
if(n.length !== o.length) this.currentIndex = 0;
if(n.length !== o.length){
this.currentIndex = 0;
}else{
return;
}
// $nextTicktabtab
this.$nextTick(() => {
this.init();

Loading…
Cancel
Save