Compare commits

...

46 Commits

Author SHA1 Message Date
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
Enzo 07715e8a38 粉丝页面 我的钱包 提现页面 邀请好友 我的页面 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
Enzo b9c043c249 二期海报修改 5 years ago
Enzo 815b4a9ae1 二维码海报 5 years ago
Enzo bdea625d67 二期海报 5 years ago
Enzo 7b1272af8c 二期海报 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. 12
      common/api.js
  3. 10
      common/styles/iconfont.css
  4. 2
      manifest.json
  5. 44
      pages.json
  6. 350
      pages/bill/bill.vue
  7. 168
      pages/center/bestar.vue
  8. 124
      pages/center/fans.vue
  9. 52
      pages/center/index.vue
  10. 337
      pages/center/invite.vue
  11. 217
      pages/center/wallet.vue
  12. 43
      pages/center/widthdraw.vue
  13. 26
      pages/collect/index.vue
  14. 2
      pages/contactService/index.vue
  15. 541
      pages/goodsDetail/index.vue
  16. 160
      pages/index/index.vue
  17. 6
      pages/login/index.vue
  18. 2
      pages/order/apply-details.vue
  19. 2
      pages/order/apply-refund.vue
  20. 4
      pages/order/confirm-atonce.vue
  21. 31
      pages/order/confirm-order.vue
  22. 202
      pages/order/index.vue
  23. 8
      pages/order/order-details.vue
  24. 12
      pages/order/pay-success.vue
  25. 1
      pages/order/unpay-details.vue
  26. 26
      pages/route/index.vue
  27. 143
      pages/shopOrder/index.vue
  28. BIN
      static/center/fans.png
  29. BIN
      static/center/invite.png
  30. BIN
      static/center/wallet.png
  31. BIN
      static/images/bill.png
  32. BIN
      static/images/poster-1.jpg

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;

12
common/api.js

@ -2,7 +2,7 @@
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 DEVURL = 'http://192.168.3.23'; // 测试服请求地址, 韦港电脑
export const PRODURL = ''; // 正式服请求地址
/* 首页相关接口 */
@ -57,6 +57,16 @@ 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_CONFIRM_CODE = '/api/confirm/code'; // 扫码核销

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";
}

2
manifest.json

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

44
pages.json

@ -7,21 +7,27 @@
"path": "pages/index/index",
"style": {
"navigationBarTitleText": "首页",
"enablePullDownRefresh": true
"enablePullDownRefresh": false
}
},
{
"path": "pages/bill/bill",
"style": {
"navigationBarTitleText": "生成海报"
}
},
{
"path": "pages/order/index",
"style": {
"navigationBarTitleText": "我的订单",
"enablePullDownRefresh": true
"enablePullDownRefresh": false
}
},
{
"path": "pages/shopOrder/index",
"style": {
"navigationBarTitleText": "商户订单",
"enablePullDownRefresh": true
"enablePullDownRefresh": false
}
},
{
@ -84,6 +90,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>

168
pages/center/bestar.vue

@ -0,0 +1,168 @@
<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">9.9</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">
<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">购买并支付¥9.9</text>
</button>
</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
checked: false, //
info: {},
ifPay: true,
checkedpay: true,
agreement: ''
}
},
methods: {
//
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()
}
}
</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.created_at}}</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}}
</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>

337
pages/center/invite.vue

@ -0,0 +1,337 @@
<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: 667px;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: 1000
});
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() {
this.$http(this.API.API_WXBILL, {
scene: 'route=home&id=2&pt=2',
page: 'pages/route/index',
width: '2800'
}).then(res => {
this.wxCode = res.data.base_url
if (this.wxCode) {
this.getwxCodeImg()
}
})
},
//
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, 667);
//
let wxcode = that.onceCode
context.drawImage(wxcode, 18, 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('海报生成成功,图片链接', 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>

217
pages/center/wallet.vue

@ -0,0 +1,217 @@
<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="$url('/pages/center/widthdraw')">提取佣金</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}}</view>
<view class="lf-font-32 text-black1">结余 ¥{{item.final_price}}</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}}</view>
<view class="lf-font-24 lf-color-999">{{item.created_at}}</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}}</view>
<view class="lf-font-28 text-orange">{{item.state}}</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}}</view>
<view class="lf-font-24 lf-color-999">{{item.created_at}}</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>
</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
}
},
onLoad(){
this.windowHeight = uni.getSystemInfoSync().windowHeight;
this.getIncomeList()
},
methods: {
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;
this.getIncomeList()
}
}
}
</script>
<style scoped lang="scss">
.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>

43
pages/center/widthdraw.vue

@ -0,0 +1,43 @@
<template>
<view class="wrap">
<web-view :src="'http://192.168.3.14:8080/?token='+userInfoToken"></web-view>
</view>
</template>
<script>
export default {
data() {
return {
userInfoToken: ''
}
},
methods: {
},
onLoad(e) {
let userInfo = uni.getStorageSync('userinfo') || {};
this.userInfoToken = userInfo.token
console.log(this.userInfoToken)
}
}
</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>

26
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="lf-font-24">取消收藏</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="lf-font-24">添加收藏</text>
</view>
</view>
</view>
<view class="lf-m-t-20 lf-font-24 lf-color-gray">{{ item.created_at_text }}</view>
@ -115,12 +123,12 @@
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;
}
}

2
pages/contactService/index.vue

@ -10,7 +10,7 @@
</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>

541
pages/goodsDetail/index.vue

@ -3,11 +3,18 @@
<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>
@ -23,7 +30,8 @@
</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 +39,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 +54,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 +96,233 @@
</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: 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="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: ''
}
},
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.getGoodsDetail();
this.getWxCode()
this.getBackground()
},
methods: {
getGoodsDetail(){
getBackground() {
let _this = this
_this.$http(_this.API.API_BILLBACKGROUND, {
type: 'goods'
}).then(res => {
let img = res.data.img_url
if (img) {
wx.getImageInfo({
src: img,
success: function(sres) {
_this.backgroundImg = sres.path
}
})
}
})
},
//
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: userInfo.id,
gid: _this.goods_id,
gn: _this.goods_detail.name,
t: gettime
}).then(res => {
console.log(res)
}).catch(err => {
console.log(err)
})
},
getWxCode() {
let userInfo = uni.getStorageSync('userinfo') || {};
this.$http(this.API.API_WXBILL, {
scene: 'route=goods&pt=2&id='+this.goods_id+'&share_id='+userInfo.id,
page: 'pages/route/index',
width: '2800'
}).then(res => {
this.wxCode = res.data.base_url
if (this.wxCode) {
this.getwxCodeImg()
}
})
},
//
//
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)
},
fail: err => {
console.log(err)
}
})
},
createNewImg() {
var that = this;
var context = wx.createCanvasContext('mycanvas');
var path = that.backgroundImg;
context.drawImage(path, 0, 0, 375, 667);
//
let wxcode = that.onceCode
context.drawImage(wxcode, 18, 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()
console.log(that.onceCode)
console.log(that.backgroundImg)
if(that.onceCode&&that.backgroundImg) {
that.createNewImg()
}else if(!that.onceCode){
this.$msg('小程序码生成失败!')
}else if(!that.backgroundImg){
this.$msg('海报背景图生成失败!')
}
},
//
getGoodsDetail() {
let that = this;
this.$http(this.API.API_GOODS_DETAIL, {goods_id: this.goods_id}).then(res => {
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) {
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 +332,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;
openMap() {
// return;
uni.openLocation({
longitude: 108.36637,
latitude: 22.817746,
scale: 18
})
longitude: 108.36637,
latitude: 22.817746,
scale: 18,
name: this.goods_detail.store.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);
this.$url('/pages/order/confirm-order?goods_id=' + goods_id + '&goods_specs_id=' + goods_specs_id +'&pt='+ this.pt);
},
//
lookImg(index){
lookImg(index) {
this.$u.throttle(() => {
let goods_banner = this.goods_detail.banners || [];
let banners = goods_banner.map(item => item.cover);
@ -166,32 +379,34 @@
}, 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;
}
}
},
onShareAppMessage(){
onShareAppMessage() {
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 path = '/pages/route/index?route=goods_detail&id=' + goods.id;
return {
title,
path,
@ -202,36 +417,65 @@
</script>
<style>
page{
page {
background-color: #f5f5f5;
overflow-x: hidden;
}
</style>
<style lang="scss" scoped="scoped">
.swiper-box{
.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 +486,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,42 +510,44 @@
}
}
}
.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;
@ -310,7 +558,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 +569,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 +592,159 @@
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: 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: rgba(254, 153, 3, 1);
color: #fff;
font-size: 32rpx;
border-radius: 44rpx;
}
button[class="baocun"]::after {
border: 0;
}
</style>

160
pages/index/index.vue

@ -1,62 +1,104 @@
<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
}
},
onLoad() {
onLoad(options) {
this.pt = options.pt || 1;
this.windowHeight = getApp().globalData.windowHeight;
this.getCategoryList();
this.getShareInfo();
if(this.pt == 2) {
this.bindUsders()
}
},
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: userInfo.id,
t: gettime
}).then(res => {
_this.$msg('提交审核成功');
}).catch(err => {
console.log(err)
})
},
//
getShareInfo(){
this.$http(this.API.API_SHARE_HOME).then(res => {
@ -70,8 +112,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 +135,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();
})
@ -116,18 +171,25 @@
//
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'});
}
},
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,7 +198,6 @@
// tab_item.loadingClass = true;
// tab_item.loadingText = '';
// this.getGoodsList();
uni.stopPullDownRefresh()
},
onShareAppMessage(){
let shareInfo = {
@ -169,6 +230,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;
})
},

2
pages/order/apply-details.vue

@ -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>

2
pages/order/apply-refund.vue

@ -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>

4
pages/order/confirm-atonce.vue

@ -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({

31
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-font-bold" style="height: 88rpx;line-height: 44rpx;color: #222;">
{{orderDetails.goods.name}}
</view>
<view class="flex justify-between align-center text-center">
@ -54,7 +54,7 @@
</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">
@ -66,7 +66,8 @@
{{ total(num, orderDetails.goods.specs[0].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,9 @@
order_id: 0,
ifDo: 1,
ifPay: true,
limit: 1
limit: 1,
pt: 1,
share_id: 1
}
},
computed: {
@ -123,8 +126,10 @@
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
if(this.goods_id && this.goods_specs_id) {
this.getConfirmOrder()
}
@ -132,7 +137,7 @@
methods: {
changeNum(num) {
if(num > this.limit) {
this.$msg('该商品限购数量'+this.limit)
this.$msg('该商品限购'+this.limit+'件')
this.num = this.limit
return
}else if(num < 1) {
@ -155,7 +160,7 @@
if(this.num < this.limit) {
this.num++
}else {
this.$msg('该商品限购数量'+this.limit)
this.$msg('该商品限购'+this.limit+'件')
this.num = this.limit
return
}
@ -190,6 +195,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
}).then(res => {
this.order_id = res.data.order_id
uni.requestPayment({
@ -229,7 +236,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 +273,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;

202
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,54 @@
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.loadingText = '正在加载中';
this.getUserOrder(options);
}
},
onPullDownRefresh() {
this.refreshFn({type: 'pageRefresh'});
}
}
</script>

8
pages/order/order-details.vue

@ -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}}

12
pages/order/pay-success.vue

@ -19,14 +19,14 @@
</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>

1
pages/order/unpay-details.vue

@ -2,7 +2,6 @@
<view>
<!-- 商品信息 -->
<block v-if="isRight(orderDetails)">
<self-line/>
<view class="bg-white">
<skeleton :loading="skeletonLoading" :row="2" :showAvatar="false" :showTitle="true">

26
pages/route/index.vue

@ -6,12 +6,21 @@
/* 路由分发页面仅供跳转页面 */
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)
}else{
this.routeToPage(options); //
}
},
methods: {
//
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'){
@ -40,11 +49,24 @@
}
}
}
console.log(par)
if(par.is_tabbar){
this.$url(path, {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;
}
}
}

143
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>

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

Loading…
Cancel
Save