This commit is contained in:
zhangmanman
2021-08-09 15:57:37 +08:00
parent c661dd0e16
commit 540d76bdb8
158 changed files with 4914 additions and 788 deletions

View File

@@ -17,7 +17,7 @@ const errInfo = (obj) =>{
wx.removeStorageSync("token") wx.removeStorageSync("token")
// 返回首页 // 返回首页
wx.redirectTo({ wx.redirectTo({
url: "/pages/index/index", url: "/pages/login/login",
}) })
} }
}) })

View File

@@ -8,7 +8,7 @@ const record = (code, iv, encryptedData, parent_id) => req({url: "auth/openwx",
const bindmobile = (code, iv, mobile) => req({url: "auth/bindmobile", method: "POST", data: {code: code, iv: iv, mobile: mobile}}) const bindmobile = (code, iv, mobile) => req({url: "auth/bindmobile", method: "POST", data: {code: code, iv: iv, mobile: mobile}})
//切换手机授权 //切换手机授权
const tel = (wechatUser_id, username) => req({url: "auth/loginbymobile", method: "POST", data: {wechatUser_id: wechatUser_id,username: username}}) const tel = (wechatUser_id, username) => req({url: "auth/loginbymobile", method: "POST", data: {wechatUser_id: wechatUser_id,username: username}}, false)
export default({ export default({

View File

@@ -1,6 +1,9 @@
import {req} from "../request" import {req} from "../request"
// 是否开启沃支付
const woPayment = () => req({url: "ajax/pays"})
//首页权益 //首页权益
const index = (area_name, user_lng, user_lat) => req({url: "home", data: {area_name: area_name, user_lng: user_lng, user_lat:user_lat}}) const index = (area_name, user_lng, user_lat) => req({url: "home", data: {area_name: area_name, user_lng: user_lng, user_lat:user_lat}})
@@ -41,7 +44,7 @@ const ordersInfo = (orderId) => req({url: "activity/orders/" + orderId + '/info'
const rightShow = (right_id, address_id, num, is_deliver) => req({url: "orders/create/", data: {right_id: right_id, address_id: address_id || '', num: num || '', is_deliver: is_deliver}}) const rightShow = (right_id, address_id, num, is_deliver) => req({url: "orders/create/", data: {right_id: right_id, address_id: address_id || '', num: num || '', is_deliver: is_deliver}})
// 权益购买提交 // 权益购买提交
const rightStore = (right_id, address_id, is_deliver, qty) => req({url: "orders/store/", method: "POST", data: {right_id: right_id, address_id: address_id || '', is_deliver: is_deliver, qty: qty || ''}}) const rightStore = (right_id, address_id, is_deliver, qty, share_user_id) => req({url: "orders/store/", method: "POST", data: {right_id: right_id, address_id: address_id || '', is_deliver: is_deliver, qty: qty || '', share_user_id: share_user_id || ''}})
// 微信权益购买信息 // 微信权益购买信息
const wechat = (trade_no) => req({url: "payments/wechat?",method: "POST", data: {trade_no: trade_no}}) const wechat = (trade_no) => req({url: "payments/wechat?",method: "POST", data: {trade_no: trade_no}})
@@ -113,5 +116,6 @@ export default({
washcarCoupon, washcarCoupon,
busineSee, busineSee,
busineForm, busineForm,
subscribe subscribe,
woPayment
}) })

View File

@@ -11,7 +11,7 @@ const mobiles = (wechatUser_id) => req({url: "user/mobiles", data:{wechatUser_id
const coupon = (status) => req({url: "coupons?status=" + status}) const coupon = (status) => req({url: "coupons?status=" + status})
//卡券分组 //卡券分组
const couponArr = (activityId, status, page) => req({url: "coupons/list", data:{activityId : activityId, status : status, page : page}}) const couponArr = (activityId, status, page) => req({url: "coupons/list", data:{activityId : activityId, status : status, page : page || ''}})
//卡券详情 //卡券详情
const couponinfo = (coupon_id, user_lng, user_lat) => req({url: "coupons/show", data:{coupon_id : coupon_id, user_lng : user_lng, user_lat : user_lat}}) const couponinfo = (coupon_id, user_lng, user_lat) => req({url: "coupons/show", data:{coupon_id : coupon_id, user_lng : user_lng, user_lat : user_lat}})
@@ -23,7 +23,7 @@ const qrcode = (coupon_id) => req({url: "coupons/qrcode", data:{coupon_id : coup
const barcode = (coupon_id) => req({url: "coupons/" + coupon_id + '/barcode'}) const barcode = (coupon_id) => req({url: "coupons/" + coupon_id + '/barcode'})
//门店列表 //门店列表
const stores = (coupon_id, province_id, city_id, district_id, title, user_lng, user_lat, page) => req({url: "coupons/new_stores", method: "POST", data:{coupon_id : coupon_id, province_id : province_id || '', city_id : city_id || '', district_id : district_id || '', title : title || '', user_lng : user_lng, user_lat : user_lat, page : page}}) const stores = (coupon_id, province_id, city_id, district_id, title, user_lng, user_lat, page) => req({url: "coupons/new_stores", method: "POST", data:{coupon_id : coupon_id, province_id : province_id || '', city_id : city_id || '', district_id : district_id || '', title : title || '', user_lng : user_lng, user_lat : user_lat, page : page || ''}})
//门店详情 //门店详情
const storesShow = (store_id, user_lng, user_lat) => req({url: "coupons/store/show", data:{store_id : store_id, user_lng : user_lng, user_lat : user_lat}}) const storesShow = (store_id, user_lng, user_lat) => req({url: "coupons/store/show", data:{store_id : store_id, user_lng : user_lng, user_lat : user_lat}})
@@ -38,7 +38,7 @@ const jssdk = (coupon_id) => req({url: "coupons/jssdk?coupon_id=" + coupon_id})
const cards = (code, pass) => req({url: "user/cards/activate", method: "POST", data:{code : code, pass : pass}}) const cards = (code, pass) => req({url: "user/cards/activate", method: "POST", data:{code : code, pass : pass}})
// 积分账变记录 // 积分账变记录
const logs = (type, channel, page) => req({url: "account/logs", data:{type : type, channel: channel, page : page}}) const logs = (type, channel, page) => req({url: "account/logs", data:{type : type, channel: channel, page : page || ''}})
// 冻结列表 // 冻结列表
const ungrants = (type,) => req({url: "account/newungrants", data:{type : type}}) const ungrants = (type,) => req({url: "account/newungrants", data:{type : type}})
@@ -62,7 +62,7 @@ const washcarCreate = (welfare_id, right_id, qty, address_id, is_deliver) => req
const myshare = (parent_id) => req({url: "user/share",data:{parent_id : parent_id || ''}}) const myshare = (parent_id) => req({url: "user/share",data:{parent_id : parent_id || ''}})
// 我的推荐 // 我的推荐
const childs = (page) => req({url: "user/childs",data:{page : page}}) const childs = (page) => req({url: "user/childs",data:{page : page || ''}})
// 校验转账的手机号码 // 校验转账的手机号码
const ajaxTel = (mobile) => req({url: "ajax/user", data:{mobile : mobile}}) const ajaxTel = (mobile) => req({url: "ajax/user", data:{mobile : mobile}})
@@ -86,11 +86,38 @@ const resetPassword = (code, password, password_confirmation, mobile, channel) =
const withdraws = () => req({url: "withdraws/create"}) const withdraws = () => req({url: "withdraws/create"})
// 提现记录列表 // 提现记录列表
const withdrawsList = (page) => req({url: "user/withdraws", data:{page : page}}) const withdrawsList = (status, page) => req({url: "user/withdraws", data:{status: status, page : page || ''}})
// 提现表单填写 // 提现表单填写
const withdrawsForm = (amount, channel) => req({url: "withdraws", method: "POST", data:{amount : amount, channel: channel}}) const withdrawsForm = (amount, channel) => req({url: "withdraws", method: "POST", data:{amount : amount, channel: channel}})
// 2021-07-28新增
// 我的收益
const myProfit = () => req({url: "data/index"})
// 我的收益-收益报表
const myIncome = (month) => req({url: "data/income", data:{month: month}})
// 我的收益-收益报表
const profitOrders = (type, page) => req({url: "data/orders", data:{type: type, page : page || ''}})
// 我的收益-我的团队
const profitTeam = (identity_id, sort, page) => req({url: "data/teams", data:{identity_id: identity_id, sort: sort, page : page || ''}})
// 权益详细列表
const profitLogs = (name, page) => req({url: "data/logs", data:{name: name, page : page || ''}})
// 产品分享
const productList = (page) => req({url: "shares/goods", data:{page : page || ''}})
const productInfo = (right) => req({url: "shares/goods/" + right})
const productPoster = (right) => req({url: "shares/goods/" + right + "/poster"})
// 储值分享
const storedList = () => req({url: "shares/recharges"})
// 产品分享二维码+储值分享二维码
const publicCode = (channel, type, url) => req({url: "user/share/goods", data:{channel: channel, type : type, url: url}})
export default({ export default({
index, index,
mobiles, mobiles,
@@ -121,5 +148,15 @@ export default({
resetPassword, resetPassword,
withdraws, withdraws,
withdrawsList, withdrawsList,
withdrawsForm withdrawsForm,
myProfit,
myIncome,
profitOrders,
profitTeam,
profitLogs,
productList,
productInfo,
productPoster,
storedList,
publicCode
}) })

View File

@@ -11,13 +11,20 @@ const api = "https://lifetest.ysd-bs.com/api/" //正式地址
const header = { const header = {
"Accept" : "application/json" "Accept" : "application/json"
} }
let isToken = true
/** /**
* 请求 * 请求
* @property {Object} req * @property {Object} req
*/ */
const req = (obj) => { const req = (obj, noToken) => {
// 检查是否无需要token
if(noToken != undefined){
isToken = noToken
}
// header // header
if(obj.token){ if(obj.token){
header.Authorization = obj.token || '' header.Authorization = obj.token || ''
@@ -33,6 +40,10 @@ const req = (obj) => {
"Authorization" : wx.getStorageSync("token") || "" "Authorization" : wx.getStorageSync("token") || ""
} }
if(!isToken){
obj.header.Authorization = ''
}
wx.request({ wx.request({
url : api + obj.url, url : api + obj.url,
header : obj.header || {}, header : obj.header || {},
@@ -60,6 +71,9 @@ const req = (obj) => {
icon : "none" icon : "none"
}) })
reject(err) reject(err)
},
complete(){
if(!isToken) isToken = true
} }
}) })
}) })

9
app.js
View File

@@ -10,6 +10,12 @@ var qqmapsdk;
App({ App({
onLaunch() { onLaunch() {
// 沃支付是否开启
api.index.woPayment().then(res=>{
this.globalData.unicomPay = res.data.unicom_pay
})
// 获取系统信息 // 获取系统信息
this.globalData.statusBarHeight = wx.getSystemInfoSync().statusBarHeight this.globalData.statusBarHeight = wx.getSystemInfoSync().statusBarHeight
@@ -65,6 +71,7 @@ App({
atcity : "", atcity : "",
adcode : '', adcode : '',
longitude : '', longitude : '',
latitude : '' latitude : '',
unicomPay : false
} }
}) })

View File

@@ -37,7 +37,15 @@
"pages/withdrawal_record/withdrawal_record", "pages/withdrawal_record/withdrawal_record",
"pages/withdrawal_form/withdrawal_form", "pages/withdrawal_form/withdrawal_form",
"pages/password_set/password_set", "pages/password_set/password_set",
"pages/password_forget/password_forget" "pages/password_forget/password_forget",
"pages/myProfit/myProfit",
"pages/myProfit_list/myProfit_list",
"pages/userStored/userStored",
"pages/userStored/storedCode/storedCode",
"pages/userGoods/userGoods",
"pages/userGoods/goodsCode/goodsCode",
"pages/userGoods/goodsDet/goodsDet",
"pages/cashier/cashier"
], ],
"window": { "window": {
"backgroundTextStyle": "light", "backgroundTextStyle": "light",

View File

@@ -71,7 +71,7 @@ Page({
accounts : newData, accounts : newData,
page : res.data.page page : res.data.page
}) })
}) }).catch(err=>{})
}, },
/** /**

View File

@@ -54,7 +54,7 @@ Page({
url: '/pages/user/user' url: '/pages/user/user'
}) })
},2000) },2000)
}) }).catch(err => {});
}, },
/** /**

View File

@@ -31,7 +31,7 @@ Page({
indexArr : res.data.data, indexArr : res.data.data,
page : res.data.page page : res.data.page
}) })
}) }).catch(err => {});
}, },
/** /**

View File

@@ -33,7 +33,7 @@ Page({
this.setData({ this.setData({
order : res.data order : res.data
}) })
}) }).catch(err => {});
}, },
/** /**
@@ -56,7 +56,7 @@ Page({
url: '/pages/activityOrder/activityOrder', url: '/pages/activityOrder/activityOrder',
}) })
},2000) },2000)
}) }).catch(err => {});
} else if (res.cancel) { } else if (res.cancel) {
wx.showToast({ wx.showToast({
title : '取消', title : '取消',
@@ -103,7 +103,7 @@ Page({
}) })
} }
}) })
}) }).catch(err => {});
} }
}) })
}, },

View File

@@ -59,7 +59,7 @@ Page({
// 获取商品信息 // 获取商品信息
this.redwineInfo(res.data.data[1].id) this.redwineInfo(res.data.data[1].id)
}) }).catch(err => {});
}, },
/** /**
@@ -73,7 +73,7 @@ Page({
params : res.data.params, params : res.data.params,
paramsIndex : res.data.params.findIndex(val => val.def == 1) paramsIndex : res.data.params.findIndex(val => val.def == 1)
}) })
}) }).catch(err => {});
}, },
/** /**
@@ -142,7 +142,7 @@ Page({
}) })
} }
}) })
}) }).catch(err => {});
} }
}) })
}, },

View File

@@ -38,7 +38,7 @@ Page({
lodingStats : false lodingStats : false
}) })
wx.stopPullDownRefresh() wx.stopPullDownRefresh()
}) }).catch(err => {});
}, },
/** /**
@@ -77,7 +77,7 @@ Page({
title: res.data, title: res.data,
icon : 'none' icon : 'none'
}) })
}) }).catch(err => {});
} else if (res.cancel) { } else if (res.cancel) {
wx.showToast({ wx.showToast({
title : '取消', title : '取消',
@@ -124,7 +124,7 @@ Page({
}) })
} }
}) })
}) }).catch(err => {});
} }
}) })
}, },

View File

@@ -32,7 +32,7 @@ Page({
this.setData({ this.setData({
addressArr: res.data addressArr: res.data
}) })
}) }).catch(err => {});
}, },
/** /**
@@ -63,7 +63,7 @@ Page({
}) })
wx.hideLoading() wx.hideLoading()
}) }).catch(err => {});
} }
} }
}) })
@@ -81,7 +81,7 @@ Page({
title: res.data, title: res.data,
icon : "none" icon : "none"
}) })
}) }).catch(err => {});
}, },
/** /**

View File

@@ -117,7 +117,7 @@ Page({
defaultList : res.data.address, defaultList : res.data.address,
isDefault : res.data.address.is_default isDefault : res.data.address.is_default
}) })
}) }).catch(err => {});
}, },
/** /**
@@ -132,7 +132,7 @@ Page({
areaSn : areaArr[areaIndex].code, areaSn : areaArr[areaIndex].code,
areas : areaArr areas : areaArr
}) })
}) }).catch(err => {});
}, },
/** /**
@@ -165,7 +165,7 @@ Page({
cityList : cityArr, cityList : cityArr,
cityIndex : 0 cityIndex : 0
}) })
}) }).catch(err => {});
}, },
/** /**
@@ -197,7 +197,7 @@ Page({
regiId : res.data[0].code, regiId : res.data[0].code,
regiIndex : 0 regiIndex : 0
}) })
}) }).catch(err => {});
}, },
/** /**
@@ -219,12 +219,12 @@ Page({
// 编辑地址 // 编辑地址
wx.$api.address.keep(this.data.addressId, e.detail.value.name, e.detail.value.mobile, this.data.areaSn, this.data.cityId, this.data.regiId, e.detail.value.address).then(res=>{ wx.$api.address.keep(this.data.addressId, e.detail.value.name, e.detail.value.mobile, this.data.areaSn, this.data.cityId, this.data.regiId, e.detail.value.address).then(res=>{
wx.navigateBack() wx.navigateBack()
}) }).catch(err => {});
} else { } else {
// 创建地址 // 创建地址
wx.$api.address.add(e.detail.value.name, e.detail.value.mobile, this.data.areaSn, this.data.cityId, this.data.regiId, e.detail.value.address, this.data.defaultVal).then(res=>{ wx.$api.address.add(e.detail.value.name, e.detail.value.mobile, this.data.areaSn, this.data.cityId, this.data.regiId, e.detail.value.address, this.data.defaultVal).then(res=>{
wx.navigateBack() wx.navigateBack()
}) }).catch(err => {});
} }
}, },

View File

@@ -28,16 +28,15 @@ Page({
noticeShow : false, //须知显示状态 noticeShow : false, //须知显示状态
addressShow : false, //收货地址显示 addressShow : false, //收货地址显示
payWayIndex : 0, payWayIndex : 0,
payWay :[ unicomPay : getApp().globalData.unicomPay //是否有沃支付
{value: 0, name: "微信支付"}
// {value: 1, name: "沃钱包支付"}
]
}, },
/** /**
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
onLoad (options) { onLoad (options) {
console.log(getApp().globalData.unicomPay)
this.setData({ this.setData({
rightId : options.right_id, rightId : options.right_id,
welfareId: options.welfare_id welfareId: options.welfare_id
@@ -89,22 +88,7 @@ Page({
remark : res.data.detail.remark.replace(/\<img/gi, '<img style="max-width:100%;height:auto;display:block;"'), remark : res.data.detail.remark.replace(/\<img/gi, '<img style="max-width:100%;height:auto;display:block;"'),
content : res.data.detail.content.replace(/\<img/gi, '<img style="max-width:100%;height:auto;display:block;"') content : res.data.detail.content.replace(/\<img/gi, '<img style="max-width:100%;height:auto;display:block;"')
}) })
}).catch(err=>{ }).catch(err=>{})
if(!err.login){
wx.showModal({
title : '用户登录已过期',
content : '请重新登录',
showCancel : false,
success : res => {
if (res.confirm) {
wx.redirectTo({
url: '/pages/login/login'
})
}
}
})
}
})
}, },
/** /**
@@ -215,9 +199,20 @@ Page({
qty = this.data.num qty = this.data.num
wx.$api.user.washcarCreate(welfare_id, right_id, qty, address_id, is_deliver).then(res=>{ wx.$api.user.washcarCreate(welfare_id, right_id, qty, address_id, is_deliver).then(res=>{
// payWayIndex为1的时候为沃支付-直接跳转h5
if (this.data.payWayIndex == 1) {
const newUrl = "https://card.ysd-bs.com/unicom/payment?trade_no=" + res.data.trade_no
let url= encodeURIComponent(newUrl)
wx.redirectTo({
// 跳转到webview页面
url: `/pages/webView/webView?url=${url}`
});
}
// payWayIndex为0的时候为微信支付
if(this.data.payWayIndex == 0) {
let dataUrl = '', //定义接口来源名称 let dataUrl = '', //定义接口来源名称
Newtype = res.data.type //订单来源 Newtype = res.data.type //订单来源
// welfare为福利活动购买 // welfare为福利活动购买
if(Newtype == 'welfare') dataUrl = wx.$api.index.fridayPay(res.data.trade_no) if(Newtype == 'welfare') dataUrl = wx.$api.index.fridayPay(res.data.trade_no)
@@ -292,8 +287,8 @@ Page({
} }
} }
}) })
}) }).catch(err => {});
}
}) }).catch(err => {});
} }
}) })

View File

@@ -103,21 +103,37 @@
<!-- 支付方式 --> <!-- 支付方式 -->
<view class="label"> <view class="label">
<view class="labelList"> <view class="radioList">
<view class="labelList-label">请选择支付方式</view> <view class="radioList-label">请选择支付方式</view>
<view class="rightsLabel-range"> <!-- <view class="rightsLabel-range">
<picker range="{{payWay}}" range-key="name" bindchange="payBind"> <picker range="{{payWay}}" range-key="name" bindchange="payBind">
<view class="tabs-text"> <view class="tabs-text">
{{payWay[payWayIndex].name}} {{payWay[payWayIndex].name}}
</view> </view>
</picker> </picker>
<image class="rightsLabel-row" src="/static/icon/rightsArrow.png"></image> <image class="rightsLabel-row" src="/static/icon/rightsArrow.png"></image>
</view> -->
<radio-group bindchange="payBind">
<view class="payContList-label">
<view class="payContList-label-name">
<image class="payContList-label-img" src="/static/img/wx.jpg"></image>
微信支付
</view> </view>
<radio class="radio" value="0" checked></radio>
</view> </view>
<view class="labelList"> <view class="payContList-label" wx:if="{{unicomPay}}">
<view class="payContList-label-name">
<image class="payContList-label-img" src="/static/img/wqb.jpg"></image>
沃钱包支付
</view>
<radio class="radio" value="1"></radio>
</view>
</radio-group>
</view>
<!-- <view class="labelList">
<view class="labelList-label">支付方式</view> <view class="labelList-label">支付方式</view>
<view class="labelList-price">{{payWay[payWayIndex].name}}</view> <view class="labelList-price">{{payWay[payWayIndex].name}}</view>
</view> </view> -->
</view> </view>
<!-- 购买须知 --> <!-- 购买须知 -->

View File

@@ -450,3 +450,36 @@
transform: scale(.9, .9); transform: scale(.9, .9);
font-size: 24rpx; font-size: 24rpx;
} }
/* 支付类型选择 */
.radioList-label {
padding: 20rpx 0 40rpx;
font-size: 28rpx
}
.payContList-label {
font-size: 28rpx;
display: flex;
margin-bottom: 40rpx;
}
.payContList-label:last-child {
border:none
}
.payContList-label-name {
flex: 1;
font-size: 32rpx;
display: flex;
line-height: 46rpx;
}
.payContList-label-img {
width: 46rpx;
height: 46rpx;
margin-right: 20rpx;
}
radio {
transform:scale(0.8);
}

169
pages/cashier/cashier.js Normal file
View File

@@ -0,0 +1,169 @@
// pages/cashier/cashier.js
Page({
/**
* 页面的初始数据
*/
data: {
allAmount: '', //支付金额
tradeNo : '', //支付订单
current : 1, //支付方式类型
paytType : '', //支付来源类型 welfarePay为周五福利支付 rightsPay为权益支付
isDeliver: '', //提货方式 1为自提 0为快递
barHeight: getApp().globalData.statusBarHeight, //顶部菜单栏
unicomPay: getApp().globalData.unicomPay //是否有沃支付
},
/**
* 生命周期函数--监听页面加载
*/
onLoad (options) {
this.setData({
allAmount : options.amount,
tradeNo : options.trade_no,
paytType : options.pay_type,
isDeliver : options.is_deliver
})
console.log(getApp().globalData.unicomPay)
},
/**
* 选择支付方式
*/
radioChange(e) {
this.setData({
current : e.detail.value
})
},
/**
* 支付提交
*/
submitPay() {
// current为1的时候为沃支付-直接跳转h5
if (this.data.current == 1) {
const newUrl = "https://card.ysd-bs.com/unicom/payment?trade_no=" + this.data.tradeNo
let url= encodeURIComponent(newUrl)
wx.redirectTo({
// 跳转到webview页面
url: `/pages/webView/webView?url=${url}`
});
}
// current为2的时候为微信支付
if(this.data.current == 2) {
let newUrl = '' //定义接口来源名称
if(this.data.paytType == "welfarePay") newUrl = wx.$api.index.fridayPay
if(this.data.paytType == "rightsPay") newUrl = wx.$api.index.wechat
newUrl(this.data.tradeNo).then(res=>{
let payInfo = JSON.parse(res.data)
wx.requestPayment({
timeStamp: payInfo.timeStamp,
nonceStr : payInfo.nonceStr,
package : payInfo.package,
paySign : payInfo.paySign,
signType : payInfo.signType,
success : res=>{
if(res.errMsg == "requestPayment:ok"){
wx.showToast({
title: '支付成功',
icon : 'success'
})
setTimeout(()=>{
if(this.data.isDeliver == 1) {
if( this.data.paytType == "rightsPay" ) {
wx.reLaunch({
url: '/pages/order/order?orderType=rightsCoupons'
})
}
if( this.data.paytType == "welfarePay" ) {
wx.reLaunch({
url: '/pages/order/order?orderType=welfareGoods'
})
}
} else {
if( this.data.paytType == "rightsPay" ) {
wx.reLaunch({
url: '/pages/order/order?orderType=rights'
})
}
if( this.data.paytType == "welfarePay" ) {
wx.reLaunch({
url: '/pages/order/order?orderType=welfare'
})
}
}
},3000)
}
},
fail : res=>{
if(this.data.isDeliver == 1) {
if( this.data.paytType == "rightsPay" ) {
wx.reLaunch({
url: '/pages/order/order?orderType=rightsCoupons&stateType=unpay'
})
}
if( this.data.paytType == "welfarePay" ) {
wx.reLaunch({
url: '/pages/order/order?orderType=welfareGoods&stateType=unpay'
})
}
} else {
if( this.data.paytType == "rightsPay" ) {
wx.reLaunch({
url: '/pages/order/order?orderType=rights&stateType=unpay'
})
}
if( this.data.paytType == "welfarePay" ) {
wx.reLaunch({
url: '/pages/order/order?orderType=welfare&stateType=unpay'
})
}
}
}
})
}).catch(err => {});
}
},
/**
* 是否取消支付
*/
payReturn() {
wx.showModal({
title : '提示',
content : '是否取消支付',
success : res=> {
if (res.confirm) {
if(this.data.isDeliver == 1) {
if( this.data.paytType == "rightsPay" ) {
wx.reLaunch({
url: '/pages/order/order?orderType=rightsCoupons&stateType=unpay'
})
}
if( this.data.paytType == "welfarePay" ) {
wx.reLaunch({
url: '/pages/order/order?orderType=welfareGoods&stateType=unpay'
})
}
} else {
if( this.data.paytType == "rightsPay" ) {
wx.reLaunch({
url: '/pages/order/order?orderType=rights&stateType=unpay'
})
}
if( this.data.paytType == "welfarePay" ) {
wx.reLaunch({
url: '/pages/order/order?orderType=welfare&stateType=unpay'
})
}
}
}
}
})
}
})

View File

@@ -0,0 +1,4 @@
{
"usingComponents" : {},
"navigationStyle" : "custom"
}

View File

@@ -0,0 +1,48 @@
<!-- 头部工具 -->
<view class="barHeader" style="padding-top:{{barHeight}}px;" bindtap="payReturn">
<image class="barHeader-tool-icon" src="/static/icon/arrow_right.png" mode="widthFix"></image>
<view class="barHeader-title">订单支付</view>
</view>
<view style="padding-top: {{barHeight + 45}}px">
<view class="cashierTips">
<image src="/static/img/cashierTips_icon.png" mode="aspectFill"></image>注:推荐使用沃支付,可在享优惠!
</view>
<view class="cashierCont">
<view class="cashierCont-title">
<text>支付类型</text>线上支付
</view>
<view class="cashierCont-price">
<view class="cashierCont-price-title">
付款金额
</view>
<view class="cashierCont-price-number">
¥{{ allAmount }}
</view>
</view>
<view class="cashierCont-pay">
<view class="cashierCont-pay-title">
付款方式<text>*</text>
</view>
<view class="cashierCont-pay-way">
<radio-group bindchange="radioChange">
<view class="cashierCont-way-label {{ current == 1 ? 'active' : ''}}" wx:if="{{unicomPay}}">
<view class="payContList-label-name">
<image class="payContList-label-img" src="/static/img/wqb.jpg"></image>
<text>沃支付支付</text>
</view>
<radio class="radio" value="1" checked></radio>
</view>
<view class="cashierCont-way-label {{ current == 2 ? 'active' : ''}}">
<view class="payContList-label-name">
<image class="payContList-label-img" src="/static/img/wx.jpg"></image>
<text>微信支付</text>
</view>
<radio class="radio" value="2"></radio>
</view>
</radio-group>
</view>
<button class="payBtn" bindtap="submitPay" disabled="{{disabledOk}}">立即支付</button>
</view>
</view>
</view>

140
pages/cashier/cashier.wxss Normal file
View File

@@ -0,0 +1,140 @@
/* 头部 */
.barHeader {
position: fixed;
background: #fff;
color: #000;
top: 0;
left: 0;
z-index: 9;
width: 100%;
height: 100rpx;
display: flex;
}
.barHeader-tool-icon {
width: 48rpx;
vertical-align: middle;
margin: 32rpx 0 0 20rpx;
}
.barHeader-title {
position: relative;
width: 100%;
text-align: center;
height: 100rpx;
line-height: 100rpx;
}
page {
background-color: #bc1d30;
padding: 40rpx;
box-sizing: border-box;
}
.cashierTips {
background-color: #FFFFFF;
font-weight: 600;
font-size: 30rpx;
border-radius: 10rpx;
margin-bottom: 40rpx;
line-height: 80rpx;
padding: 0 30rpx;
box-sizing: border-box;
color: #e69500;
display: flex;
}
.cashierTips image {
width: 32rpx;
height: 32rpx;
margin: 24rpx 10rpx 0 0;
}
.cashierCont {
width: 100%;
background-color: #ffffff;
padding: 30rpx;
box-sizing: border-box;
border-radius: 20rpx;
overflow: hidden;
}
.cashierCont-title text {
color: #7e7d81;
padding-right: 30rpx;
}
.cashierCont-price {
text-align: center;
margin: 90rpx 0;
color: #bc1d30;
}
.cashierCont-price-title {
font-size: 34rpx;
margin-bottom: 10rpx;
}
.cashierCont-price-number {
font-size: 60rpx;
}
.cashierCont-pay-title {
color: #7e7d81;
margin-bottom: 40rpx;
}
.cashierCont-pay-title text{
color: #bc1d30;
padding-left: 10rpx;
}
.cashierCont-pay-way {
height: 240rpx;
}
.cashierCont-way-label {
float: left;
border: 2rpx solid #e8e8e8;
box-sizing: border-box;
padding: 30rpx 0;
border-radius: 10rpx;
width: calc(50% - 84rpx);
text-align: center;
margin: 0 40rpx;
font-size: 30rpx;
position: relative;
}
.cashierCont-way-label.active {
border-color: #bc1d30;
color: #bc1d30;
box-shadow: 0 10rpx 20rpx rgba(188, 29, 48 ,.3);
}
.cashierCont-way-label radio {
opacity: 0;
position: absolute;
width: 100%;
height: 100%;
left: 0;
top: 0;
}
.cashierCont-way-label image {
width: 90rpx;
height: 90rpx;
display: block;
margin: 0 auto 20rpx;
}
.payBtn {
background-color: #bc1d30;
color: #ffffff;
height: 90rpx;
line-height: 90rpx;
width: 100%;
font-size: 32rpx;
padding: 0;
border-radius: 80rpx;
margin: 80rpx 0 40rpx;
}

View File

@@ -114,9 +114,10 @@ Page({
}) })
} else { } else {
// 回到个人中心 // 回到个人中心
wx.switchTab({ // wx.switchTab({
url: '/pages/user/user' // url: '/pages/user/user'
}) // })
wx.navigateBack({delta: 2})
} }
}) })
}, },
@@ -134,20 +135,24 @@ Page({
// 写入缓存 // 写入缓存
wx.setStorage({ wx.setStorage({
key : 'token', key : 'token',
data : res.data.token data : res.data.token,
}) success : ()=> {
if(this.data.way == "activity") { if(this.data.way == "activity") {
// 回到活动首页 // 回到活动首页
wx.reLaunch({ wx.reLaunch({
url: '/pages/activityInfo/activityInfo' url: '/pages/activityInfo/activityInfo'
}) })
}else if(this.data.way == "shareLogin") {
// 回到上一页面
wx.navigateBack({delta: 2})
}else { }else {
// 回到个人中心 // 回到个人中心
wx.switchTab({ wx.switchTab({
url: '/pages/user/user' url: '/pages/user/user'
}) })
} }
}) }
})
}).catch(err => {});
} }
}) })

View File

@@ -34,6 +34,10 @@ Page({
this.indexNav(options.id,options.areaname,options.latitude,options.userlng) this.indexNav(options.id,options.areaname,options.latitude,options.userlng)
this.setData({
isUser : getApp().globalData.isUser
})
}, },
/** /**
* 生命周期函数--监听页面显示 * 生命周期函数--监听页面显示
@@ -79,9 +83,7 @@ Page({
userNav(e){ userNav(e){
let newid = e.currentTarget.dataset.id, let newid = e.currentTarget.dataset.id,
canFrom = e.currentTarget.dataset.from canFrom = e.currentTarget.dataset.from
wx.getStorage({ if(this.data.isUser){
key : 'token',
success:res=>{
if(canFrom == 'washcar') { if(canFrom == 'washcar') {
wx.$api.index.washcarUrl('', newid).then(res=>{ wx.$api.index.washcarUrl('', newid).then(res=>{
const newUrl = res.data const newUrl = res.data
@@ -90,19 +92,18 @@ Page({
// 跳转到webview页面 // 跳转到webview页面
url: `/pages/washcar/washcar?url=${url}` url: `/pages/washcar/washcar?url=${url}`
}); });
}) }).catch(err => {});
} else { } else {
// 跳转权益详情页 // 跳转权益详情页
wx.navigateTo({ wx.navigateTo({
url: '/pages/rights/rights?rightsId=' + newid url: '/pages/rights/rights?rightsId=' + newid
}) })
} }
}, }else{
fail: (err) => { // 去登录
wx.navigateTo({ wx.navigateTo({
url: "/pages/login/login" url: "/pages/login/login"
}) })
} }
})
} }
}) })

View File

@@ -11,7 +11,8 @@
qrcode : '', //二维码 qrcode : '', //二维码
userInfo : '', //我的信息 userInfo : '', //我的信息
isImgLay : false,//是否显示图片弹出层 isImgLay : false,//是否显示图片弹出层
parentId: '' //是否分享进入 parentId : '', //是否分享进入
shareState : false //显示分享朋友圈弹出层
}, },
/** /**
@@ -30,7 +31,7 @@
qrcode : res.data.qrcode, qrcode : res.data.qrcode,
userInfo : res.data.user userInfo : res.data.user
}) })
}) }).catch(err=>{})
}, },
/** /**
@@ -43,7 +44,7 @@
let avatarImg = new Promise(success=>{ let avatarImg = new Promise(success=>{
wx.getImageInfo({ wx.getImageInfo({
src : this.data.userInfo.avatar, src : '',
success : res => { success : res => {
success(res.path) success(res.path)
} }
@@ -60,38 +61,44 @@
}) })
}) })
Promise.all([codeImg, avatarImg]).then(res => { Promise.all([codeImg]).then(res => {
// 绘制海报 // 绘制海报
const ctx = wx.createCanvasContext('qrcodeCard') const ctx = wx.createCanvasContext('qrcodeCard')
ctx.save() ctx.save()
// 绘制背景 // 绘制背景
ctx.setFillStyle('#f7662d') ctx.setFillStyle('#e2e2e2')
ctx.fillRect(0, 0, 375, 603) ctx.fillRect(0, 0, 375, 603)
// 绘制背景 // 绘制背景
ctx.drawImage('/static/img/user-codeImg-down.png', 0, 0, 375, 650) ctx.drawImage('/static/img/user-codeImg-down.png', 0, 0, 375, 650)
// 绘制二维码 // 绘制二维码
ctx.drawImage(res[0], 114, 390, 150, 150) ctx.drawImage(res[0], 114, 470, 150, 150)
// 文字 // 文字
ctx.setFontSize(16) // ctx.setFontSize(16)
ctx.setFillStyle("#2f3245") // ctx.setFillStyle("#2f3245")
ctx.setTextAlign('center') // ctx.setTextAlign('center')
ctx.fillText(this.data.userInfo.nickname, 194, 350 , 270) // ctx.fillText(this.data.userInfo.nickname, 194, 350 , 270)
// 文字 // 文字
ctx.setFontSize(14) ctx.setFontSize(40)
ctx.setFillStyle("#af7700") ctx.setFillStyle("#222222")
ctx.setTextAlign('center') ctx.setTextAlign('center')
ctx.fillText(this.data.userInfo.nickname + " -- " + "邀请您进入本时生活", 188, 570 , 270) ctx.fillText("扫码享福利", 188, 400 , 270)
// 文字
ctx.setFontSize(18)
ctx.setFillStyle("#222222")
ctx.setTextAlign('center')
ctx.fillText("扫描二维码加入本时生活", 188, 440 , 270)
ctx.save(); ctx.save();
ctx.beginPath(); //开始绘制 ctx.beginPath(); //开始绘制
ctx.arc(70 / 2 + 156, 70 / 2 + 250, 70 / 2, 0, Math.PI * 2, false); ctx.arc(70 / 2 + 156, 70 / 2 + 250, 70 / 2, 0, Math.PI * 2, false);
ctx.clip(); ctx.clip();
ctx.drawImage(res[1], 156, 250, 70, 70); // ctx.drawImage(res[1], 156, 250, 70, 70);
// 保存图片 // 保存图片
ctx.draw(true, () => { ctx.draw(true, () => {
@@ -122,9 +129,7 @@
} }
}) })
}, },
complete: e => { complete: e => {}
console.log(e)
}
}) })
} }
}) })
@@ -157,6 +162,15 @@
}) })
}, },
/**
* 分享朋友圈弹出层状态
*/
shareShow() {
this.setData({
shareState: !this.data.shareState
})
},
/** /**
* 分享 * 分享
*/ */
@@ -164,7 +178,18 @@
return { return {
title : this.data.userInfo.nickname + "邀请您进入本时生活", title : this.data.userInfo.nickname + "邀请您进入本时生活",
imageUrl: "", imageUrl: "",
query : "/pages/code/code?parent_id=" + this.data.userInfo.user_id + "&type=share" path : "/pages/index/index?parent_id=" + this.data.userInfo.user_id + "&type=share"
}
},
/**
* 用户点击右上角分享朋友圈
*/
onShareTimeline () {
return {
title : this.data.userInfo.nickname + "邀请您进入本时生活",
path : "/pages/index/index?parent_id=" + this.data.userInfo.user_id + "&type=share",
imageUrl: ''
} }
} }
}) })

View File

@@ -1,6 +1,6 @@
{ {
"usingComponents": {}, "usingComponents": {},
"navigationBarTitleText": "我的邀请码", "navigationBarTitleText": "我的邀请码",
"navigationBarBackgroundColor": "#332829", "navigationBarBackgroundColor": "#000000",
"navigationBarTextStyle": "white" "navigationBarTextStyle": "white"
} }

View File

@@ -1,48 +1,70 @@
<image class="codeTitle" src="/static/img/user-codeTitle.png"></image> <view class="codeTitle">
<image src="/static/img/code_title.png" mode="widthFix"></image>
</view>
<view class="codeCont"> <view class="codeCont">
<image class="codeCont-gold" src="/static/img/user-codeGold.png"></image> <view class="codeCont-tisp">
<image class="codeCont-tips" src="/static/img/user-codeTips-01.png" mode="widthFix"></image> <text>每邀请一位好友注册成功后</text>
<text>您将获得30元消费红包奖励</text>
</view>
<view class="codeCont-text"> <view class="codeCont-text">
<image class="codeCont-avatar" src="{{userInfo.avatar}}" mode="aspectFill"></image> <image class="codeCont-avatar" src="{{userInfo.avatar}}" mode="aspectFill"></image>
<view class="codeCont-name"> <view class="codeCont-name">
{{userInfo.nickname}} {{userInfo.nickname}}
</view> </view>
</view> </view>
<image class="codeCont-words" src="/static/img/user-codeTips-02.png" mode="widthFix"></image> <view class="codeCont-code">
<image class="codeCont-code" src="{{qrcode}}" mode="aspectFill"></image> <view class="codeCont-title">
<view class="codeCont-title-text">邀好友享福利</view>
<view class="codeCont-title-tips">邀请好友加入本时生活</view>
</view>
<image class="codeCont-img" src="{{qrcode}}" mode="aspectFill"></image>
</view>
</view> </view>
<view class="codeShare"> <view class="codeShare">
<button class="codeShare-label codeShare-button" open-type="share" hover-class="none"> <button class="codeShare-label codeShare-button" open-type="share" hover-class="none">
<image src="/static/img/code_icon_00.png"></image>
微信好友 微信好友
</button> </button>
<view class="codeShare-label" bindtap="shareShow">
<image src="/static/img/code_icon_01.png"></image>
朋友圈
</view>
<view class="codeShare-label" bindtap="removeSaveImg" hover-class="none"> <view class="codeShare-label" bindtap="removeSaveImg" hover-class="none">
下载海报 <image src="/static/img/code_icon_02.png"></image>
生成海报
</view> </view>
</view> </view>
<!-- 海报canvas --> <!-- 海报canvas -->
<canvas class="canvasImg" canvas-id="qrcodeCard"></canvas> <canvas class="canvasImg" canvas-id="qrcodeCard"></canvas>
<!-- 图片弹出层 --> <!-- 图片弹出层 -->
<view class="user-lay sign-img-lay" wx:if="{{isImgLay}}"> <view class="user-lay sign-img-lay" wx:if="{{isImgLay}}">
<view class="user-back"> <view class="user-back">
<image class="user-back-img" src="/static/img/user-codeImg-active.png" mode="aspectFill"></image> <image class="user-back-img" src="/static/img/code_share.png" mode="widthFix"></image>
<view class="user-back-cont"> <view class="user-back-cont">
<view class="user-back-avatar">
<image src="{{userInfo.avatar}}" mode="aspectFill"></image>
<view class="">
{{userInfo.nickname}}
</view>
</view>
<view class="user-back-yard">
<image src="{{qrcode}}" mode="aspectFill"></image>
<view class="codeBack-yard-name"> <view class="codeBack-yard-name">
邀请好友扫码,即可绑定关系 <view class="codeBack-yard-title">扫码享福利</view>
</view> <view>识别二维码加入本时生活</view>
</view> </view>
<image src="{{qrcode}}" mode="aspectFill"></image>
</view> </view>
</view> </view>
<button class="sign-img-btn" size="mini" bindtap="saveImg">保存到相册</button> <button class="sign-img-btn" size="mini" bindtap="saveImg">保存到相册</button>
<button class="sign-img-btn remove-btn" size="mini" bindtap="removeSaveImg">取消</button> <button class="sign-img-btn remove-btn" size="mini" bindtap="removeSaveImg">取消</button>
</view> </view>
<!-- 朋友圈提示弹出 -->
<view class="sharePop" wx:if="{{shareState}}" bindtap="shareShow">
<image class="sharePop-row" src="/static/img/code_share_01.png" mode="widthFix"></image>
<view class="shareList">
<view class="shareLabel">
<text>1</text>
点击右上角<image src="/static/img/code_share_00.png" mode="aspectFill"></image>打开菜单
</view>
<view class="shareLabel">
<text>2</text>
选择菜单<image src="/static/img/code_share_02.png" mode="aspectFill"></image>分享朋友圈
</view>
</view>
</view>

View File

@@ -1,107 +1,110 @@
page { page {
background-color: #f5ecd8; background-color: #e2e2e2;
} }
/* 标题 */
.codeTitle { .codeTitle {
width: 100vw;
height: 45vh;
text-align: center;
position: absolute;
left: 0;
top: 0;
}
/* 按钮 */
.codeShare {
width: 100%; width: 100%;
position: fixed; background-color: #000000;
bottom: 0; border-radius: 0 0 200rpx 200rpx;
left: 0; padding: 40rpx 20rpx 160rpx;
background-color: #333333;
display: flex;
padding: 30rpx 20rpx 40rpx;
box-sizing: border-box; box-sizing: border-box;
z-index: 9;
} }
.codeShare-label { .codeTitle {
width: calc(50% - 20rpx) !important;
margin: 0 10rpx;
font-weight: normal;
text-align: center; text-align: center;
height: 80rpx; width: 100%;
line-height: 80rpx;
padding: 0;
border-radius: 60rpx;
border: #c1a468 2rpx solid;
font-size: 32rpx;
color: #412f0b;
background: linear-gradient(to bottom, #eee3c8, #c1a468);
} }
.codeShare-button {
color: #ffd887;
background: transparent;
}
/* 二维码 */
.codeCont { .codeCont {
position: relative; background-color: #ffffff;
width: 80vw; margin: -120rpx auto 0;
left: 10vw; width: 84%;
top: 31.5vh; border-radius: 20rpx;
background-color: #fff; box-shadow: 0 0 20rpx rgba(0, 0, 0, .2);
box-sizing: border-box; padding: 40rpx 0;
border-radius: 10rpx; }
justify-items: center;
.codeCont-tisp {
text-align: center; text-align: center;
z-index: 8; color: #fff;
margin-bottom: 200rpx; background-color: #797979;
padding: 10rpx 0;
} }
.codeCont-code { .codeCont-tisp text {
width: 340rpx; display: block;
height: 340rpx;
margin: 20rpx 0 40rpx;
}
.codeCont-tips {
border-radius: 10rpx 10rpx 0 0;
width: 100%;
}
.codeCont-gold {
position: absolute;
width: 100rpx;
height: 100rpx;
right: 40rpx;
top: -40rpx;
} }
.codeCont-text { .codeCont-text {
position: absolute;
width: 100%;
text-align: center; text-align: center;
top: 30rpx; margin: 40rpx 0;
left: 0;
color: #71552d;
font-weight: 600;
} }
.codeCont-avatar { .codeCont-avatar {
width: 130rpx; width: 160rpx;
height: 130rpx; height: 160rpx;
border-radius: 50%; border-radius: 50%;
margin-bottom: 5rpx; margin-bottom: 20rpx;
border: 6rpx solid #ebdcb9;
} }
.codeCont-words { .codeCont-code {
margin-top: 40rpx; text-align: center;
width: 100%;
} }
.codeCont-img {
width: 300rpx;
height: 300rpx;
}
.codeCont-title {
margin-bottom: 20rpx;
}
.codeCont-title-text {
font-size: 46rpx;
font-weight: 700;
margin-bottom: 10rpx;
letter-spacing: 4rpx;
}
.codeCont-title-tips {
font-size: 28rpx;
}
.codeShare {
margin-top: 40rpx;
}
.codeShare {
display: flex;
padding: 0 50rpx;
box-sizing: border-box;
}
.codeShare-label {
flex: 3;
text-align: center;
font-size: 28rpx;
}
.codeShare-label image {
width: 80rpx;
height: 80rpx;
display: block;
margin: 0 auto 20rpx;
}
.codeShare-button {
width: auto !important;
border: none;
background: transparent;
font-size: 28rpx;
margin: 0;
padding: 0;
font-weight: normal;
}
/* 弹窗背景图 */ /* 弹窗背景图 */
.user-lay { .user-lay {
display: -webkit-box; display: -webkit-box;
@@ -126,6 +129,7 @@ page {
background: #fbf6f0; background: #fbf6f0;
} }
/* 图片弹出层 */ /* 图片弹出层 */
.sign-img-lay { .sign-img-lay {
text-align: center; text-align: center;
@@ -144,7 +148,7 @@ page {
height: 90rpx; height: 90rpx;
line-height: 90rpx; line-height: 90rpx;
padding: 0; padding: 0;
width: 70vw; width: 80%;
} }
.remove-btn[size="mini"] { .remove-btn[size="mini"] {
@@ -155,53 +159,89 @@ page {
} }
/* 背景 */ /* 背景 */
.user-back { .user-back-img {
position: relative;
width: 100%; width: 100%;
height:600rpx; display: block;
text-align: center;
margin-top: 100rpx;
} }
.user-back-img { .user-back {
position: absolute; position: relative;
width: 70vw; width: 80%;
left: 15vw; text-align: center;
top: 0;
height: 100%;
margin: 0 auto; margin: 0 auto;
border-radius: 10rpx;
} }
.user-back-cont { .user-back-cont {
position: absolute; text-align: center;
background-color: #e2e2e2;
padding: 40rpx 0;
}
.user-back-cont image {
width: 300rpx;
height: 300rpx;
}
.codeBack-yard-name {
margin-bottom: 30rpx;
}
.codeBack-yard-title {
font-size: 50rpx;
font-weight: 600;
letter-spacing: 4rpx;
margin-bottom: 20rpx;
}
/* 朋友圈弹出层 */
.sharePop {
position: fixed;
left: 0; left: 0;
top: 0; top: 0;
width: 100%; width: 100%;
height: 100%; height: 100%;
color: #2f3245; z-index: 9;
background-color: rgba(0, 0, 0, .6);
text-align: center;
} }
.user-back-avatar image { .sharePop-row {
width: 140rpx; width: 140rpx;
height: 140rpx; position: fixed;
right: 110rpx;
top: 0;
}
.shareList {
color: #ffffff;
line-height: 60rpx;
font-weight: 700;
font-size: 36rpx;
width: 100%;
height: 100%;
position: absolute;
z-index: 10;
top: 30%;
}
.shareLabel {
margin-bottom: 40rpx;
}
.shareLabel image {
width: 60rpx;
height: 60rpx;
margin: 0 20rpx;
vertical-align: middle;
}
.shareLabel text {
display: inline-block;
background: #0696ca;
width: 40rpx;
height: 40rpx;
line-height: 40rpx;
font-size: 26rpx;
border-radius: 50%; border-radius: 50%;
margin-top: -60rpx; margin: 8rpx 10rpx 0 0;
margin-bottom: 20rpx;
border: 6rpx solid #fff1d1;
}
.user-back-yard {
margin-top: 40rpx;
}
.codeBack-yard-name {
font-size: 28rpx;
color: #af7700;
}
.user-back-yard image {
width: 240rpx;
height: 240rpx;
margin-bottom: 20rpx;
} }

View File

@@ -58,7 +58,7 @@ Page({
count : res.data.count, count : res.data.count,
coupons : res.data.list coupons : res.data.list
}) })
}) }).catch(err => {});
}, },
/** /**

View File

@@ -41,7 +41,7 @@ Page({
lodingStats : false lodingStats : false
}) })
wx.stopPullDownRefresh() wx.stopPullDownRefresh()
}) }).catch(err => {});
}, },
/** /**

View File

@@ -170,7 +170,7 @@ Page({
},fail : res=> { },fail : res=> {
} }
}) })
}) }).catch(err => {});
}, },
/** /**
@@ -182,7 +182,7 @@ Page({
this.setData({ this.setData({
merchantcardinfo : res.data merchantcardinfo : res.data
}) })
}) }).catch(err => {});
}, },
/** /**

View File

@@ -32,7 +32,7 @@ Page({
account: res.data.account, account: res.data.account,
typeArr: res.data.accounts typeArr: res.data.accounts
}) })
}) }).catch(err=>{})
}, },
/** /**

View File

@@ -1,17 +1,23 @@
<view class="favourTitle">
<image class="favourTitle-img" src="/static/img/favour_title.png" mode="widthFix"></image>
</view>
<view class="favourBack"> <view class="favourBack">
<image class="favourBack-img" src="/static/img/favour_back.png" mode="widthFix"></image> <image class="favourBack-img" src="/static/img/favour_back.png" mode="widthFix"></image>
<view class="favourBack-cont-title">我的{{typeArr[typeIndex].value}}</view>
<view class="favourBack-cont"> <view class="favourBack-cont">
<view class="favourBack-cont-title">本时生活 -- 积分赠与</view>
<view class="favourBack-cont-name">{{typeArr[typeIndex].value}}</view> <view class="favourBack-cont-name">{{typeArr[typeIndex].value}}</view>
<view class="favourBack-cont-number">{{typeArr[typeIndex].key == 'silver' ? account.silver : account.drill}}</view> <view class="favourBack-cont-number">
<text>{{typeArr[typeIndex].key == 'silver' ? account.silver : account.drill}}</text>元
</view> </view>
</view> </view>
<view class="favourCont"> <view class="favourCont">
<view class="favourCont-title">赠好友积分</view> <view class="favourBlack">
<view class="favourCont-title">赠好友消费红包</view>
<form bindsubmit="formSubmit"> <form bindsubmit="formSubmit">
<view class="favourCont-label"> <view class="favourCont-label">
<view class="favourCont-name">积分账户</view> <view class="favourCont-name">账户类型</view>
<picker class="favourCont-picker" range="{{typeArr}}" range-key="value" bindchange="typeBind"> <picker class="favourCont-picker" range="{{typeArr}}" range-key="value" bindchange="typeBind">
<view class="tabs-text"> <view class="tabs-text">
{{typeArr[typeIndex].value}} {{typeArr[typeIndex].value}}
@@ -20,9 +26,9 @@
</picker> </picker>
</view> </view>
<view class="favourCont-label"> <view class="favourCont-label">
<view class="favourCont-name">手机号</view> <view class="favourCont-name">好友手机号</view>
<view class="favourCont-check"> <view class="favourCont-check">
<input type="number" bindinput="bindKeyInput" placeholder="输入被转人手机号" /> <input type="number" bindinput="bindKeyInput" placeholder="输入好友手机号" />
<view class="favourCont-check-btn" bindtap="checkTel">校验号码</view> <view class="favourCont-check-btn" bindtap="checkTel">校验号码</view>
</view> </view>
</view> </view>
@@ -35,9 +41,16 @@
<input type="number" name="paypass" placeholder="请输入支付密码" password /> <input type="number" name="paypass" placeholder="请输入支付密码" password />
</view> </view>
<button class="favourCont-btn" formType="submit" disabled="{{disabled}}">立即转入</button> <button class="favourCont-btn" formType="submit" disabled="{{disabled}}">立即转入</button>
<navigator class="favourCont-record" hover-class="none" url="/pages/account/account?type={{typeArr[typeIndex].key}}"><text>赠与记录</text></navigator>
</form> </form>
</view> </view>
<navigator class="favourCont-record" hover-class="none"
url="/pages/account/account?type={{typeArr[typeIndex].key}}"><text>赠予记录</text>
</navigator>
</view>
</view>
<!-- 校验手机号弹出 --> <!-- 校验手机号弹出 -->
<view class="popTel-back" wx:if="{{popShow}}"></view> <view class="popTel-back" wx:if="{{popShow}}"></view>

View File

@@ -1,9 +1,15 @@
page { page {
background: #fcdece; background-color: #000000;
}
.favourTitle {
text-align: center;
margin: 40rpx 0;
} }
.favourBack{ .favourBack{
position: relative; position: relative;
width: 100vw;
} }
.favourBack-img { .favourBack-img {
@@ -13,128 +19,129 @@ page {
.favourBack-cont { .favourBack-cont {
position: absolute; position: absolute;
top: 0; top: 100rpx;
width: 100%;
padding: 140rpx 40rpx;
box-sizing: border-box;
left: 0; left: 0;
color: #ca3c19; padding-left: 14%;
} z-index: 1;
color: #606060;
.favourBack-cont-title { width: 100%;
font-size: 32rpx; box-sizing: border-box;
font-weight: 600;
margin-bottom: 30rpx;
}
.favourBack-cont-name {
font-size: 46rpx;
font-weight: 600;
} }
.favourBack-cont-number { .favourBack-cont-number {
background-color: #ff5e5d; color: #000000;
color: #fff; width: 100%;
border-radius: 50rpx; margin-top: 20rpx;
display: inline-block;
padding: 4rpx 20rpx;
margin-top: 15rpx;
} }
/* 表单 */ .favourBack-cont-number text {
.favourCont { font-size: 50rpx;
background-color: #fff;
margin: 0 30rpx;
padding: 0 40rpx 60rpx;
box-sizing: border-box;
border-radius: 30rpx;
}
.favourCont-title {
text-align: center;
color: #d57449;
font-size: 38rpx;
font-weight: 600; font-weight: 600;
width: 100%; padding-right: 10rpx;
padding: 30rpx 0 50rpx; display: inline-block;
} }
.favourCont-label { .favourBack-cont-title {
position: relative;
line-height: 80rpx;
background-color: #f4f4f4;
margin-bottom: 40rpx;
font-size: 28rpx;
}
.favourCont-name {
background-color: #ffffff;
width: 130rpx;
}
.favourCont-label>input,
.favourCont-picker,
.favourCont-check {
position: absolute; position: absolute;
left: 0;
font-size: 28rpx;
top: 0; top: 0;
display: block; left: 0;
height: 80rpx; width: 100%;
padding: 0 30rpx 0 160rpx; text-align: center;
font-size: 26rpx;
line-height: 50rpx;
}
.favourCont {
background-color: #ffffff;
padding: 40rpx 50rpx;
width: 100%; width: 100%;
box-sizing: border-box; box-sizing: border-box;
border-radius: 5rpx 5rpx 0 0;
} }
.favourCont-picker image { .favourBlack {
width: 50rpx; background-color: #e9e9e9;
height: 50rpx; padding: 40rpx;
position: absolute; box-sizing: border-box;
right: 10rpx; border-radius: 45rpx;
top: 14rpx;
}
.favourCont-btn {
background: linear-gradient(to right, #ff8e65, #ff5f5d);
color: #fff;
margin-top: 80rpx;
width: 100% !important;
font-size: 32rpx;
line-height: 54rpx;
} }
.favourCont-record { .favourCont-record {
line-height: 90rpx;
text-align: center; text-align: center;
color: #ff5f5d; font-size: 34rpx;
font-size: 30rpx; }
font-weight: 600;
.favourCont-title {
font-size: 45rpx;
text-align: center;
}
.favourCont-label {
display: flex;
margin-top: 40rpx; margin-top: 40rpx;
text-align: center; font-size: 28rpx;
width: 100%;
} }
.favourCont-record text { .favourCont-check,
border-bottom: #ff5f5d solid 4rpx; .favourCont-picker,
display: inline-block; .favourCont-label>input {
} background-color: #c9c9c9;
display: flex;
.favourCont-check { width: calc(100% - 160rpx);
padding: 0 20rpx;
box-sizing: border-box;
height: 80rpx;
line-height: 80rpx; line-height: 80rpx;
} }
.favourCont-check>input { .favourCont-picker {
position: relative;
}
.favourCont-picker image {
width: 40rpx;
height: 40rpx;
position: absolute;
right: 0;
top: 20rpx;
z-index: 2;
}
.favourCont-label input {
height: 80rpx; height: 80rpx;
line-height: 80rpx;
}
.favourCont-name {
width: 160rpx;
line-height: 80rpx;
} }
.favourCont-check-btn { .favourCont-check-btn {
font-size: 28rpx; width: 150rpx;
text-align: center;
background-color: #a1a1a1;
line-height: 60rpx;
height: 60rpx;
margin-top: 10rpx;
font-size: 24rpx;
}
.favourCont-btn {
width: 100% !important;
background-color: #dbc190;
margin-top: 40rpx;
border-radius: 60rpx;
}
.tabs-text {
width: 100%;
position: absolute; position: absolute;
right: 0; left: 0;
top: 0; top: 0;
background: #ff8e65; padding-left: 20rpx;
padding: 0 20rpx; box-sizing: border-box;
color: #fff;
z-index: 9;
} }
/* 校验弹出层 */ /* 校验弹出层 */

View File

@@ -36,7 +36,7 @@ Page({
this.setData({ this.setData({
frozenData: res.data frozenData: res.data
}) })
}) }).catch(err => {});
}, },
// 轮播滑动 // 轮播滑动

View File

@@ -159,7 +159,7 @@ Page({
}, },
/** /**
* 处理未登录时的转跳 * 处理权益未登录时的转跳
*/ */
userNav(e){ userNav(e){
let user_lng = this.data.longitude, //经度 let user_lng = this.data.longitude, //经度
@@ -181,6 +181,23 @@ Page({
}) })
}, },
/**
* 处理未登录时的转跳
*/
userUrl(e){
let pageUrl = e.currentTarget.dataset.url
if(this.data.isUser){
wx.navigateTo({
url: pageUrl
})
}else{
// 去登录
wx.navigateTo({
url: "/pages/login/login"
})
}
},
/** /**
* 点击轮播图片 * 点击轮播图片
*/ */
@@ -364,7 +381,7 @@ Page({
wx.hideLoading(); wx.hideLoading();
}, 1000) }, 1000)
}) }).catch(err => {});
} }
}, },
fail: err => { fail: err => {

View File

@@ -38,7 +38,6 @@
<i class="light"></i> <i class="light"></i>
</swiper-item> </swiper-item>
</swiper> </swiper>
</view> </view>
</view> </view>
@@ -148,3 +147,13 @@
</view> </view>
</view> </view>
</block> </block>
<!-- 漂浮窗 -->
<view class="indexFloat">
<view bindtap="userUrl" data-url="/pages/favour/favour" class="indexFloat-img">
<image src="https://lifetest.ysd-bs.com/storage/materials/2021/08/06/index_float_00.png" mode="aspectFill" class="indexFloat-animation"></image>
</view>
<view bindtap="userUrl" data-url="/pages/code/code" class="indexFloat-img">
<image src="/static/img/index_float_01.png" mode="aspectFill"></image>
</view>
</view>

View File

@@ -686,3 +686,36 @@ page {
25% {opacity: 0;transform: translateX(-3px);} 25% {opacity: 0;transform: translateX(-3px);}
75% {opacity: 1;transform: translateX(3px);} 75% {opacity: 1;transform: translateX(3px);}
} }
/* 漂浮弹出层 */
.indexFloat {
position: fixed;
right: 20rpx;
bottom: 30rpx;
z-index: 99;
}
.indexFloat-img image {
width: 130rpx;
height: 130rpx;
margin-bottom: 20rpx;
}
.indexFloat-animation {
animation: shake 3s linear infinite;
}
@keyframes shake {
70%, 80% {
transform: rotate(7deg);
}
75% {
transform: rotate(-7deg);
}
65%,
85% {
transform: rotate(0);
}
}

View File

@@ -133,7 +133,7 @@ Page({
// 清除扫码进入获取parent_id的缓存 // 清除扫码进入获取parent_id的缓存
wx.removeStorageSync('parentId') wx.removeStorageSync('parentId')
}) }).catch(err => {});
} }
}) })

View File

@@ -47,17 +47,10 @@ Page({
}) })
}).catch(err=>{ }).catch(err=>{
if(!err.login){ if(!err.login){
wx.showModal({ // 写入缓存
title : '用户登录已过期', wx.setStorage({
content : '请重新登录', key : 'token',
showCancel : false, data : ''
success : res => {
if (res.confirm) {
wx.redirectTo({
url: '/pages/login/login'
})
}
}
}) })
} }
}) })
@@ -105,7 +98,11 @@ Page({
}, 2000) }, 2000)
}).catch(err=>{ }).catch(err=>{
if(!err.login){ if(!err.login){
// 写入缓存
wx.setStorage({
key : 'token',
data : ''
})
} }
}) })
}, },

View File

@@ -56,7 +56,7 @@ Page({
accounts : newData, accounts : newData,
page : res.data.page page : res.data.page
}) })
}) }).catch(err => {});
}, },
/** /**

View File

@@ -6,6 +6,7 @@
<text>¥</text>{{number}} <text>¥</text>{{number}}
</view> </view>
</view> </view>
<navigator hover-class="none" url="/pages/myProfit/myProfit" class="balanceUrl">我的收益<image src="/static/img/balance-icon-row.png" mode="aspectFill"></image></navigator>
</view> </view>
<navigator hover-class="none" url="/pages/withdrawal_form/withdrawal_form" class="label"> <navigator hover-class="none" url="/pages/withdrawal_form/withdrawal_form" class="label">
@@ -16,7 +17,7 @@
<image class="labelLeft-arrow" src="/static/icon/rightsArrow.png"></image> <image class="labelLeft-arrow" src="/static/icon/rightsArrow.png"></image>
</navigator> </navigator>
<navigator hover-class="none" url="/pages/withdrawal_record/withdrawal_record" class="label"> <navigator hover-class="none" url="/pages/withdrawal_record/withdrawal_record?status=''&idx=0" class="label">
<view class="labelLeft"> <view class="labelLeft">
<image class="labelLeft-img" src="/static/img/balance-icon-01.png"></image> <image class="labelLeft-img" src="/static/img/balance-icon-01.png"></image>
<view class="labelLeft-name">提现记录</view> <view class="labelLeft-name">提现记录</view>

View File

@@ -26,7 +26,7 @@
} }
.balanceCont-number { .balanceCont-number {
color: #ffba33; color: #ffd890;
font-size: 80rpx; font-size: 80rpx;
font-weight: 600; font-weight: 600;
} }
@@ -36,6 +36,26 @@
padding-right: 10rpx; padding-right: 10rpx;
} }
.balanceUrl {
position: absolute;
right: 0;
top: 30rpx;
background-color: #37332d;
font-size: 28rpx;
border-radius: 40rpx 0 0 40rpx;
line-height: 68rpx;
border: 2rpx solid #887351;
padding-left: 30rpx;
color: #ead2a5;
display: flex;
}
.balanceUrl image {
width: 54rpx;
height: 54rpx;
margin-top: 9rpx;
}
/* 提现 */ /* 提现 */
.label { .label {
background-color: white; background-color: white;

194
pages/myProfit/myProfit.js Normal file
View File

@@ -0,0 +1,194 @@
// pages/myProfit/myProfit.js
Page({
/**
* 页面的初始数据
*/
data: {
profitCount : '', //收益数据-人数
profitFinance : '', //收益数据-收益信息
profitUser : '', //收益数据-用户信息
incometCount : '', //收益统计-团队
incometFfinance : '', //收益统计-收益
incometOrder : '', //收益统计-订单
incometMonths : '', //收益数据-月份列表
monthsIndex : 1, //账变记录筛选index
monthsValue : '', //账变记录筛选value
changeStyle : 'report', //tab默认选择类型
//收益订单筛选列表
ordersWay : [
{value: '0', name: "充值", type: 'recharge'},
{value: '1', name: "产品", type: 'product'}
],
ordersIndex : 0, //收益订单筛选列表index
ordersValue : 'recharge', //收益订单筛选列表value
publicData : [], //订单与团队 公共数据列表
//我的团队筛选列表
teamWay : [
{value: 0, name: "用户"},
{value: 1, name: "达人"}
],
teamIndex : 0, //我的团队筛选列表index
teamValue : 0, //我的团队筛选列表value
teamSort : 'asc', //我的团队排序
page : {}, //下一页
lodingStats : false, //加载状态
},
/**
* 生命周期函数--监听页面加载
*/
onLoad (options) { // })
},
/**
* 生命周期函数--监听页面显示
*/
onShow () {
// 获取我的收益数据
this.profitInfo();
// 获取本月收益统计
this.incomeInfo();
},
/**
* tab栏选择
*/
changeTabbar(e) {
this.setData({
changeStyle: e.currentTarget.dataset.style
})
if(e.currentTarget.dataset.style == 'report'){
// 获取收益统计
this.incomeInfo();
return
}
// 获取收益订单列表 + 我的团队列表
this.publicInfo();
},
/**
* 我的收益数据
*/
profitInfo() {
wx.$api.user.myProfit().then(res=>{
this.setData({
profitCount : res.data.count,
profitFinance: res.data.finance,
profitUser : res.data.user
})
}).catch(err=>{})
},
/**
* 收益统计
*/
incomeInfo() {
wx.$api.user.myIncome(this.data.monthsValue).then(res=>{
this.setData({
incometCount : res.data.count,
incometFfinance: res.data.finance,
incometOrder : res.data.order,
incometMonths : res.data.months,
monthsIndex : parseInt(res.data.this_month) - 1
})
}).catch(err=>{})
},
/**
* 收益订单列表 + 我的团队列表
*/
publicInfo(page) {
let newStyle = this.data.changeStyle
let url = ''
if(newStyle == 'order') url = wx.$api.user.profitOrders(this.data.ordersValue, page)
if(newStyle == 'team') url = wx.$api.user.profitTeam(this.data.teamValue, this.data.teamSort, page)
url.then(res=>{
let listArr = this.data.publicData,
newData = []
if(page == 1 || page == undefined) listArr = []
newData = listArr.concat(res.data.data)
this.setData({
publicData : newData,
page : res.data.page,
lodingStats : false
})
wx.stopPullDownRefresh()
}).catch(err=>{})
},
/**
* 月份选择
*/
screenBind(val) {
let newValue = parseInt(val.detail.value)
this.setData({
monthsValue : newValue + 1,
monthsIndex : val.detail.value
})
// 获取收益统计
this.incomeInfo();
},
/**
* 订单类型选择
*/
screenOrders(val) {
this.setData({
ordersIndex: val.detail.value,
ordersValue: this.data.ordersWay[val.detail.value].type
})
// 获取收益订单列表 + 我的团队列表
this.publicInfo();
},
/**
* 团队类型选择
*/
screenTeam(val) {
this.setData({
teamIndex: val.detail.value,
teamValue: this.data.ordersWay[val.detail.value].value
})
// 获取收益订单列表 + 我的团队列表
this.publicInfo();
},
/**
* 销量排序
*/
teamTap () {
if (this.data.teamSort == 'asc') {
this.setData({
teamSort : 'desc',
})
} else {
this.setData({
teamSort : 'asc',
})
}
// 获取收益订单列表 + 我的团队列表
this.publicInfo();
},
/**
* 上拉加载
*/
onReachBottom(){
this.setData({
lodingStats: true
})
let pageNumber = this.data.page.current
if(this.data.page.has_more){
pageNumber++
this.publicInfo(pageNumber)
}
}
})

View File

@@ -0,0 +1,6 @@
{
"usingComponents": {},
"navigationBarTitleText": "我的收益",
"navigationBarBackgroundColor": "#d0a76c",
"navigationBarTextStyle": "white"
}

View File

@@ -0,0 +1,355 @@
<view class="profigHead">
<view class="profigHead-user">
<image src="{{profitUser.avatar}}" mode="aspectFill"></image>{{profitUser.nickname}}的收益
</view>
<image class="profigHead-img" src="/static/img/profigLabel_back.png" mode="widthFix"></image>
</view>
<view class="profigCont">
<view class="profigLabel">
<view class="profigLabel-top">
我在本时生活总收益!
</view>
<view class="profigLabel-balance">
<view class="profigLabel-balance-left">
<view class="profigLabel-balance-name">余额</view>
<view class="profigLabel-balance-price">¥<text>{{profitUser.account.balance}}</text></view>
</view>
<navigator hover-class="none" url="/pages/withdrawal_form/withdrawal_form" class="profigLabel-balance-withdrawal">提现</navigator>
</view>
<view class="profigLabel-list">
<view class="profigLabel-list-label">
<navigator hover-class="none" url="/pages/myProfit_list/myProfit_list?name=share_product" class="profigLabel-list-name">
分享产品收益<image src="/static/img/profigLabel_row.png" mode="aspectFill"></image>
</navigator>
<view class="profigLabel-list-price">
{{profitFinance.share_product}}
</view>
</view>
<view class="profigLabel-list-label">
<navigator hover-class="none" url="/pages/myProfit_list/myProfit_list?name=team_product" class="profigLabel-list-name">
团队产品消费收益<image src="/static/img/profigLabel_row.png" mode="aspectFill"></image>
</navigator>
<view class="profigLabel-list-price">
{{profitFinance.team_product}}
</view>
</view>
<view class="profigLabel-list-label">
<navigator hover-class="none" url="/pages/myProfit_list/myProfit_list?name=share_Recharge" class="profigLabel-list-name">
分享储值收益<image src="/static/img/profigLabel_row.png" mode="aspectFill"></image>
</navigator>
<view class="profigLabel-list-price">
{{profitFinance.share_Recharge}}
</view>
</view>
<view class="profigLabel-list-label">
<navigator hover-class="none" url="/pages/myProfit_list/myProfit_list?name=team_recharge" class="profigLabel-list-name">
团队储值收益<image src="/static/img/profigLabel_row.png" mode="aspectFill"></image>
</navigator>
<view class="profigLabel-list-price">
{{profitFinance.team_recharge}}
</view>
</view>
<view class="profigLabel-list-label">
<view class="profigLabel-list-name">
达人总数
</view>
<view class="profigLabel-list-price">
{{profitCount.leader}}
</view>
</view>
<view class="profigLabel-list-label">
<view class="profigLabel-list-name">
用户总数
</view>
<view class="profigLabel-list-price">
{{profitCount.users}}
</view>
</view>
</view>
<view class="profigLabel-cash">
<view class="profigLabel-cash-label">
<view class="profigLabel-cash-name">
总收益
</view>
<view class="profigLabel-cash-price">
{{profitFinance.all_profit}}
</view>
</view>
<view class="profigLabel-cash-label">
<navigator hover-class="none" url="/pages/withdrawal_record/withdrawal_record?status=end&idx=2" class="profigLabel-cash-name profigLabel-cash-active">
已提现
</navigator>
<view class="profigLabel-cash-price">
{{profitFinance.withdrawed}}
</view>
</view>
<view class="profigLabel-cash-label">
<navigator hover-class="none" url="/pages/withdrawal_record/withdrawal_record?status=init&idx=1" class="profigLabel-cash-name profigLabel-cash-active">
提现中
</navigator>
<view class="profigLabel-cash-price">
{{profitFinance.withdrawing}}
</view>
</view>
</view>
</view>
<view class="profigTab">
<view class="profigTab-nav">
<view class="profigTab-nav-name {{changeStyle == 'report' ? 'active' : ''}}" data-style="report"
bindtap="changeTabbar">收益报表</view>
<view class="profigTab-nav-name {{changeStyle == 'order' ? 'active' : ''}}" data-style="order"
bindtap="changeTabbar">收益订单</view>
<view class="profigTab-nav-name {{changeStyle == 'team' ? 'active' : ''}}" data-style="team"
bindtap="changeTabbar">我的团队</view>
</view>
<view class="profigTab-list">
<!-- 本月收益统计 -->
<view class="profigReport {{changeStyle == 'report' ? 'show' : ''}}">
<view class="profigReport-module">
<view class="profigReport-module-title">
<view class="profigReport-module-name">
本月收益统计
</view>
<view class="profigReport-module-picker">
<picker bindchange="screenBind" value="{{monthsIndex}}" range-key="name"
range="{{incometMonths}}">
{{incometMonths[monthsIndex].name}}
</picker>
<image class="profigReport-module-icon" src="/static/icon/arrow_down.png"></image>
</view>
</view>
<view class="profigReport-list">
<view class="profigReport-list-label">
<view class="profigReport-label-name">
分享产品收益
</view>
<view class="profigLabel-label-price">
{{incometFfinance.share_product.this_month}}
</view>
<view class="profigLabel-label-billie {{incometFfinance.share_product.this_month >= 0 ? '':'active'}}">
<image
src="{{incometFfinance.share_product.this_month >= 0 ? '/static/img/profig_billie_icon.png' : '/static/img/profig_billie_icon_active.png'}}"
mode="aspectFill"></image>
{{incometFfinance.share_product.text}}
</view>
</view>
<view class="profigReport-list-label">
<view class="profigReport-label-name">
团队产品消费收益
</view>
<view class="profigLabel-label-price">
{{incometFfinance.team_product.this_month}}
</view>
<view class="profigLabel-label-billie {{incometFfinance.team_product.this_month >= 0 ? '':'active'}}">
<image
src="{{incometFfinance.team_product.this_month >= 0 ? '/static/img/profig_billie_icon.png' : '/static/img/profig_billie_icon_active.png'}}"
mode="aspectFill"></image>
{{incometFfinance.team_product.text}}
</view>
</view>
<view class="profigReport-list-label">
<view class="profigReport-label-name">
分享储值收益
</view>
<view class="profigLabel-label-price">
{{incometFfinance.share_recharge.this_month}}
</view>
<view class="profigLabel-label-billie {{incometFfinance.share_recharge.this_month >= 0 ? '':'active'}}">
<image
src="{{incometFfinance.share_recharge.this_month >= 0 ? '/static/img/profig_billie_icon.png' : '/static/img/profig_billie_icon_active.png'}}"
mode="aspectFill"></image>
{{incometFfinance.share_recharge.text}}
</view>
</view>
<view class="profigReport-list-label">
<view class="profigReport-label-name">
团队储值收益
</view>
<view class="profigLabel-label-price">
{{incometFfinance.team_recharge.this_month}}
</view>
<view class="profigLabel-label-billie {{incometFfinance.team_recharge.this_month >= 0 ? '':'active'}}">
<image
src="{{incometFfinance.team_recharge.this_month >= 0 ? '/static/img/profig_billie_icon.png' : '/static/img/profig_billie_icon_active.png'}}"
mode="aspectFill"></image>
{{incometFfinance.team_recharge.text}}
</view>
</view>
</view>
</view>
<view class="profigReport-module profigReport-module-subset">
<view class="profigReport-subset-name">
新增团队统计
</view>
<view class="profigReport-list">
<view class="profigReport-subset-label">
<view class="profigReport-label-name">
新增达人数
</view>
<view class="profigLabel-label-price">
{{incometCount.leader}}
</view>
</view>
<view class="profigReport-subset-label">
<view class="profigReport-label-name">
新增用户数
</view>
<view class="profigLabel-label-price">
{{incometCount.users}}
</view>
</view>
</view>
</view>
<view class="profigReport-module profigReport-module-subset">
<view class="profigReport-subset-name">
消费订单统计
</view>
<view class="profigReport-list">
<view class="profigReport-subset-label">
<view class="profigReport-label-name">
产品消费
</view>
<view class="profigLabel-label-price">
{{incometOrder.product}}
</view>
</view>
<view class="profigReport-subset-label">
<view class="profigReport-label-name">
储值消费
</view>
<view class="profigLabel-label-price">
{{incometOrder.recharge}}
</view>
</view>
</view>
</view>
</view>
<!-- 收益订单 -->
<view class="profigOrder {{changeStyle == 'order' ? 'show' : ''}}">
<view class="profigOrder-module-title">
<view class="profigOrder-module-name">
共<text>{{publicData.length}}</text>条订单
</view>
<view class="profigReport-module-picker">
<picker bindchange="screenOrders" value="{{ordersIndex}}" range-key="name"
range="{{ordersWay}}">
{{ordersWay[ordersIndex].name}}
</picker>
<image class="profigReport-module-icon" src="/static/icon/arrow_down.png"></image>
</view>
</view>
<block wx:if="{{publicData.length > 0}}">
<view class="profigOrder-list" wx:for="{{publicData}}" wx:key="publicData">
<view class="profigOrder-no">
<view class="profigOrder-no-name">
<text
class="profigOrder-no-tips {{item.type == 'recharge' ? '' : 'active'}}">{{item.type
==
'recharge' ? '储值' : '产品'}}</text>订单号:{{item.order.orderid}}
<image src="/static/img/frozen_time.png" mode="aspectFill"></image>
</view>
<view class="profigOrder-no-text">
{{item.name}}
</view>
</view>
<view class="profigOrder-info">
<view class="profigOrder-label">
姓名:{{item.user.nickname}}
</view>
<view class="profigOrder-label">
联系电话:{{item.user.username}}
</view>
<view class="profigOrder-label profigOrder-label-color">
佣金:¥{{item.bonus}}
</view>
<view class="profigOrder-label">
当前状态:{{item.order.status}}
</view>
</view>
</view>
<view class="pagesLoding" wx:if="{{lodingStats}}">
<block wx:if="{{page.has_more}}">
<image class="pagesLoding-icon" src="/static/icon/refresh_loding.gif" mode="widthFix">
</image>
加载中...
</block>
<block wx:else>
没有更多了~
</block>
</view>
</block>
<!-- 暂无内容 -->
<view class="public-hint" wx:else>
<image src="/static/img/legal_tips.png"></image>
<view>抱歉,目前暂无数据~</view>
</view>
</view>
<!-- 我的团队 -->
<view class="profigTeam {{changeStyle == 'team' ? 'show' : ''}}">
<view class="profigTeam-module-title">
<view class="profigOrder-module-title">
<view class="profigOrder-module-name">
共<text>{{publicData.length}}</text>人
</view>
<view class="profigReport-module-picker">
<picker bindchange="screenTeam" value="{{teamIndex}}" range-key="name" range="{{teamWay}}">
{{teamWay[teamIndex].name}}
</picker>
<image class="profigReport-module-icon" src="/static/icon/arrow_down.png"></image>
</view>
</view>
<view class="profigTeam-ranking {{teamSort == 'asc' ? 'ascactive' : 'descactive'}}" bindtap="teamTap">
创收排行
</view>
</view>
<block wx:if="{{publicData.length > 0}}">
<view class="profigTeam-list">
<view class="profigTeam-nav">
<view class="profigTeam-name">达人姓名</view>
<view class="profigTeam-name">联系电话</view>
<view class="profigTeam-name">身份</view>
<view class="profigTeam-name">创收额</view>
</view>
<view class="profigTeam-label">
<view class="profigTeam-label-list" wx:for="{{publicData}}" wx:key="publicData">
<view class="profigTeam-label-cont profigTeam-label-head">
<image src="{{item.user.avatar}}" mode="aspectFill"></image>
<view class="nowrap profigTeam-label-name">{{item.user.nickname}}</view>
</view>
<view class="nowrap profigTeam-label-cont">
{{item.user.username}}
</view>
<view class="nowrap profigTeam-label-cont">
{{item.user.identity.identity_name}}
</view>
<view class="nowrap profigTeam-label-cont profigTeam-label-color">
{{item.balance}}
</view>
</view>
<view class="pagesLoding" wx:if="{{lodingStats}}">
<block wx:if="{{page.has_more}}">
<image class="pagesLoding-icon" src="/static/icon/refresh_loding.gif"
mode="widthFix">
</image>
加载中...
</block>
<block wx:else>
没有更多了~
</block>
</view>
</view>
</view>
</block>
<!-- 暂无内容 -->
<view class="public-hint" wx:else>
<image src="/static/img/legal_tips.png"></image>
<view>抱歉,目前暂无数据~</view>
</view>
</view>
</view>
</view>
</view>

View File

@@ -0,0 +1,541 @@
page {
background-color: #ececec;
}
/* 头部 */
.profigHead {
background: linear-gradient(to bottom, #d0a76c 50%, #ffffff);
padding: 30rpx;
height: 300rpx;
width: 100%;
box-sizing: border-box;
overflow: hidden;
}
.profigHead-user {
line-height: 90rpx;
display: flex;
}
.profigHead-user image {
width: 90rpx;
height: 90rpx;
margin-right: 20rpx;
border-radius: 50%;
border: 2rpx solid #ffffff;
}
.profigHead-img {
opacity: .1;
width: 300rpx;
height: 300rpx;
position: absolute;
top: -50rpx;
right: -40rpx;
}
/* 内容 */
.profigCont {
position: absolute;
top: 140rpx;
padding: 30rpx;
box-sizing: border-box;
width: 100%;
}
.profigLabel {
background-color: #2f2e2c;
border-radius: 20rpx;
overflow: hidden;
}
.profigLabel-top {
background: linear-gradient(-250deg, #feecd4, #d5b687 90%);
padding: 0 30rpx;
height: 90rpx;
line-height: 90rpx;
}
.profigLabel-balance {
color: #efd8b8;
padding: 30rpx 40rpx;
box-sizing: border-box;
display: flex;
}
.profigLabel-balance-left {
flex: 1;
}
.profigLabel-balance-name {
font-size: 28rpx;
}
.profigLabel-balance-left text {
font-size: 56rpx;
font-weight: 600;
}
.profigLabel-balance-withdrawal {
background-color: #fdebd3;
color: #000000;
display: inline-block;
height: 64rpx;
line-height: 64rpx;
padding: 0 40rpx;
border-radius: 60rpx;
margin-top: 40rpx;
}
.profigLabel-list-name {
margin-bottom: 10rpx;
display: flex;
}
.profigLabel-list-name image {
width: 20rpx;
height: 20rpx;
margin: 10rpx;
}
.profigLabel-list {
padding: 30rpx 40rpx 0;
box-sizing: border-box;
}
.profigLabel-list,
.profigLabel-cash {
color: #ffffff;
position: relative;
overflow: hidden;
font-size: 28rpx;
}
.profigLabel-list::after,
.profigLabel-list::before {
position: absolute;
content: '';
left: 0;
width: 100%;
height: 0;
border-top: 2rpx dotted #665f54;
}
.profigLabel-list::after {
top: 0;
}
.profigLabel-list::before {
bottom: 0;
}
.profigLabel-list-label {
width: 50%;
float: left;
margin-bottom: 40rpx;
}
.profigLabel-cash {
text-align: center;
padding: 30rpx 0;
}
.profigLabel-cash-label {
width: 33.33%;
float: left;
}
.profigLabel-cash-name {
margin-bottom: 10rpx;
display: inline-block;
position: relative;
}
.profigLabel-cash-active::after {
position: absolute;
content: '';
left: 0;
bottom: 4rpx;
width: 100%;
height: 2rpx;
background-color: #ffffff;
}
/* tab选项卡 */
.profigTab-nav {
display: flex;
line-height: 120rpx;
}
.profigTab-nav-name {
width: 33.33%;
flex: 3;
text-align: center;
position: relative;
}
.profigTab-nav-name.active {
color: #ffa30a;
}
.profigTab-nav-name.active::after {
position: absolute;
content: '';
left: calc(50% - 30rpx);
bottom: 15rpx;
width: 60rpx;
height: 8rpx;
background-color: #ffa30a;
}
/* tab收益报表内容 */
.profigReport,
.profigOrder,
.profigTeam {
border-radius: 20rpx;
margin-top: 20rpx;
display: none;
}
.profigReport.show,
.profigOrder.show,
.profigTeam.show {
display: block;
}
.profigReport {
background-color: #ffffff;
}
.profigReport-module {
padding: 30rpx 30rpx 40rpx;
box-sizing: border-box;
}
.profigReport-module-title {
display: flex;
}
.profigReport-module-name {
flex: 1;
font-weight: 700;
}
.profigReport-module-picker {
display: flex;
color: #797979;
font-size: 28rpx;
padding-top: 4rpx;
}
.profigReport-module-icon {
width: 28rpx;
height: 28rpx;
margin: 6rpx 0 0 10rpx;
}
.profigLabel-label-billie {
background-color: #fcf6ea;
border: 2rpx solid #f7e5db;
color: #f2863b;
padding-right: 20rpx;
height: 48rpx;
line-height: 48rpx;
font-size: 22rpx;
display: inline-flex;
border-radius: 10rpx;
}
.profigLabel-label-billie image {
width: 22rpx;
height: 22rpx;
margin: 12rpx 10rpx;
}
.profigLabel-label-billie.active {
color: #00a915;
background-color: #efffec;
border: 2rpx solid #c9fbbf;
}
.profigReport-list {
padding: 0 -20rpx;
width: 100%;
box-sizing: border-box;
overflow: hidden;
}
.profigReport-list-label {
width: calc(50% - 40rpx);
float: left;
margin: 40rpx 20rpx 0;
font-size: 28rpx;
}
.profigReport-label-name {
color: #999999;
}
.profigLabel-label-price {
margin: 10rpx 0;
font-size: 34rpx;
}
.profigReport-module-subset {
position: relative;
text-align: center;
}
.profigReport-module-subset::after {
position: absolute;
content: '';
left: 0;
top: 0;
width: 100%;
height: 0;
border-top: 2rpx solid #e4e4e4;
}
.profigReport-subset-name {
text-align: center;
margin: 0 auto 40rpx;
font-size: 28rpx;
background-color: #f1f1f1;
padding: 0 30rpx;
line-height: 64rpx;
display: inline-block;
border-radius: 10rpx;
}
.profigReport-subset-label {
text-align: center;
width: 50%;
float: left;
font-size: 28rpx;
}
/* tab收益订单内容 */
.profigOrder-list {
background-color: white;
padding: 30rpx;
box-sizing: border-box;
border-radius: 10rpx;
font-size: 28rpx;
margin-bottom: 30rpx;
}
.profigOrder-no {
position: relative;
padding-bottom: 20rpx;
margin-bottom: 20rpx;
}
.profigOrder-no::after {
position: absolute;
content: '';
left: 0;
width: 100%;
height: 0;
border-top: 2rpx dotted #e7e7e7;
bottom: 0;
}
.profigOrder-no-name {
display: flex;
line-height: 44rpx;
}
.profigOrder-no-name image {
width: 32rpx;
height: 32rpx;
margin-left: 20rpx;
margin-top: 6rpx;
}
.profigOrder-no-text {
color: #515151;
margin: 20rpx 0;
}
.profigOrder-label {
line-height: 60rpx;
}
.profigOrder-label-color {
color: #ffa30a;
}
.profigOrder-no-tips {
background-color: green;
font-size: 22rpx;
color: #ffffff;
height: 36rpx;
line-height: 36rpx;
padding: 0 10rpx;
border-radius: 30rpx;
margin: 5rpx 10rpx 0 0;
}
.profigOrder-no-tips.active {
background-color: #ffa30a;
}
.profigOrder-module-title {
background-color: #ffffff;
border-radius: 10rpx;
display: flex;
box-sizing: border-box;
line-height: 80rpx;
margin-bottom: 30rpx;
padding: 0 30rpx;
box-sizing: border-box;
font-size: 28rpx;
}
.profigOrder-module-name {
flex: 1;
}
.profigOrder-module-name text {
color: #ffa30a;
padding: 0 5rpx;
}
.profigOrder-module-title .profigReport-module-picker {
padding: 0;
}
.profigOrder-module-title .profigReport-module-icon {
margin-top: 30rpx;
}
/* tab我的团队内容 */
.profigTeam-module-title {
display: flex;
margin-bottom: 30rpx;
}
.profigTeam .profigOrder-module-title {
flex: 1;
margin: 0 30rpx 0 0;
}
.profigTeam-ranking {
width: 180rpx;
height: 80rpx;
line-height: 80rpx;
position: relative;
background-color: #ffffff;
padding: 0 20rpx;
box-sizing: border-box;
border-radius: 10rpx;
color: green;
font-size: 28rpx;
}
.profigTeam-ranking::after,
.profigTeam-ranking::before {
position: absolute;
right: 20rpx;
content: '';
width: 0;
height: 0;
border-left: 8rpx solid transparent;
border-right: 8rpx solid transparent;
}
.profigTeam-ranking::after {
bottom: 28rpx;
border-top: 8rpx solid grey;
}
.profigTeam-ranking::before {
top: 28rpx;
border-bottom: 8rpx solid grey;
}
.profigTeam-ranking.ascactive::after {
border-top: 8rpx solid green;
}
.profigTeam-ranking.descactive::before {
border-bottom: 8rpx solid green;
}
.profigTeam-list {
margin-top: 30rpx;
}
.profigTeam-nav {
background-color: #ffffff;
border-radius: 10rpx;
display: flex;
line-height: 80rpx;
margin-bottom: 20rpx;
}
.profigTeam-name {
flex: 4;
text-align: center;
width: 25%;
font-size: 28rpx;
}
.profigTeam-label {
background-color: #ffffff;
border-radius: 10rpx;
font-size: 26rpx;
}
.profigTeam-label-list {
display: flex;
border-bottom: 2rpx solid #e8e8e8;
}
.profigTeam-label-list:last-child {
border: none;
}
.profigTeam-label-cont {
line-height: 110rpx;
flex: 4;
width: 25%;
text-align: center;
}
.profigTeam-label-head {
display: flex;
}
.profigTeam-label-head image {
width: 50rpx;
height: 50rpx;
border-radius: 50%;
margin: 30rpx 20rpx;
}
.profigTeam-label-name {
width: calc(100% - 90rpx);
}
.profigTeam-label-color {
color: #ffa30a;
}
.public-hint {
background-color: #ffffff;
border-radius: 10rpx;
text-align: center;
padding: 60rpx 0;
color: #999;
font-size: 28rpx;
}
.public-hint image {
width: 160rpx;
height: 160rpx;
margin: 0 auto 20rpx;
}

View File

@@ -0,0 +1,61 @@
/*
* 手太欠
* 愿这世界都如故事里一样 美好而动人~
*/
Page({
/**
* 页面的初始数据
*/
data: {
name : '', //权益名
profitData : [], //权益列表
page : {}, //下一页
lodingStats : false, //加载状态
},
/**
* 生命周期函数--监听页面加载
*/
onLoad (options) {
this.setData({
name: options.name
})
// 获取收益列表
this.profitInfo();
},
/**
* 收益列表
*/
profitInfo(page) {
wx.$api.user.profitLogs(this.data.name, page).then(res=>{
let listArr = this.data.publicData,
newData = []
if(page == 1 || page == undefined) listArr = []
newData = listArr.concat(res.data.data)
this.setData({
publicData : newData,
page : res.data.page,
lodingStats : false
})
wx.stopPullDownRefresh()
}).catch(err=>{})
},
/**
* 上拉加载
*/
onReachBottom(){
this.setData({
lodingStats: true
})
let pageNumber = this.data.page.current
if(this.data.page.has_more){
pageNumber++
this.profitInfo(pageNumber)
}
}
})

View File

@@ -0,0 +1,4 @@
{
"usingComponents": {},
"navigationBarTitleText": "权益列表"
}

View File

@@ -0,0 +1,41 @@
<block wx:if="{{publicData.length > 0}}">
<view class="record-list" wx:for="{{publicData}}" wx:key="publicData">
<view class="record-top">
<view class="record-way">{{item.name}}</view>
<view class="record-label-status">¥{{item.bonus}}</view>
</view>
<view class="record-cont">
<view class="record-label">
<view class="record-label-name">时间</view>
<view class="record-label-time">{{item.created_at}}</view>
</view>
<view class="record-label">
<view class="record-label-name">状态</view>
<view class="record-label-time">{{item.order.status}}</view>
</view>
</view>
<view class="record-source">
<view class="record-source-name">收益来源</view>
<view class="record-source-cont">
<image class="record-source-img" src="{{item.source.avatar}}" mode="aspectFill"></image>
<view class="record-source-info">
<view class="record-source-nickname">{{item.source.nickname}}</view>
<view class="record-source-tel">{{item.source.username}}</view>
</view>
</view>
</view>
</view>
<view class="pagesLoding" wx:if="{{lodingStats}}">
<block wx:if="{{page.has_more}}">
<image class="pagesLoding-icon" src="/static/icon/refresh_loding.gif" mode="widthFix"></image>加载中...
</block>
<block wx:else>
没有更多了~
</block>
</view>
</block>
<!-- 暂无内容 -->
<view class="pack-center pages-hint" wx:else>
<image src="/static/img/legal_tips.png"></image>
<view>抱歉,目前暂无记录~</view>
</view>

View File

@@ -0,0 +1,82 @@
/* 记录列表 */
.record-list {
background-color: #fff;
border-radius: 10rpx;
margin: 30rpx;
}
.record-top {
display: flex;
padding: 30rpx;
box-sizing: border-box;
}
.record-way {
flex: 1;
}
.record-take {
font-weight: 600;
}
.record-cont {
padding: 0 30rpx;
box-sizing: border-box;
color: #999;
font-size: 28rpx;
}
.record-label {
display: flex;
line-height: 70rpx;
}
.record-label-name {
flex: 1;
}
.record-label-status {
color: red;
}
.record-source {
border-top: 10rpx solid #f7f7f7;
margin-top: 20rpx;
}
.record-source-name {
background: #f7f7f7;
color: #000;
width: 140rpx;
text-align: center;
line-height: 60rpx;
margin: 0 auto;
font-size: 28rpx;
}
.record-source-cont {
position: relative;
padding: 40rpx 30rpx 20rpx;
box-sizing: border-box;
}
.record-source-img {
width: 70rpx;
height: 70rpx;
border-radius: 50%;
}
.record-source-info {
position: absolute;
left: 0;
top: 0;
width: 100%;
padding: 40rpx 30rpx 20rpx 120rpx;
box-sizing: border-box;
line-height: 70rpx;
display: flex;
}
.record-source-nickname {
flex: 1;
}

View File

@@ -55,7 +55,7 @@ Page({
lodingStats : false lodingStats : false
}) })
wx.stopPullDownRefresh() wx.stopPullDownRefresh()
}) }).catch(err => {});
}, },
/** /**
@@ -98,7 +98,7 @@ Page({
title: res.data, title: res.data,
icon : 'none' icon : 'none'
}) })
}) }) .catch(err => {});
} else if (res.cancel) { } else if (res.cancel) {
wx.showToast({ wx.showToast({
title : '取消', title : '取消',
@@ -148,7 +148,7 @@ Page({
this.orderInfo(); this.orderInfo();
} }
}) })
}) }).catch(err => {});
} }
// payTips为2的时候为沃钱包支付 // payTips为2的时候为沃钱包支付
if(this.data.pay.payTips == 2) { if(this.data.pay.payTips == 2) {
@@ -163,7 +163,7 @@ Page({
this.setData({ this.setData({
['pay.payState']: false ['pay.payState']: false
}) })
}) }).catch(err => {});
}, },

View File

@@ -95,13 +95,13 @@
</view> </view>
<radio class="radio" value="1" checked></radio> <radio class="radio" value="1" checked></radio>
</view> </view>
<!-- <view class="payContList-label"> <view class="payContList-label">
<view class="payContList-label-name"> <view class="payContList-label-name">
<image class="payContList-label-img" src="/static/img/wqb.jpg"></image> <image class="payContList-label-img" src="/static/img/wqb.jpg"></image>
沃钱包支付 沃钱包支付
</view> </view>
<radio class="radio" value="2"></radio> <radio class="radio" value="2"></radio>
</view> --> </view>
</radio-group> </radio-group>
<button class="payWayBtn" bindtap="orderPay">确认</button> <button class="payWayBtn" bindtap="orderPay">确认</button>
</view> </view>

View File

@@ -41,7 +41,7 @@ Page({
this.setData({ this.setData({
order : res.data order : res.data
}) })
}) }).catch(err => {});
}, },
/** /**
@@ -81,7 +81,7 @@ Page({
title: res.data, title: res.data,
icon : 'none' icon : 'none'
}) })
}) }).catch(err => {});
} else if (res.cancel) { } else if (res.cancel) {
wx.showToast({ wx.showToast({
title : '取消', title : '取消',
@@ -132,7 +132,7 @@ Page({
this.orderInfo(); this.orderInfo();
} }
}) })
}) }).catch(err => {});
} }
// payTips为2的时候为沃钱包支付 // payTips为2的时候为沃钱包支付
if(this.data.pay.payTips == 2) { if(this.data.pay.payTips == 2) {

View File

@@ -86,7 +86,7 @@ Page({
}) })
} }
}, 1000) }, 1000)
}) }).catch(err => {});
} }
}, },
@@ -123,7 +123,7 @@ Page({
}) })
} }
}, 1000) }, 1000)
}) }).catch(err => {});
}, },
/** /**

View File

@@ -67,6 +67,6 @@ Page({
url: '/pages/user/user' url: '/pages/user/user'
}) })
},2000) },2000)
}) }).catch(err => {});
} }
}) })

View File

@@ -2,7 +2,7 @@
<form bindsubmit="formSubmit"> <form bindsubmit="formSubmit">
<view class="favourCont-label"> <view class="favourCont-label">
<view class="favourCont-name">手机号:</view> <view class="favourCont-name">手机号:</view>
<input type="number" password name="mobile" placeholder="请输入手机号" bindinput="getNameValue" /> <input type="number" name="mobile" placeholder="请输入手机号" bindinput="getNameValue" />
<button bindtap="sendOut" class="obtain" disabled="{{senddisabled}}" hover-class="none">{{codename}}</button> <button bindtap="sendOut" class="obtain" disabled="{{senddisabled}}" hover-class="none">{{codename}}</button>
</view> </view>
<view class="favourCont-label"> <view class="favourCont-label">

View File

@@ -37,7 +37,7 @@ Page({
lodingStats : false lodingStats : false
}) })
wx.stopPullDownRefresh() wx.stopPullDownRefresh()
}) }).catch(err => {});
}, },
/** /**

View File

@@ -4,6 +4,7 @@ Page({
* 页面的初始数据 * 页面的初始数据
*/ */
data: { data: {
parentId : '', //分享者ID
address : '', //默认收货地址 address : '', //默认收货地址
allAddress : '', //收货地址列表 allAddress : '', //收货地址列表
groupId : '', //权益id groupId : '', //权益id
@@ -16,7 +17,7 @@ Page({
content : '', //内容介绍 content : '', //内容介绍
notification: '', //重要提示 notification: '', //重要提示
remark : '', //使用须知 remark : '', //使用须知
noticeShow : false, //须知显示状态 noticeShow : true, //须知显示状态
addressShow : false, //收货地址显示 addressShow : false, //收货地址显示
getType : '', //是否显示自提 getType : '', //是否显示自提
platIndex : 0, //选择提交方式下标 platIndex : 0, //选择提交方式下标
@@ -32,8 +33,8 @@ Page({
disabled : false, disabled : false,
payWayIndex : 0, payWayIndex : 0,
payWay :[ payWay :[
{value: 0, name: "微信支付"} {value: 0, name: "微信支付"},
// {value: 1, name: "沃钱包支付"} {value: 1, name: "沃钱包支付"}
] ]
}, },
@@ -45,17 +46,18 @@ Page({
groupId : options.rightsId || options.id, groupId : options.rightsId || options.id,
typeWeb : options.type, typeWeb : options.type,
getType : options.getType, getType : options.getType,
openid : options.openid || '' openid : options.openid || '',
parentId : options.parentid || ''
}) })
// 获取详情
this.rightsInfo();
}, },
/** /**
* 生命周期函数--监听页面显示 * 生命周期函数--监听页面显示
*/ */
onShow() { onShow() {},
// 获取详情
this.rightsInfo();
},
/** /**
* 详情 * 详情
@@ -107,25 +109,10 @@ Page({
this.setData({ this.setData({
uniUrl : encodeURIComponent(res.data) uniUrl : encodeURIComponent(res.data)
}) })
}) }).catch(err => {});
} }
} }
}).catch(err=>{ }).catch(err=>{})
if(!err.login){
wx.showModal({
title : '用户登录已过期',
content : '请重新登录',
showCancel : false,
success : res => {
if (res.confirm) {
wx.redirectTo({
url: '/pages/login/login'
})
}
}
})
}
})
}, },
/** /**
@@ -275,9 +262,10 @@ Page({
let right_id = this.data.detail.right_id, let right_id = this.data.detail.right_id,
address_id = this.data.address.id, address_id = this.data.address.id,
is_deliver = this.data.isdeliver, is_deliver = this.data.isdeliver,
qty = this.data.num qty = this.data.num,
parent_id = this.data.parentId
wx.$api.index.rightStore(right_id, address_id, is_deliver, qty).then(res=>{ wx.$api.index.rightStore(right_id, address_id, is_deliver, qty, parent_id).then(res=>{
if(res.data.canPay == false) { if(res.data.canPay == false) {
wx.showToast({ wx.showToast({
title : '支付成功', title : '支付成功',
@@ -299,66 +287,12 @@ Page({
rightsTap: true rightsTap: true
}) })
}else { }else {
// payWayIndex为0的时候为微信支付 // 跳转收银台
if(this.data.payWayIndex == 0) { wx.navigateTo({
wx.$api.index.wechat(res.data.trade_no).then(res=>{ url: "/pages/cashier/cashier?trade_no=" + res.data.trade_no + "&amount=" + this.data.amount + "&is_deliver=" + is_deliver + "&pay_type=rightsPay"
let payInfo = JSON.parse(res.data)
wx.requestPayment({
timeStamp: payInfo.timeStamp,
nonceStr : payInfo.nonceStr,
package : payInfo.package,
paySign : payInfo.paySign,
signType : payInfo.signType,
success : res=>{
if(res.errMsg == "requestPayment:ok"){
wx.showToast({
title: '支付成功',
icon : 'success'
})
setTimeout(()=>{
if(this.data.isdeliver == 1) {
wx.reLaunch({
url: '/pages/order/order?orderType=rightsCoupons'
})
} else {
wx.reLaunch({
url: '/pages/order/order?orderType=rights'
}) })
} }
// wx.reLaunch({ }).catch(err => {});
// url: '/pages/coupon/coupon?type=couponPublic'
// })
},3000)
}
},
fail : res=>{
if(this.data.isdeliver == 1) {
wx.reLaunch({
url: '/pages/order/order?orderType=rightsCoupons&stateType=unpay'
})
} else {
wx.reLaunch({
url: '/pages/order/order?orderType=rights&stateType=unpay'
})
}
// wx.reLaunch({
// url: '/pages/order/order?stateType=unpay'
// })
}
})
})
}
// payWayIndex为1的时候为沃钱包支付
if(this.data.payWayIndex == 1) {
const newUrl = "https://lifetest.ysd-bs.com/unicom/payment?trade_no=" + res.data.trade_no
let url= encodeURIComponent(newUrl)
wx.redirectTo({
// 跳转到webview页面
url: `/pages/webView/webView?url=${url}`
});
}
}
})
}, },

View File

@@ -9,7 +9,11 @@
<text wx:else bindtap="unionOrder">立即购买</text> <text wx:else bindtap="unionOrder">立即购买</text>
</view> </view>
</block> </block>
<view class="rightsBtn" bindtap="ordinary" wx:else> <view class="newrightsBtn" bindtap="ordinary" wx:else>
<view class="rightsBtn-text">
<view class="rightsBtn-text-num">共:{{num}}件商品 </view>
<view>实付:<text>¥{{amount}}</text></view>
</view>
<button disabled="{{disabled}}">立即购买</button> <button disabled="{{disabled}}">立即购买</button>
</view> </view>
@@ -35,12 +39,9 @@
<view style="padding-bottom: 220px"> <view style="padding-bottom: 220px">
<view class="cont"> <view class="cont">
<view class="contBack"> <view class="contBack">
<image class="classBack" src="/static/img/class_back_01.png" mode="scaleToFill"></image> <image class="classBack" src="https://lifetest.ysd-bs.com/storage/materials/2021/08/09/class_back_02.png" mode="scaleToFill"></image>
<view class="classCircle"></view> <view class="classCircle"></view>
<view class="rightsCont"> <view class="rightsCont">
<view class="rightsCont-tips">
{{detail.four_title}}
</view>
<scroll-view scroll-x class="welfareCont-top" scroll-with-animation> <scroll-view scroll-x class="welfareCont-top" scroll-with-animation>
<view class="welfareCont-list-img" wx:for="{{detail.logos}}" wx:key="logos"> <view class="welfareCont-list-img" wx:for="{{detail.logos}}" wx:key="logos">
<image src="{{item}}" mode="aspectFill"></image> <image src="{{item}}" mode="aspectFill"></image>
@@ -54,21 +55,41 @@
</view> </view>
<view class="rightsNumber"> <view class="rightsNumber">
<text>数量</text> <image class="rightsGoods-img" src="{{detail.cover}}" mode="aspectFill"></image>
<view class="rightsGoods">
<view class="nowrap rightsGoods-text">
{{detail.title}}
</view>
<view class="rightsGoods-price">
<view class="rightsGoods-number"><text>¥</text>{{detail.price}}</view>
<view class="rightsAdd"> <view class="rightsAdd">
<view class="rightsAdd-btn" bindtap="goodsNumber" data-type="remove">-</view> <view class="rightsAdd-btn rightsAdd-remove {{num != 1 ? 'active' : ''}}" bindtap="goodsNumber" data-type="remove">-</view>
<input class="rightsAdd-input" data-num="{{num}}" value="{{num}}" type="number" maxlength='4' <input class="rightsAdd-input" data-num="{{num}}" value="{{num}}" type="number" maxlength='4'
bindblur="goodsNumberInput"></input> bindblur="goodsNumberInput"></input>
<view class="rightsAdd-btn" bindtap="goodsNumber" data-type="plus">+</view> <view class="rightsAdd-btn rightsAdd-plus" bindtap="goodsNumber" data-type="plus">+</view>
</view>
</view>
</view> </view>
</view> </view>
<!-- 规格 --> <!-- 抵扣 -->
<view class="rightsList" style="margin-top:50rpx"> <view class="rightsList" style="padding: 0 0 2rpx">
<view class="rightsLabel"> <view class="rightsLabel">
<view class="rightsLabel-left">{{detail.attribute.form_type}}</view>
<view class="rightsLabel-right rightsLabel-red">-¥{{score}}</view>
</view>
<!-- <view class="rightsLabel uni-border-top">
<view class="rightsLabel-left">{{detail.attribute.form_pay}}</view>
<view class="rightsLabel-right rightsLabel-score">¥{{amount}}</view>
</view> -->
</view>
<!-- 规格 -->
<view class="rightsList" wx:if="{{detail.type == 'physical'}}">
<!-- <view class="rightsLabel">
<view class="rightsLabel-left">{{detail.attribute.form_price}}</view> <view class="rightsLabel-left">{{detail.attribute.form_price}}</view>
<view class="rightsLabel-right">¥{{moreAmount}}</view> <view class="rightsLabel-right">¥{{moreAmount}}</view>
</view> </view> -->
<view class="rightsLabel" wx:if="{{platIndex == 1}}"> <view class="rightsLabel" wx:if="{{platIndex == 1}}">
<view class="rightsLabel-left">电子券</view> <view class="rightsLabel-left">电子券</view>
<view class="rightsLabel-right">{{detail.qty}}张</view> <view class="rightsLabel-right">{{detail.qty}}张</view>
@@ -87,7 +108,7 @@
</view> --> </view> -->
<block wx:if="{{detail.type == 'physical'}}"> <block wx:if="{{detail.type == 'physical'}}">
<view class="rightsLabel"> <view class="rightsLabel">
<view class="rightsLabel-left">请选择提交方式</view> <view class="rightsLabel-left">提交方式</view>
<view class="rightsLabel-right rightsLabel-range"> <view class="rightsLabel-right rightsLabel-range">
<picker range="{{platformCp}}" range-key="name" bindchange="platBind"> <picker range="{{platformCp}}" range-key="name" bindchange="platBind">
<view class="tabs-text"> <view class="tabs-text">
@@ -98,10 +119,13 @@
</view> </view>
</view> </view>
<view class="rightsLabel rightsLabel-address" wx:if="{{platformCp[platIndex].name == '快递'}}"> <view class="rightsLabel rightsLabel-address" wx:if="{{platformCp[platIndex].name == '快递'}}">
<view class="rightsLabel-left">收货地址</view> <image class="rightsLabel-icon" src="/static/img/new_rightsAddress.png"></image>
<block wx:if="{{address != ''}}"> <block wx:if="{{address != ''}}">
<view class="rightsLabel-right" bindtap="addressTap"> <view class="rightsLabel-right" bindtap="addressTap">
<view class="rightsLabel-address-text">
<view class="rightsLabel-address-name">{{address.name}}<view class="rightsLabel-address-tel">{{address.mobile}}</view></view>
<text class="nowrap">{{address.all_address}}</text> <text class="nowrap">{{address.all_address}}</text>
</view>
<image class="rightsLabel-row" src="/static/icon/rightsArrow.png"></image> <image class="rightsLabel-row" src="/static/icon/rightsArrow.png"></image>
</view> </view>
</block> </block>
@@ -114,24 +138,13 @@
</view> </view>
<view class="rightsLabel" wx:if="{{platformCp[platIndex].name == '快递'}}"> <view class="rightsLabel" wx:if="{{platformCp[platIndex].name == '快递'}}">
<view class="rightsLabel-left">快递运费</view> <view class="rightsLabel-left">快递运费</view>
<view class="rightsLabel-right">¥{{freight}}</view> <view class="rightsLabel-right rightsLabel-freight">¥{{freight}}</view>
</view> </view>
</block> </block>
</view> </view>
<view class="rightsList" style="padding: 0 0 2rpx">
<view class="rightsLabel">
<view class="rightsLabel-left">{{detail.attribute.form_type}}</view>
<view class="rightsLabel-right rightsLabel-red">¥{{score}}</view>
</view>
<view class="rightsLabel uni-border-top">
<view class="rightsLabel-left">{{detail.attribute.form_pay}}</view>
<view class="rightsLabel-right rightsLabel-score">¥{{amount}}</view>
</view>
</view>
<!-- 支付方式 --> <!-- 支付方式 -->
<view class="rightsList"> <!-- <view class="rightsList">
<view class="rightsLabel"> <view class="rightsLabel">
<view class="rightsLabel-left">请选择支付方式</view> <view class="rightsLabel-left">请选择支付方式</view>
<view class="rightsLabel-right rightsLabel-range"> <view class="rightsLabel-right rightsLabel-range">
@@ -147,7 +160,7 @@
<view class="rightsLabel-left">支付方式</view> <view class="rightsLabel-left">支付方式</view>
<view class="rightsLabel-right">{{payWay[payWayIndex].name}}</view> <view class="rightsLabel-right">{{payWay[payWayIndex].name}}</view>
</view> </view>
</view> </view> -->
<!-- 自提商家 --> <!-- 自提商家 -->
<!-- <view class="detailsStore" wx:if="{{platIndex == 0}}"> <!-- <view class="detailsStore" wx:if="{{platIndex == 0}}">

View File

@@ -1,5 +1,5 @@
page { page {
background-color: #f7f7f7; background-color: #eeeeee;
} }
.cont { .cont {
@@ -12,7 +12,7 @@ page {
.contBack { .contBack {
position: relative; position: relative;
width: 200%; width: 200%;
height: 400rpx; height: 340rpx;
left: -50%; left: -50%;
text-align: center; text-align: center;
background: #000000; background: #000000;
@@ -33,9 +33,9 @@ page {
.classBack { .classBack {
position: absolute; position: absolute;
left: 30%; left: 28%;
right: 30%; right: 30%;
width: 40%; width: 44%;
top: 40rpx; top: 40rpx;
} }
@@ -69,18 +69,19 @@ page {
.rightsCont { .rightsCont {
position: absolute; position: absolute;
z-index: 3; z-index: 3;
left: calc(30% - 2rpx); left: calc(28% - 2rpx);
right: calc(30% - 2rpx); right: calc(30% - 2rpx);
width: calc(40% + 4rpx); width: calc(44% + 4rpx);
top: 58rpx; top: 50rpx;
} }
.rightsCont-btn { .rightsCont-btn {
background-color: #f4dfcc; background: rgba(255, 255, 0255, .4);
width: 100%; width: 100%;
line-height: 70rpx; line-height: 70rpx;
font-size: 38rpx; font-size: 40rpx;
color: #694425; font-weight: 600;
color: #000000;
padding: 0 20rpx; padding: 0 20rpx;
box-sizing: border-box; box-sizing: border-box;
} }
@@ -90,16 +91,43 @@ page {
} }
.rightsNumber { .rightsNumber {
display: flex; background-color: #ffffff;
width: 100%; position: relative;
margin: 30px 0 20px; padding: 30rpx 40rpx;
padding: 0 30rpx;
box-sizing: border-box; box-sizing: border-box;
} }
.rightsNumber text { .rightsGoods-img {
display: inline-block; width: 200rpx;
height: 200rpx;
border-radius: 10rpx;
}
.rightsGoods {
position: absolute;
left: 0;
top: 0;
width: 100%;
padding: 80rpx 40rpx 0 270rpx;
box-sizing: border-box;
}
.rightsGoods-text {
margin-bottom: 40rpx;
font-weight: 600;
}
.rightsGoods-price {
display: flex;
}
.rightsGoods-number {
flex: 1; flex: 1;
font-size: 34rpx;
}
.rightsGoods-number>text {
font-size: 28rpx;
} }
.rightsAdd { .rightsAdd {
@@ -107,9 +135,7 @@ page {
} }
.rightsAdd-btn { .rightsAdd-btn {
background: #eaeaea; border-radius: 4rpx;
color: #535353;
border-radius: 50%;
text-align: center; text-align: center;
width: 50rpx; width: 50rpx;
height: 50rpx; height: 50rpx;
@@ -118,6 +144,17 @@ page {
font-weight: 600; font-weight: 600;
} }
.rightsAdd-remove {
background: #f8f8f8;
color: #d9d9d9;
}
.rightsAdd-remove.active,
.rightsAdd-plus {
background: #e8e4e5;
color: #6b6768;
}
.rightsAdd-input { .rightsAdd-input {
width: 100rpx; width: 100rpx;
text-align: center; text-align: center;
@@ -136,18 +173,18 @@ page {
.notice, .notice,
.detailsStore { .detailsStore {
background: white; background: white;
margin: 30rpx;
border-radius: 10rpx; border-radius: 10rpx;
padding: 10rpx 0; padding: 10rpx 0;
margin-top: 20rpx;
box-sizing: border-box; box-sizing: border-box;
box-shadow: 0 0 30rpx rgba(0,0,0,.15);
} }
.rightsLabel, .rightsLabel,
.rightsLabel-pay { .rightsLabel-pay {
display: flex; display: flex;
padding: 20rpx; padding: 20rpx 40rpx;
color: #6f7880; color: #6c6c6c;
font-weight: 600;
font-size: 30rpx; font-size: 30rpx;
} }
@@ -156,6 +193,37 @@ page {
color: #747d86; color: #747d86;
} }
.rightsLabel .rightsLabel-icon {
width: 70rpx;
height: 70rpx;
margin-top: 14rpx;
}
.rightsLabel-address .rightsLabel-right {
width: calc(100% - 90rpx);
margin-left: 20rpx;
color: #000000;
}
.rightsLabel-address .rightsLabel-row {
margin-top: 30rpx;
}
.rightsLabel-address-name {
display: flex;
font-size: 32rpx;
margin-bottom: 10rpx;
}
.rightsLabel-address-tel {
padding-left: 30rpx;
color: #959595;
}
.rightsLabel-freight {
color: #000000;
}
.rightsLabel-black { .rightsLabel-black {
padding-top: 30rpx; padding-top: 30rpx;
} }
@@ -167,9 +235,9 @@ page {
} }
.rightsLabel-row { .rightsLabel-row {
width: 38rpx; width: 42rpx;
height: 38rpx; height: 42rpx;
margin: 2rpx 0 0 6rpx; margin: 0 0 0 6rpx;
} }
.rightsLabel-black .rightsLabel-right, .rightsLabel-black .rightsLabel-right,
@@ -198,7 +266,7 @@ page {
} }
.notice { .notice {
padding: 20rpx; padding: 20rpx 30rpx;
} }
.noticeTitle { .noticeTitle {
@@ -279,14 +347,18 @@ page {
} }
/* 购买按钮 */ /* 购买按钮 */
.rightsBtn { .rightsBtn,
.newrightsBtn {
position: fixed; position: fixed;
bottom: 0; bottom: 0;
left: 0; left: 0;
width: 100%; width: 100%;
height: 100rpx; height: 160rpx;
z-index: 9; z-index: 9;
background: #fff; background: #fff;
padding: 30rpx;
box-sizing: border-box;
display: flex;
} }
.rightsBtn button, .rightsBtn button,
@@ -303,6 +375,33 @@ page {
font-size: 30rpx; font-size: 30rpx;
} }
.rightsBtn-text {
flex: 1;
font-weight: 600;
font-size: 30rpx;
}
.rightsBtn-text-num {
font-size: 30rpx;
margin-bottom: 10rpx;
}
.rightsBtn-text text {
font-size: 38rpx;
color: #fe2d55;
}
.newrightsBtn button {
width: 280rpx !important;
background-color: #000000;
color: #ffffff;
border-radius: 80rpx;
height: 100rpx;
line-height: 100rpx;
padding: 0;
margin: 0;
}
.rightsBtn.active text { .rightsBtn.active text {
background: #dedede; background: #dedede;
@@ -391,6 +490,27 @@ page {
.rightsLabel-address { .rightsLabel-address {
display: flex; display: flex;
position: relative;
margin: 10rpx 0;
padding: 25rpx 40rpx;
}
.rightsLabel-address::after,
.rightsLabel-address::before {
position: absolute;
content: '';
left: 30rpx;
width: calc(100% - 60rpx);
height: 2rpx;
background-color: #bfbfbf;
}
.rightsLabel-address::after {
top: 0;
}
.rightsLabel-address::before {
bottom: 0;
} }
.rightsLabel-address text { .rightsLabel-address text {
@@ -403,6 +523,10 @@ page {
font-size: 28rpx; font-size: 28rpx;
} }
.rightsLabel-address-text {
flex: 1;
}
.address-tool { .address-tool {
display: flex; display: flex;
float: right; float: right;
@@ -445,8 +569,8 @@ page {
.rightsPoint { .rightsPoint {
position: fixed; position: fixed;
left: 0; left: 0;
bottom: 100rpx; bottom: 160rpx;
background: #fff; background: #eeeeee;
z-index: 9; z-index: 9;
width: 100%; width: 100%;
padding: 20rpx 20rpx 10rpx; padding: 20rpx 20rpx 10rpx;
@@ -455,8 +579,7 @@ page {
.rightsPoint-cont { .rightsPoint-cont {
width: 100%; width: 100%;
background: #fff8e5; background: #eeeeee;
border: 2rpx solid #f2ecde;
border-radius: 10rpx; border-radius: 10rpx;
position: relative; position: relative;
max-height: 50vh; max-height: 50vh;
@@ -466,7 +589,7 @@ page {
.rightsPoint-top { .rightsPoint-top {
font-size: 28rpx; font-size: 28rpx;
display: flex; display: flex;
padding: 20rpx; padding: 0 20rpx 20rpx;
box-sizing: border-box; box-sizing: border-box;
font-weight: 600; font-weight: 600;
} }
@@ -518,7 +641,7 @@ page {
.pointMore { .pointMore {
text-align: center; text-align: center;
width: 100%; width: 100%;
background: #fff8e5; background: #eeeeee;
height: 80rpx; height: 80rpx;
line-height: 82rpx; line-height: 82rpx;
position: relative; position: relative;

View File

@@ -106,7 +106,6 @@ Page({
cityList = this.data.cityList, cityList = this.data.cityList,
areas = this.data.areas, areas = this.data.areas,
regiList = this.data.regiList regiList = this.data.regiList
if(!addressInfo){ if(!addressInfo){
province_id = areas[areaIndex].code province_id = areas[areaIndex].code
city_id = cityList[cityIndex].code city_id = cityList[cityIndex].code
@@ -149,7 +148,7 @@ Page({
lodingStats : false lodingStats : false
}) })
wx.stopPullDownRefresh() wx.stopPullDownRefresh()
}) }).catch(err => {});
}, },
/** /**
@@ -166,7 +165,7 @@ Page({
regiList : regiList, regiList : regiList,
regiIndex : regiIndex regiIndex : regiIndex
}) })
}) }).catch(err => {});
}, },
/** /**

View File

@@ -29,7 +29,7 @@ Page({
storeinfo : res.data, storeinfo : res.data,
distance : distance distance : distance
}) })
}) }).catch(err => {});
}, },
/** /**

View File

@@ -3,7 +3,15 @@
<view class="userHead"> <view class="userHead">
<view class="userHead-img"> <view class="userHead-img">
<image src="{{infos.avatar}}" mode="aspectFill"></image> <image src="{{infos.avatar}}" mode="aspectFill"></image>
<view class="userHead-tips {{infos.identity.identity_id == 0 ? '' : 'active'}}">{{infos.identity.name}}</view> <view class="userHead-tips default" wx:if="{{infos.identity.identity_id == 0}}">
{{infos.identity.name}}
</view>
<view class="userHead-tips super" wx:elif="{{infos.identity.identity_id == 1}}">
<image src="/static/img/user_identity_00.png"></image><text>{{infos.identity.name}}</text>
</view>
<view class="userHead-tips sage" wx:else>
<image src="/static/img/user_identity_01.png"></image><text>{{infos.identity.name}}</text>
</view>
</view> </view>
<view class="userHead-text"> <view class="userHead-text">
<view class="userHead-name"> <view class="userHead-name">
@@ -36,23 +44,26 @@
<view class="userCard-cont"> <view class="userCard-cont">
<view class="userCard-clip"> <view class="userCard-clip">
<swiper class="userCard-swiper" autoplay="{{swiper.autoplay}}" interval="{{swiper.interval}}" duration="{{swiper.duration}}" current="{{currentId}}"> <swiper class="userCard-swiper" autoplay="{{swiper.autoplay}}" interval="{{swiper.interval}}" duration="{{swiper.duration}}" current="{{currentId}}">
<swiper-item class="userCard-item" bindtap="swiperNav" data-type="{{item.type}}" wx:for="{{swiper.imgUrls}}" wx:key="swiper"> <!-- <swiper-item class="userCard-item" bindtap="swiperNav" data-type="{{item.type}}" wx:for="{{swiper.imgUrls}}" wx:key="swiper">
<image class="userCard-img" src="{{item.src}}" mode="scaleToFill" bindtap="bannerTap" data-id="{{item.id}}"></image> <image class="userCard-img" src="{{item.src}}" mode="scaleToFill" bindtap="bannerTap" data-id="{{item.id}}"></image>
<view class="userCard-parice" style="color:{{item.color}}" wx:if="{{isUser}}"><text>可用余额:</text> <view class="userCard-parice" style="color:{{item.color}}" wx:if="{{isUser}}"><text>可用余额:</text>
<block wx:if="{{item.id == 0}}">{{account.silver}}</block> <block wx:if="{{item.id == 0}}">{{account.silver}}</block>
<block wx:if="{{item.id == 1}}">{{account.gold}}</block> <block wx:if="{{item.id == 1}}">{{account.gold}}</block>
<block wx:if="{{item.id == 2}}">{{account.balance}}</block> <block wx:if="{{item.id == 2}}">{{account.balance}}</block>
<!-- 0.00 -->
</view> </view>
</swiper-item>
<!-- <swiper-item class="userCard-item" bindtap="userNav" data-url="">
<image class="userCard-img" src="/static/img/user_card_01.png" mode="scaleToFill" bindtap="bannerTap" data-id="{{item.goods_id}}"></image>
<view class="userCard-parice" style="color: #f79210" wx:if="{{isUser}}"><text>余额:</text>{{infos.account.gold}}</view>
</swiper-item>
<swiper-item class="userCard-item" bindtap="userNav" data-url="">
<image class="userCard-img" src="/static/img/user_card_02.png" mode="scaleToFill" bindtap="bannerTap" data-id="{{item.goods_id}}"></image>
<view class="userCard-parice" style="color: #192b4c" wx:if="{{isUser}}"><text>余额:</text>{{infos.account.drill}}</view>
</swiper-item> --> </swiper-item> -->
<swiper-item class="userCard-item" bindtap="swiperNav" data-type="silver">
<image class="userCard-img" src="/static/img/user_card_00.png" mode="scaleToFill" bindtap="bannerTap" data-id="0"></image>
<view class="userCard-parice" style="color: #676869" wx:if="{{isUser}}"><text>可用余额:</text>{{account.silver}}</view>
</swiper-item>
<swiper-item class="userCard-item" bindtap="swiperNav" data-type="drill">
<image class="userCard-img" src="/static/img/user_card_02.png" mode="scaleToFill" bindtap="bannerTap" data-id="1"></image>
<view class="userCard-parice" style="color: #192b4c" wx:if="{{isUser}}"><text>可用余额:</text>{{account.drill}}</view>
</swiper-item>
<swiper-item class="userCard-item" bindtap="swiperNav" data-type="balance" wx:if="{{infos.identity.identity_id != 0}}">
<image class="userCard-img" src="/static/img/user_card_01.png" mode="scaleToFill" bindtap="bannerTap" data-id="2"></image>
<view class="userCard-parice" style="color: #ff8f00" wx:if="{{isUser}}"><text>可用余额:</text>{{account.balance}}</view>
</swiper-item>
</swiper> </swiper>
</view> </view>
<image src="/static/icon/arrow_left.png" class='userCard-arrow-left' bindtap='nextImg'></image> <image src="/static/icon/arrow_left.png" class='userCard-arrow-left' bindtap='nextImg'></image>
@@ -171,26 +182,26 @@
</view> </view>
<!-- 我的工具 --> <!-- 我的工具 -->
<view class="userCard"> <view class="userCard" wx:if="{{isUser}}">
<view class="userCard-title">我的工具</view> <view class="userCard-title">我的工具</view>
<view class="userOrder"> <view class="userOrder">
<view class="userOrder-label" bindtap="userNav" data-url="/pages/code/code"> <view class="userOrder-label" bindtap="userNav" data-url="/pages/userStored/userStored" wx:if="{{infos.identity.identity_id != 0}}">
<view class="userOrder-icon active"> <view class="userOrder-icon active">
<image src="/static/img/userOrder_07.png"></image> <image src="/static/img/userOrder_07.png"></image>
</view> </view>
<text>我的邀请码</text> <text>储值分享</text>
</view> </view>
<view class="userOrder-label" bindtap="userNav" data-url="/pages/recommend/recommend"> <view class="userOrder-label" bindtap="userNav" data-url="/pages/userGoods/userGoods" wx:if="{{infos.identity.identity_id != 0}}">
<view class="userOrder-icon active"> <view class="userOrder-icon active">
<image src="/static/img/userOrder_08.png"></image> <image src="/static/img/userOrder_08.png"></image>
</view> </view>
<text>我的推荐</text> <text>产品分享</text>
</view> </view>
<view class="userOrder-label" bindtap="userNav" data-url="/pages/favour/favour"> <view class="userOrder-label" bindtap="userNav" data-url="/pages/favour/favour">
<view class="userOrder-icon active"> <view class="userOrder-icon active">
<image src="/static/img/userOrder_09.png"></image> <image src="/static/img/userOrder_09.png"></image>
</view> </view>
<text>积分赠与</text> <text>红包赠予</text>
</view> </view>
<view class="userOrder-label" bindtap="userNav" data-url="/pages/password_set/password_set"> <view class="userOrder-label" bindtap="userNav" data-url="/pages/password_set/password_set">
<view class="userOrder-icon active"> <view class="userOrder-icon active">

View File

@@ -7,18 +7,18 @@
} }
.userHead-img { .userHead-img {
width: 135rpx; width: 140rpx;
height: 135rpx; height: 140rpx;
border-radius: 50%; border-radius: 50%;
position: relative; position: relative;
} }
.userHead-img image { .userHead-img>image {
position: absolute; position: absolute;
left: 22rpx; left: 10rpx;
top: 0; top: 0;
width: 110rpx; width: 120rpx;
height: 110rpx; height: 120rpx;
border-radius: 50%; border-radius: 50%;
} }
@@ -27,27 +27,53 @@
height: 120rpx; height: 120rpx;
} }
.userHead-img view { .userHead-img .userHead-tips {
display: inline-block;
position: absolute; position: absolute;
bottom: 0; width: 140rpx;
left: 10rpx;
background: #c6c6c6;
border-radius: 30rpx;
color: #fff;
font-size: 24rpx;
padding: 4rpx 0;
text-align: center; text-align: center;
width: 130rpx; bottom: 0;
left: 0;
background: #c6c6c6;
color: #fff;
border-radius: 30rpx;
height: 42rpx;
line-height: 40rpx;
display: inline-block; display: inline-block;
z-index: 99; z-index: 99;
} }
.userHead-img view.active {
width: 120rpx; .userHead-img .userHead-tips.super,
left: 18rpx; .userHead-img .userHead-tips.sage {
background: #000; background: #000;
color: #fff; }
.userHead-img .userHead-tips.default {
font-size: 24rpx;
text-align: center;
}
.userHead-img text {
font-size: 22rpx;
color: transparent;
font-weight: 700;
}
.userHead-img view.super text {
background-image: linear-gradient(135deg,#bcbcbc,#f1f1f1, #bcbcbc);
-webkit-background-clip:text;
}
.userHead-img view.sage text {
background-image: linear-gradient(135deg,#d4ac02,#fffa9a, #e0b500);
-webkit-background-clip:text;
}
.userHead-tips image {
width: 24rpx;
height: 24rpx;
margin-right: 5rpx;
vertical-align: -2rpx;
} }
.userHead-text { .userHead-text {
@@ -74,7 +100,7 @@
.userHead-name { .userHead-name {
margin: 10rpx 0 20rpx; margin: 10rpx 0 20rpx;
font-size: 32rpx; font-size: 36rpx;
font-weight: 600; font-weight: 600;
} }
@@ -89,7 +115,7 @@
} }
.userHead-tel { .userHead-tel {
font-size: 28rpx; font-size: 32rpx;
} }
/* 轮播图 */ /* 轮播图 */

View File

@@ -0,0 +1,221 @@
// pages/userGoods/goodsCode/goodsCode.js
Page({
/**
* 页面的初始数据
*/
data: {
qrcode : '', //二维码
Picture : 'https://lifetest.ysd-bs.com/storage/materials/2021/08/06/shareImg.jpg', //海报图片
rightId : '', //产品id
userInfo : '', //我的信息
isImgLay : false, //是否显示图片弹出层
parentId : '', //是否分享进入
shareState : false, //显示分享朋友圈弹出层
pageDown : '', //下载海报和展示海报
pageShare : '', //分享好友朋友圈海报
profitText : '', //奖励文字
},
/**
* 生命周期函数--监听页面加载
*/
onLoad (options) {
this.setData({
rightId: options.rightid,
parentId: options.parent_id
})
// 判断是否由分享进入
// if(options.type == "share"){}
// 获取二维码
wx.$api.user.publicCode('mini', 'goods', 'pages/userGoods/goodsDet/goodsDet?rightid=' + options.rightid + '&type=share').then(res=>{
this.setData({
qrcode : res.data.qrcode,
userInfo : res.data.user
})
}).catch(err=>{
if(!err.login){
// 写入缓存
wx.setStorage({
key : 'token',
data : ''
})
}
})
// 获取分享海报图
this.posterShow();
},
/**
* 分享海报图
*/
posterShow(){
wx.$api.user.productPoster(this.data.rightId).then(res=>{
this.setData({
pageDown : res.data.cover,
pageShare : res.data.wechat_cover,
profitText: res.data.profit_text
})
}).catch(err=>{
if(!err.login){
// 写入缓存
wx.setStorage({
key : 'token',
data : ''
})
}
})
},
/**
* 预览图片
*/
bigPicture(e) {
wx.previewImage({
current : e.currentTarget.dataset.src,
urls : [e.currentTarget.dataset.src]
})
},
/**
* 分享朋友圈弹出层状态
*/
shareShow() {
this.setData({
shareState: !this.data.shareState
})
},
/**
* 绘图
*/
dowImg(){
wx.showLoading({
title: '加载中',
})
let downImg = new Promise(success=>{
wx.getImageInfo({
src : this.data.pageDown,
success : res => {
success(res.path)
}
})
})
// 下载素材
let codeImg = new Promise(success => {
wx.getImageInfo({
src : this.data.qrcode,
success : res => {
success(res.path)
}
})
})
Promise.all([codeImg, downImg]).then(res => {
// 绘制海报
const ctx = wx.createCanvasContext('qrcodeCard')
ctx.save()
// 绘制背景
ctx.drawImage(res[1], 0, 0, 375, 650)
// 绘制白色背景
ctx.drawImage('/static/img/goodsCode_white.png', 30, 460, 120, 120)
// 绘制二维码
ctx.drawImage(res[0], 40, 470, 100, 100)
ctx.save();
ctx.beginPath(); //开始绘制
ctx.arc(70 / 2 + 156, 70 / 2 + 250, 70 / 2, 0, Math.PI * 2, false);
ctx.clip();
// 保存图片
ctx.draw(true, () => {
wx.hideLoading()
wx.canvasToTempFilePath({
canvasId: 'qrcodeCard',
x: 0,
y: 0,
success: res => {
wx.saveImageToPhotosAlbum({
filePath: res.tempFilePath,
success : res=>{
wx.showToast({
title: '分享海报已保存至相册',
icon : 'none'
})
},
fail : err=>{
wx.showModal({
title : '提示',
content : '暂未授权小程序写入您的相册,无法存储二维码海报',
confirmColor: '#d82526',
confirmText : '去设置',
success : info=>{
if (info.confirm){
wx.openSetting()
}
}
})
},
complete: e => {}
})
}
})
})
}).catch(err=>{
wx.showToast({
title: '海报下载,请检查网络',
icon : 'none'
})
})
},
/**
* 图片弹出层
*/
removeSaveImg(){
this.setData({
isImgLay: !this.data.isImgLay
})
},
/**
* 保存图片到本地
*/
saveImg(){
this.dowImg();
this.setData({
isImgLay: !this.data.isImgLay
})
},
/**
* 分享
*/
onShareAppMessage(){
return {
title : this.data.userInfo.nickname + "邀请您进入本时生活",
imageUrl: this.data.pageShare,
path : "/pages/userGoods/goodsDet/goodsDet?parent_id=" + this.data.userInfo.user_id + "&rightid=" + this.data.rightId + "&type=share",
}
},
/**
* 用户点击右上角分享朋友圈
*/
onShareTimeline: function () {
return {
title : this.data.userInfo.nickname + "邀请您进入本时生活",
path : "/pages/userGoods/goodsDet/goodsDet?parent_id=" + this.data.userInfo.user_id + "&rightid=" + this.data.rightId + "&type=share",
imageUrl: this.data.pageShare
}
}
})

View File

@@ -0,0 +1,3 @@
{
"usingComponents": {}
}

View File

@@ -0,0 +1,69 @@
<view class="codeTitle">
<image src="/static/img/userGoods_title.png" mode="widthFix"></image>
</view>
<!-- 分享弹出 -->
<view class="goodsBack"></view>
<view class="goodsPop">
<view class="goodsTab">
<navigator hover-class="none" url="/pages/userGoods/goodsDet/goodsDet" class="goodsTab-label">产品海报</navigator>
<!-- <view class="goodsTab-label">产品海报</view> -->
<!-- <view class="goodsTab-label active">产品图片</view> -->
</view>
<view class="goodsTitle">
<image src="/static/img/shareTitle.png" mode="aspectFill"></image>{{profitText}}
</view>
<view class="goodsPoster">
<image bindtap="bigPicture" data-src="{{pageDown}}" src="{{pageDown}}" mode="widthFix"></image>
</view>
<view class="goodsScroll-text">29.9元享39元【清雅水境养生沐浴】门票一张静心浴享保健。尊享洗浴尽在清雅水境</view>
<view class="goodsTool">
<button class="codeShare-label codeShare-button" open-type="share" hover-class="none">
<image src="/static/img/code_icon_00.png"></image>
微信好友
</button>
<view class="codeShare-label" bindtap="shareShow">
<image src="/static/img/code_icon_01.png"></image>
朋友圈
</view>
<view class="codeShare-label" bindtap="removeSaveImg" hover-class="none">
<image src="/static/img/code_icon_02.png"></image>
生成海报
</view>
</view>
</view>
<!-- 朋友圈提示弹出 -->
<view class="sharePop" wx:if="{{shareState}}" bindtap="shareShow">
<image class="sharePop-row" src="/static/img/code_share_01.png" mode="widthFix"></image>
<view class="shareList">
<view class="shareLabel">
<text>1</text>
点击右上角<image src="/static/img/code_share_00.png" mode="aspectFill"></image>打开菜单
</view>
<view class="shareLabel">
<text>2</text>
选择菜单<image src="/static/img/code_share_02.png" mode="aspectFill"></image>分享朋友圈
</view>
</view>
</view>
<!-- 海报canvas -->
<canvas class="canvasImg" canvas-id="qrcodeCard"></canvas>
<!-- 图片弹出层 -->
<view class="user-lay sign-img-lay" wx:if="{{isImgLay}}">
<view class="user-back">
<image class="user-back-img" src="{{pageDown}}" mode="widthFix"></image>
<view class="user-back-cont">
<image src="{{qrcode}}" mode="aspectFill"></image>
<!-- <view class="codeBack-yard-name">
扫码进入
</view> -->
</view>
</view>
<button class="sign-img-btn" size="mini" bindtap="saveImg">保存到相册</button>
<button class="sign-img-btn remove-btn" size="mini" bindtap="removeSaveImg">取消</button>
</view>

View File

@@ -0,0 +1,278 @@
.codeTitle {
width: 100%;
background-color: #222222;
border-radius: 0 0 300rpx 300rpx;
box-sizing: border-box;
padding: 30rpx 20rpx 0;
}
.codeTitle image {
text-align: center;
width: 100%;
border-radius: 20rpx;
display: block;
}
.goodsBack {
position: fixed;
width: 100%;
height: 100%;
left: 0;
top: 0;
background: rgba(0, 0, 0, .5);
}
.goodsPop {
height: 84vh;
width: 100%;
background-color: #ffffff;
border-radius: 50rpx 50rpx 0 0;
left: 0;
bottom: 0;
position: fixed;
}
.goodsTab {
display: flex;
}
.goodsTab-label {
background-color: #dadada;
flex: 2;
text-align: center;
width: 50%;
line-height: 90rpx;
border-radius: 40rpx 40rpx 0 0;
/* border-radius: 0 40rpx 0 30rpx; */
}
.goodsTab-label.active {
background-color: #ffffff;
border-radius: 40rpx 30rpx 0 0;
margin-top: -20rpx;
font-weight: 600;
}
.goodsTitle {
background-color: #1f1f1f;
color: #eed4ae;
border-radius: 25rpx;
height: 90rpx;
line-height: 90rpx;
padding: 0 30rpx;
box-sizing: border-box;
display: flex;
margin: 30rpx;
position: relative;
}
.goodsTitle image {
width: 46rpx;
height: 46rpx;
margin: 22rpx 20rpx 0 0;
}
.goodsTitle::after {
position: absolute;
bottom: -10rpx;
left: calc(50% - 20rpx);
content: '';
width: 0;
height: 0;
border-left: 20rpx solid transparent;
border-right: 20rpx solid transparent;
border-top: 16rpx solid #1f1f1f;
}
.goodsPoster {
text-align: center;
width: 100%;
height: 50vh;
overflow-y: scroll;
}
.goodsPoster image {
width: 55%;
margin: 20rpx 0;
}
.goodsScroll-text {
background-color: #ffffff;
position: absolute;
bottom: 160rpx;
left: 0;
width: 100%;
padding: 20rpx 40rpx;
box-sizing: border-box;
text-align: left;
font-size: 28rpx;
}
.goodsTool {
display: flex;
position: absolute;
background-color: #ffffff;
width: 100%;
left: 0;
bottom: 0;
height: 160rpx;
}
.codeShare-label {
flex: 3;
text-align: center;
font-size: 28rpx;
margin-top: 20rpx;
padding: 0 !important;
width: 33.33%;
}
.codeShare-label image {
width: 70rpx;
height: 70rpx;
display: block;
margin: 0 auto 10rpx;
}
/* 朋友圈弹出层 */
.sharePop {
position: fixed;
left: 0;
top: 0;
width: 100%;
height: 100%;
z-index: 9;
background-color: rgba(0, 0, 0, .6);
text-align: center;
}
.sharePop-row {
width: 140rpx;
position: fixed;
right: 110rpx;
top: 0;
}
.shareList {
color: #ffffff;
line-height: 60rpx;
font-weight: 700;
font-size: 36rpx;
width: 100%;
height: 100%;
position: absolute;
z-index: 10;
top: 30%;
}
.shareLabel {
margin-bottom: 40rpx;
}
.shareLabel image {
width: 60rpx;
height: 60rpx;
margin: 0 20rpx;
vertical-align: middle;
}
.shareLabel text {
display: inline-block;
background: #0696ca;
width: 40rpx;
height: 40rpx;
line-height: 40rpx;
font-size: 26rpx;
border-radius: 50%;
margin: 8rpx 10rpx 0 0;
}
/* canvas */
.canvasImg {
position: absolute;
left: -1000%;
height: 650px;
width: 375px;
background: #e3e2e2;
}
/* 弹窗背景图 */
.user-lay {
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-box-pack: center;
position: fixed;
background: rgba(0, 0, 0, .6);
height: 100vh;
width: 100vw;
top: 0;
left: 0;
z-index: 99;
box-sizing: border-box;
}
/* 图片弹出层 */
.sign-img-lay {
text-align: center;
}
.sign-img-src {
width: 70vw;
vertical-align: top;
}
.sign-img-btn[size="mini"] {
margin-top: 40rpx;
background: #f5d48f;
font-weight: normal;
color: #2f3245;
height: 90rpx;
line-height: 90rpx;
padding: 0;
width: 80%;
}
.remove-btn[size="mini"] {
margin-top: 20rpx;
background: #101010;
color: #e5c175;
font-weight: normal;
}
/* 背景 */
.user-back-img {
width: 100%;
display: block;
}
.user-back {
position: relative;
width: 80%;
text-align: center;
margin: 0 auto;
}
.user-back-cont {
background: #ffffff;
padding: 20rpx;
border-radius: 10rpx;
box-sizing: border-box;
position: absolute;
bottom: 120rpx;
left: 40rpx;
}
.user-back-cont image {
width: 160rpx;
height: 160rpx;
}
.codeBack-yard-name {
width: 100%;
font-size: 26rpx;
text-align: center;
}

View File

@@ -0,0 +1,93 @@
// pages/userGoods/goodsDet/goodsDet.js
Page({
/**
* 页面的初始数据
*/
data: {
isUser : false, //用户登录状态
qrcode : '', //二维码
userInfo : '', //我的信息
current : 0, //产品轮播index
rightId : '', //产品id
parentId : '', //分享人id
productData : '', //详情数据
productStores : [], //门店列表
productContent : '', //图文详情
canShare : '' //分享按钮状态
},
/**
* 生命周期函数--监听页面加载
*/
onLoad (options) {
// 判断是否由分享进入
if(options.type == "share"){
this.setData({
parentId: options.parent_id
})
// 写入缓存
wx.setStorage({
key : 'parentId',
data : options.parent_id
})
this.setData({
rightId : options.rightid
})
}
this.setData({
rightId : options.rightid
})
},
onShow(){
// 获取产品详情
this.goodsShow();
this.setData({
isUser : getApp().globalData.isUser
})
},
/**
* 产品详情
*/
goodsShow(){
wx.$api.user.productInfo(this.data.rightId).then(res=>{
this.setData({
canShare : res.data.canShare,
productData : res.data.info,
productStores : res.data.stores,
productContent: res.data.info.share.content.replace(/\<img/gi, '<img style="max-width:100%;height:auto;display:block;"')
})
}).catch(err=>{
if(!err.login){
// 写入缓存
wx.setStorage({
key : 'token',
data : ''
})
}
})
},
/**
* 处理未登录时的转跳
*/
userNav(e){
let pageUrl = e.currentTarget.dataset.url
if(this.data.isUser){
wx.navigateTo({
url: pageUrl
})
}else{
// 去登录
wx.navigateTo({
url: "/pages/login/login?way=shareLogin"
})
}
}
})

View File

@@ -0,0 +1,4 @@
{
"usingComponents": {},
"navigationBarTitleText": "产品详情"
}

View File

@@ -0,0 +1,60 @@
<!-- 轮播 -->
<view class="banner">
<swiper class="swiperCont" interval="3000" autoplay circular bindchange="swiperChange">
<swiper-item wx:for="{{productData.share.pictures}}" wx:key="banner">
<image class="swiperImg" src="{{item}}" mode="aspectFill"></image>
</swiper-item>
</swiper>
<view class="swiperDot" wx:if="{{productData.share.pictures.length != 1}}">{{current}}/{{productData.share.pictures.length}}</view>
</view>
<!-- 权益介绍 -->
<view class="content">
<view class="contentText">
<view class="contentText-title">{{productData.title}}</view>
<view class="contentText-text">{{productData.share.description}}</view>
<view class="contentText-price">
<view class="contentText-price-primary"><text>¥</text>{{productData.price}}</view>
<view class="contentText-price-close">门市价¥{{productData.share.cost}}</view>
</view>
</view>
<view bindtap="userNav" data-url="/pages/rights/rights?rightsId={{productData.right_config_id}}&parentid={{parentId}}" class="contentBuy">立即购买</view>
</view>
<!-- 规格 -->
<view class="specs">
<view class="specs-label">
<text>规格</text>
{{productData.share.type_name}}
</view>
<view class="specs-label">
<text>门店</text>
<view class="specs-site">
<view class="specs-site-list" wx:for="{{productStores}}" wx:key="productStores">
<view class="specs-site-name">{{item.title}}</view>
{{item.address}}
</view>
</view>
</view>
</view>
<!-- 规格 -->
<view class="imageText">
<view class="imageText-title">
图文详情
</view>
<view class="imageText-text" wx:if="{{productContent}}">
<rich-text nodes="{{productContent}}"></rich-text>
</view>
<view class="imageText-end">
END
</view>
</view>
<!-- 漂浮窗 -->
<view class="indexFloat" wx:if="{{canShare}}">
<navigator hover-class="none" url="/pages/userGoods/goodsCode/goodsCode?rightid={{rightId}}" class="indexFloat-img">
<image src="/static/img/index_float_01.png" mode="aspectFill"></image>
</navigator>
</view>

View File

@@ -0,0 +1,203 @@
page {
background-color: #f0f0f0;
}
/* 轮播图 */
.banner {
width: 100%;
position: relative;
padding-top: 60%;
}
.swiperCont, .swiperImg {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
}
.swiperDot {
position: absolute;
background: rgba(0, 0, 0, .5);
border-radius: 80rpx;
padding: 0 25rpx;
line-height: 46rpx;
z-index: 2;
bottom: 20rpx;
right: 50rpx;
color: #ffffff;
}
/* 权益介绍 */
.content {
width: 100%;
padding: 25rpx;
box-sizing: border-box;
display: flex;
}
.contentText {
width: calc(100% - 240rpx);
margin-right: 40rpx;
}
.contentText-title {
font-weight: 600;
font-size: 36rpx;
}
.contentText-text {
font-size: 26rpx;
padding: 20rpx;
box-sizing: border-box;
color: #646464;
}
.contentText-price {
padding: 0 20rpx;
box-sizing: border-box;
display: flex;
}
.contentText-price-primary {
color: #f57400;
font-size: 48rpx;
font-weight: 600;
}
.contentText-price-primary text {
font-size: 28rpx;
}
.contentText-price-close {
font-size: 24rpx;
color: #646464;
margin: 20rpx 0 0 10rpx;
text-decoration: line-through;
}
.contentBuy {
background: linear-gradient(to left, #fe6d52, #fe8750);
border-radius: 20rpx;
width: 200rpx;
text-align: center;
height: 70rpx;
line-height: 70rpx;
color: #ffffff;
margin-top: 70rpx;
}
/* 规格 */
.specs {
background-color: #ffffff;
padding: 25rpx;
box-sizing: border-box;
margin: 0 20rpx;
border-radius: 20rpx;
}
.specs-label {
display: flex;
margin-bottom: 30rpx;
}
.specs-label:last-child {
margin-bottom: 0;
}
.specs-label text {
font-size: 30rpx;
display: block;
width: 100rpx;
color: #808080;
line-height: 44rpx;
}
.specs-site {
box-sizing: border-box;
font-size: 30rpx;
width: calc(100% - 120rpx);
}
.specs-site-list {
margin-bottom: 20rpx;
font-size: 28rpx;
}
.specs-site-list:last-child {
margin-bottom: 0;
}
.specs-site-name {
font-size: 32rpx;
margin-bottom: 10rpx;
}
/* 详情 */
.imageText {
width: 100%;
padding: 40rpx;
box-sizing: border-box;
}
.imageText-title {
width: 200rpx;
margin: 0 auto 30rpx;
text-align: center;
position: relative;
}
.imageText-title::after,
.imageText-title::before {
position: absolute;
content: '';
top: 49%;
background-color: #000000;
width: 100rpx;
height: 2rpx;
}
.imageText-title::after {
left: -100rpx;
}
.imageText-title::before {
right: -100rpx;
}
.imageText-end {
width: 80rpx;
height: 80rpx;
margin: 30rpx auto;
line-height: 80rpx;
text-align: center;
border-radius: 50%;
border: 2rpx solid #000000;
position: relative;
}
.imageText-end::after {
position: absolute;
content: '';
width: 10rpx;
height: 10rpx;
border-radius: 50%;
top: 0rpx;
right: 16rpx;
background-color: #000000;
}
/* 漂浮弹出层 */
.indexFloat {
position: fixed;
right: 20rpx;
bottom: 30rpx;
z-index: 99;
}
.indexFloat-img image {
width: 130rpx;
height: 130rpx;
margin-bottom: 20rpx;
}

View File

@@ -0,0 +1,47 @@
// pages/userGoods/userGoods.js
Page({
/**
* 页面的初始数据
*/
data: {
noticeText : '', //公告
goodsArr : [], //产品列表
page : {}, //分页信息
lodingStats : false, //加载状态
},
/**
* 生命周期函数--监听页面加载
*/
onLoad (options) {
// 获取产品列表
this.goodsGain();
},
/**
* 产品列表
*/
goodsGain(page){
wx.$api.user.productList(page).then(res=>{
let listArr = this.data.goodsArr,
newData = []
if(page == 1 || page == undefined) listArr = []
newData = listArr.concat(res.data.list.data)
this.setData({
goodsArr : newData,
page : res.data.list.page,
noticeText : res.data.notice
})
}).catch(err=>{
if(!err.login){
// 写入缓存
wx.setStorage({
key : 'token',
data : ''
})
}
})
}
})

View File

@@ -0,0 +1,6 @@
{
"usingComponents": {},
"navigationBarTitleText": "产品分享",
"navigationBarBackgroundColor": "#222222",
"navigationBarTextStyle": "white"
}

View File

@@ -0,0 +1,72 @@
<view class="codeTitle">
<image src="/static/img/userGoods_title.png" mode="widthFix"></image>
</view>
<view class="shareCont">
<!-- 提示 -->
<view class="indexNews">
<image src="/static/icon/news_icon.png"></image>
<view class="marquee_container" style="--marqueeWidth--:-30em">
<view class="marquee_text {{ noticeText.length > 20 ? 'active' : ''}}">{{noticeText}}</view>
</view>
</view>
<!-- 列表 -->
<view class="goods" wx:if="{{goodsArr.length > 0}}">
<view class='goodsList-half'>
<navigator hover-class="none" url="/pages/userGoods/goodsDet/goodsDet?rightid={{item.right_config_id}}"
class="goodsList" wx:for="{{goodsArr}}" wx:key="goodsArr" wx:if="{{index%2 == 0}}">
<view class="goodsList-img">
<image src="{{item.cover}}" mode="aspectFill"></image>
</view>
<view class="goodsList-cont">
<view class="nowrap goodsList-name">[ {{item.title}} ]{{item.share.type_name}}</view>
<view class="goodsList-text">{{item.share.sub_title}}</view>
<view class="goodsList-label"><text wx:for="{{item.share.label}}" wx:for-item="items"
wx:key="label">{{items}}</text></view>
<view class="goodsList-tips"><text>追加激励¥{{item.profit.stimulate}}</text></view>
<view class="goodsList-price">
<view class="goodsList-price-number">¥{{item.price}}<text>¥{{item.share.cost}}</text></view>
<view class="goodsList-price-btn">
<image src="/static/img/userGoods_icon.png"></image><text>返¥</text>{{item.profit.value}}
</view>
</view>
</view>
</navigator>
</view>
<view class='goodsList-half'>
<navigator hover-class="none" url="/pages/userGoods/goodsDet/goodsDet?rightid={{item.right_config_id}}"
class="goodsList" wx:for="{{goodsArr}}" wx:key="goodsArr" wx:if="{{index%2 != 0}}">
<view class="goodsList-img">
<image src="{{item.cover}}" mode="aspectFill"></image>
</view>
<view class="goodsList-cont">
<view class="nowrap goodsList-name">[ {{item.title}} ]{{item.share.type_name}}</view>
<view class="goodsList-text">{{item.share.sub_title}}</view>
<view class="goodsList-label"><text wx:for="{{item.share.label}}" wx:for-item="items"
wx:key="label">{{items}}</text></view>
<view class="goodsList-tips"><text>追加激励¥{{item.profit.stimulate}}</text></view>
<view class="goodsList-price">
<view class="goodsList-price-number">¥{{item.price}}<text>¥{{item.share.cost}}</text></view>
<view class="goodsList-price-btn">
<image src="/static/img/userGoods_icon.png"></image><text>返¥</text>{{item.profit.value}}
</view>
</view>
</view>
</navigator>
</view>
<view class="pagesLoding" wx:if="{{lodingStats}}">
<block wx:if="{{page.has_more}}">
<image class="pagesLoding-icon" src="/static/icon/refresh_loding.gif" mode="widthFix"></image>加载中...
</block>
<block wx:else>
没有更多了~
</block>
</view>
</view>
<view class="pack-center pages-hint" wx:else>
<image src="/static/img/staff_null.png"></image>
<view>暂无订单</view>
</view>
</view>

View File

@@ -0,0 +1,193 @@
page {
background-color: #e4e4e4;
}
.codeTitle {
width: 100%;
background-color: #222222;
border-radius: 0 0 300rpx 300rpx;
box-sizing: border-box;
padding: 30rpx 20rpx 0;
}
.codeTitle image {
text-align: center;
width: 100%;
border-radius: 20rpx;
display: block;
}
.shareCont {
padding: 0 20rpx;
box-sizing: border-box;
width: 100%;
}
.indexNews {
background: #c4c4c4;
display: flex;
font-weight: 600;
line-height: 46rpx;
border-radius: 50rpx;
padding: 20rpx 30rpx;
box-sizing: border-box;
margin: 30rpx 0;
}
.indexNews image {
width: 42rpx;
height: 42rpx;
margin: 4rpx 20rpx 0 0;
}
.goods {
display: flex;
flex-direction: row;
margin: 0 -10rpx;
}
.goodsList-half {
width: 50%;
}
.goodsList {
margin: 0 10rpx 20rpx;
background-color: #ffffff;
border-radius: 20rpx;
overflow: hidden;
}
.goodsList-img {
width: 100%;
position: relative;
padding-top: 80%;
}
.goodsList-img image {
width: 100%;
height: 100%;
position: absolute;
left: 0;
top: 0;
}
.goodsList-cont {
padding: 20rpx;
box-sizing: border-box;
}
.goodsList-name {
font-weight: 600;
}
.goodsList-text {
margin: 10rpx 0;
color: #6c6c6c;
font-size: 26rpx;
font-weight: 600;
}
.goodsList-label text {
display: inline-block;
font-size: 20rpx;
background-color: #dedede;
border-radius: 4rpx;
padding: 6rpx 10rpx;
margin: 0 10rpx 5rpx 0;
}
.goodsList-tips {
text-align: right;
margin: 30rpx 0 10rpx;
}
.goodsList-tips text {
background-color: #ff5c36;
transform: scale(.8);
color: #ffffff;
border-radius: 60rpx;
font-size: 22rpx;
padding: 2rpx 10rpx;
}
.goodsList-price {
display: flex;
}
.goodsList-price-number {
flex: 1;
line-height: 50rpx;
}
.goodsList-price-btn {
background-color: #ff5c36;
height: 48rpx;
line-height: 48rpx;
border-radius: 10rpx;
color: #ffffff;
padding: 0 10rpx;
font-size: 26rpx;
font-weight: 600;
}
.goodsList-price-btn text {
font-size: 22rpx;
}
.goodsList-price-btn image {
width: 20rpx;
height: 20rpx;
margin: 0 10rpx 0 0;
vertical-align: -2rpx;
}
.goodsList-price-number {
color: #ff5c36;
font-size: 32rpx;
font-weight: 600;
}
.goodsList-price-number text {
font-size: 22rpx;
color: #8f8f8f;
font-weight: normal;
text-decoration:line-through;
padding-right: 10rpx;
}
/* 滚动 */
/*首页跑马灯效果*/
@keyframes around {
from {
margin-left: 60rpx;
}
to {
/* var接受传入的变量 */
margin-left: var(--marqueeWidth--);
}
}
.marquee_container {
width: calc(100% - 40rpx);
overflow: hidden;
}
.marquee_container:hover {
/* 不起作用 */
animation-play-state: paused;
}
.marquee_text {
font-size: 30rpx;
display: inline-block;
white-space: nowrap;
}
.marquee_text.active {
animation-name: around;
animation-duration: 20s;
/*过渡时间*/
animation-iteration-count: infinite;
animation-timing-function: linear;
}

View File

@@ -0,0 +1,191 @@
/*
* 本时生活
*/
Page({
/**
* 页面的初始数据
*/
data: {
qrcode : '', //二维码
userInfo : '', //我的信息
isImgLay : false,//是否显示图片弹出层
parentId : '', //是否分享进入
shareState : false //显示分享朋友圈弹出层
},
/**
* 生命周期函数--监听页面加载
*/
onLoad (options) {
// 判断是否由分享进入
// if(options.type == "share"){
// // 写入缓存
// this.setData({
// parentId: options.parent_id
// })
// }
// 获取二维码
wx.$api.user.publicCode('mini', 'recharge', 'pages/userStored/userStored?type=share').then(res=>{
this.setData({
qrcode : res.data.qrcode,
userInfo : res.data.user
})
}).catch(err=>{})
},
/**
* 绘图
*/
dowImg(){
wx.showLoading({
title: '加载中',
})
let avatarImg = new Promise(success=>{
wx.getImageInfo({
src : '',
success : res => {
success(res.path)
}
})
})
// 下载素材
let codeImg = new Promise(success => {
wx.getImageInfo({
src : this.data.qrcode,
success : res => {
success(res.path)
}
})
})
Promise.all([codeImg]).then(res => {
// 绘制海报
const ctx = wx.createCanvasContext('qrcodeCard')
ctx.save()
// 绘制背景
ctx.setFillStyle('#e2e2e2')
ctx.fillRect(0, 0, 375, 603)
// 绘制背景
ctx.drawImage('/static/img/user-storedCode-down.png', 0, 0, 375, 650)
// 绘制二维码
ctx.drawImage(res[0], 114, 400, 150, 150)
// 文字
// ctx.setFontSize(16)
// ctx.setFillStyle("#2f3245")
// ctx.setTextAlign('center')
// ctx.fillText(this.data.userInfo.nickname, 194, 350 , 270)
// 文字
ctx.setFontSize(26)
ctx.setFillStyle("#222222")
ctx.setTextAlign('center')
ctx.fillText("向重要的人分享生活的惊喜", 194, 350 , 350)
ctx.save();
ctx.beginPath(); //开始绘制
ctx.arc(70 / 2 + 156, 70 / 2 + 250, 70 / 2, 0, Math.PI * 2, false);
ctx.clip();
// ctx.drawImage(res[1], 156, 250, 70, 70);
// 保存图片
ctx.draw(true, () => {
wx.hideLoading()
wx.canvasToTempFilePath({
canvasId: 'qrcodeCard',
x: 0,
y: 0,
success: res => {
wx.saveImageToPhotosAlbum({
filePath: res.tempFilePath,
success : res=>{
wx.showToast({
title: '分享海报已保存至相册',
icon : 'none'
})
},
fail : err=>{
wx.showModal({
title : '提示',
content : '暂未授权小程序写入您的相册,无法存储二维码海报',
confirmColor: '#d82526',
confirmText : '去设置',
success : info=>{
if (info.confirm){
wx.openSetting()
}
}
})
},
complete: e => {}
})
}
})
})
}).catch(err=>{
wx.showToast({
title: '海报下载,请检查网络',
icon : 'none'
})
})
},
/**
* 图片弹出层
*/
removeSaveImg(){
this.setData({
isImgLay: !this.data.isImgLay
})
},
/**
* 保存图片到本地
*/
saveImg(){
this.dowImg();
this.setData({
isImgLay: !this.data.isImgLay
})
},
/**
* 分享朋友圈弹出层状态
*/
shareShow() {
this.setData({
shareState: !this.data.shareState
})
},
/**
* 分享
*/
onShareAppMessage(){
return {
title : this.data.userInfo.nickname + "邀请您进入本时生活",
imageUrl: "",
path : "/pages/userStored/userStored?parent_id=" + this.data.userInfo.user_id + "&type=share",
}
},
/**
* 用户点击右上角分享朋友圈
*/
onShareTimeline: function () {
return {
title : this.data.userInfo.nickname + "邀请您进入本时生活",
path : "/pages/userStored/userStored?parent_id=" + this.data.userInfo.user_id + "&type=share",
imageUrl: ''
}
}
})

View File

@@ -0,0 +1,6 @@
{
"usingComponents": {},
"navigationBarTitleText": "储值分享",
"navigationBarBackgroundColor": "#222222",
"navigationBarTextStyle": "white"
}

View File

@@ -0,0 +1,55 @@
<image class="codeTitle" src="/static/img/storedCode.png" mode="widthFix"></image>
<view class="codeCont-code">
<view class="codeCont-title">
向重要的人分享生活的惊喜
</view>
<image class="codeCont-img" src="{{qrcode}}" mode="aspectFill"></image>
</view>
<view class="codeShare">
<button class="codeShare-label codeShare-button" open-type="share" hover-class="none">
<image src="/static/img/code_icon_00.png"></image>
微信好友
</button>
<view class="codeShare-label" bindtap="shareShow">
<image src="/static/img/code_icon_01.png"></image>
朋友圈
</view>
<view class="codeShare-label" bindtap="removeSaveImg" hover-class="none">
<image src="/static/img/code_icon_02.png"></image>
生成海报
</view>
</view>
<!-- 海报canvas -->
<canvas class="canvasImg" canvas-id="qrcodeCard"></canvas>
<!-- 图片弹出层 -->
<view class="user-lay sign-img-lay" wx:if="{{isImgLay}}">
<view class="user-back">
<image class="user-back-img" src="/static/img/storedCode.png" mode="widthFix"></image>
<view class="user-back-cont">
<view class="codeBack-yard-name">
向重要的人分享生活的惊喜
</view>
<image src="{{qrcode}}" mode="aspectFill"></image>
</view>
</view>
<button class="sign-img-btn" size="mini" bindtap="saveImg">保存到相册</button>
<button class="sign-img-btn remove-btn" size="mini" bindtap="removeSaveImg">取消</button>
</view>
<!-- 朋友圈提示弹出 -->
<view class="sharePop" wx:if="{{shareState}}" bindtap="shareShow">
<image class="sharePop-row" src="/static/img/code_share_01.png" mode="widthFix"></image>
<view class="shareList">
<view class="shareLabel">
<text>1</text>
点击右上角<image src="/static/img/code_share_00.png" mode="aspectFill"></image>打开菜单
</view>
<view class="shareLabel">
<text>2</text>
选择菜单<image src="/static/img/code_share_02.png" mode="aspectFill"></image>分享朋友圈
</view>
</view>
</view>

View File

@@ -0,0 +1,202 @@
page {
background-color: #e2e2e2;
}
.codeTitle {
width: 100%;
}
.codeTitle {
text-align: center;
width: 100%;
}
.codeCont {
margin: 0 auto;
width: 90%;
padding: 40rpx 0;
}
.codeCont-code {
text-align: center;
margin-bottom: 80rpx;
}
.codeCont-img {
width: 380rpx;
height: 380rpx;
}
.codeCont-title {
margin: 40rpx 0;
font-size: 46rpx;
font-weight: 600;
}
.codeShare {
display: flex;
padding: 20rpx 50rpx;
box-sizing: border-box;
}
.codeShare-label {
flex: 3;
text-align: center;
font-size: 28rpx;
}
.codeShare-label image {
width: 80rpx;
height: 80rpx;
display: block;
margin: 0 auto 20rpx;
}
.codeShare-button {
width: auto !important;
border: none;
background: transparent;
font-size: 28rpx;
margin: 0;
padding: 0;
font-weight: normal;
}
/* 弹窗背景图 */
.user-lay {
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-box-pack: center;
position: fixed;
background: rgba(0, 0, 0, .6);
height: 100vh;
width: 100vw;
top: 0;
left: 0;
z-index: 99;
box-sizing: border-box;
}
/* canvas */
.canvasImg {
position: absolute;
left: -1000%;
height: 650px;
width: 375px;
background: #fbf6f0;
}
/* 图片弹出层 */
.sign-img-lay {
text-align: center;
}
.sign-img-src {
width: 70vw;
vertical-align: top;
}
.sign-img-btn[size="mini"] {
margin-top: 40rpx;
background: #f5d48f;
font-weight: normal;
color: #2f3245;
height: 90rpx;
line-height: 90rpx;
padding: 0;
width: 80%;
}
.remove-btn[size="mini"] {
margin-top: 20rpx;
background: #101010;
color: #e5c175;
font-weight: normal;
}
/* 背景 */
.user-back-img {
width: 100%;
display: block;
}
.user-back {
position: relative;
width: 80%;
text-align: center;
margin: 0 auto;
}
.user-back-cont {
text-align: center;
background-color: #e2e2e2;
padding: 40rpx 0;
}
.user-back-cont image {
width: 300rpx;
height: 300rpx;
}
.codeBack-yard-name {
margin-bottom: 30rpx;
font-size: 36rpx;
font-weight: 600;
}
/* 朋友圈弹出层 */
.sharePop {
position: fixed;
left: 0;
top: 0;
width: 100%;
height: 100%;
z-index: 9;
background-color: rgba(0, 0, 0, .6);
text-align: center;
}
.sharePop-row {
width: 140rpx;
position: fixed;
right: 110rpx;
top: 0;
}
.shareList {
color: #ffffff;
line-height: 60rpx;
font-weight: 700;
font-size: 36rpx;
width: 100%;
height: 100%;
position: absolute;
z-index: 10;
top: 30%;
}
.shareLabel {
margin-bottom: 40rpx;
}
.shareLabel image {
width: 60rpx;
height: 60rpx;
margin: 0 20rpx;
vertical-align: middle;
}
.shareLabel text {
display: inline-block;
background: #0696ca;
width: 40rpx;
height: 40rpx;
line-height: 40rpx;
font-size: 26rpx;
border-radius: 50%;
margin: 8rpx 10rpx 0 0;
}

View File

@@ -0,0 +1,69 @@
// pages/userStored/userStored.js
Page({
/**
* 页面的初始数据
*/
data: {
isUser : false, //用户登录状态
canShare : '', //分享按钮状态
storedArr : [], //储值权益列表,
parentId : '', //分享者id
},
/**
* 生命周期函数--监听页面加载
*/
onLoad (options) {
// 判断是否由分享进入
if(options.type == "share"){
this.setData({
parentId: options.parent_id
})
// 写入缓存
wx.setStorage({
key : 'parentId',
data : options.parent_id
})
}
},
onShow(){
this.setData({
isUser : getApp().globalData.isUser
})
// 获取产品详情
this.storedShow();
},
/**
* 产品详情
*/
storedShow(){
wx.$api.user.storedList().then(res=>{
this.setData({
canShare : res.data.canShare,
storedArr : res.data.list
})
}).catch(err=>{})
},
/**
* 处理未登录时的转跳
*/
userNav(e){
let pageUrl = e.currentTarget.dataset.url
if(this.data.isUser){
wx.navigateTo({
url: pageUrl
})
}else{
// 去登录
wx.navigateTo({
url: "/pages/login/login?way=shareLogin"
})
}
}
})

View File

@@ -0,0 +1,6 @@
{
"usingComponents": {},
"navigationBarTitleText": "储值分享",
"navigationBarBackgroundColor": "#222222",
"navigationBarTextStyle": "white"
}

View File

@@ -0,0 +1,45 @@
<block wx:if="{{storedArr.length > 0}}">
<image class="userStoredBack" src="/static/img/userStored_back.png" mode="widthFix"></image>
<view class="userStored">
<view class="userStoredCont">
<image src="/static/img/userStored_icon.png" class="userStoredCont-back"></image>
<image src="/static/img/userStored_text.png" class="userStoredCont-text"></image>
<view class="userStoredCont-list">
<view class="userStoredCont-label" wx:for="{{storedArr}}" wx:key="storedArr">
<view class="userStoredCont-title">
<text>{{item.title}}</text>
<view class="userStoredCont-title-tips">消费红包</view>
</view>
<view class="userStoredCont-brief">
{{item.text}}<text>{{item.qty}}张50元</text>
</view>
<view class="userStoredCont-rights">
<view class="userStoredCont-rights-left">
<image src="/static/img/userStored_img_00.png" class="userStoredCont-fireworks"
mode="widthFix">
</image>
<view class="userStoredCont-tips">
<image src="/static/img/userStored_img_01.png" class="userStoredCont-rights-back"
mode="widthFix"></image>
<text>{{item.coupon_name}}</text>
</view>
<view class="userStoredCont-price">
<text>¥{{item.worth}}</text>(满{{item.full}}减{{item.worth}})
</view>
</view>
<view bindtap="userNav" data-url="/pages/rights/rights?rightsId={{item.right_config_id}}&parentid={{parentId}}" class="userStoredCont-rights-btn">立即儲值</view>
</view>
</view>
</view>
</view>
</view>
<navigator url="/pages/userStored/storedCode/storedCode" hover-class="none" class="userStoredBtn"
wx:if="{{canShare}}">
储值分享
</navigator>
</block>
<view class="pack-center pages-hint" wx:else>
<image src="/static/img/staff_null.png"></image>
<view>暂无订单</view>
</view>

View File

@@ -0,0 +1,200 @@
.userStoredBack {
width: 100%;
}
.userStored {
padding: 0 30rpx;
box-sizing: border-box;
}
.userStoredCont {
background: linear-gradient(to bottom, #e3d6c4, #bca585);
border-radius: 20rpx;
position: relative;
margin-top: -220rpx;
height: 1020rpx;
padding: 20rpx 0;
box-sizing: border-box;
}
.userStoredCont-back,
.userStoredCont-text {
position: absolute;
}
.userStoredCont-back {
width: 70%;
right: 0;
top: 0;
}
.userStoredCont-text {
width: 420rpx;
height: 192rpx;
left: 20rpx;
top: 40rpx;
z-index: 1;
}
.userStoredCont-list {
background-color: #fefbf4;
border-radius: 20rpx;
position: absolute;
top: 260rpx;
left: 30rpx;
right: 30rpx;
width: calc(100% - 60rpx);
padding: 30rpx 30rpx 0;
box-sizing: border-box;
}
.userStoredCont-label {
margin-bottom: 30rpx;
padding-bottom: 40rpx;
height: 300rpx;
border-bottom: #e8bd94 solid 2rpx;
}
.userStoredCont-label:last-child {
border: none;
}
.userStoredCont-title {
display: flex;
}
.userStoredCont-title text {
font-size: 48rpx;
color: #806136;
}
.userStoredCont-title-tips {
background-color: #fb5734;
color: #ffffff;
border-radius: 80rpx;
font-size: 28rpx;
height: 42rpx;
line-height: 42rpx;
margin: 17rpx 0 0 20rpx;
padding: 0 15rpx;
}
.userStoredCont-brief {
margin: 30rpx 0;
color: #ca9c5a;
}
.userStoredCont-brief text {
font-size: 22rpx;
}
.userStoredCont-rights {
display: flex;
}
.userStoredCont-rights-left {
background: linear-gradient(to top, #f6e4ca, #e4c6a3);
width: calc(100% - 230rpx);
margin-right: 30rpx;
height: 140rpx;
border-radius: 10rpx;
position: relative;
}
.userStoredCont-price {
color: #806136;
}
.userStoredCont-tips {
width: 100%;
height: 44rpx;
top: 10rpx;
right: 0;
position: absolute;
text-align: center;
color: #ffffff;
}
.userStoredCont-tips image,
.userStoredCont-tips text {
position: absolute;
height: 100%;
top: 0;
}
.userStoredCont-tips image {
width: 70%;
right: -10rpx;
}
.userStoredCont-tips text {
width: 58%;
z-index: 2;
font-size: 25rpx;
right: 0rpx;
line-height: 44rpx;
text-align: center;
box-sizing: border-box;
}
.userStoredCont-price {
position: absolute;
bottom: 15rpx;
left: 20rpx;
z-index: 3;
}
.userStoredCont-price {
font-size: 24rpx;
}
.userStoredCont-price text {
font-size: 46rpx;
padding-right: 10rpx;
}
.userStoredCont-fireworks {
position: absolute;
width: 84rpx;
height: 84rpx;
left: 10rpx;
bottom: 15rpx;
z-index: 1;
}
.userStoredCont-rights-btn {
background-color: #222222;
color: #ffffff;
width: 200rpx;
text-align: center;
height: 70rpx;
line-height: 70rpx;
margin-top: 35rpx;
}
/* 分享按钮 */
.userStoredBtn {
background: #bca585;
border-radius: 80rpx;
margin: 40rpx 30rpx;
width: calc(100% - 60rpx);
line-height: 80rpx;
text-align: center;
color: #ffffff;
font-weight: 600;
}
/* 漂浮弹出层 */
/* .indexFloat {
position: fixed;
right: 20rpx;
bottom: 60rpx;
z-index: 99;
}
.indexFloat-img image {
width: 130rpx;
height: 130rpx;
margin-bottom: 20rpx;
} */

View File

@@ -81,17 +81,10 @@ Page({
}) })
}).catch(err=>{ }).catch(err=>{
if(!err.login){ if(!err.login){
wx.showModal({ // 写入缓存
title : '用户登录已过期', wx.setStorage({
content : '请重新登录', key : 'token',
showCancel : false, data : ''
success : res => {
if (res.confirm) {
wx.redirectTo({
url: '/pages/login/login'
})
}
}
}) })
} }
}) })
@@ -218,60 +211,12 @@ Page({
rightsTap: true rightsTap: true
}) })
}else { }else {
// payWayIndex为0的时候为微信支付 // 跳转收银台
if(this.data.payWayIndex == 0) { wx.navigateTo({
wx.$api.index.fridayPay(res.data.trade_no).then(res=>{ url: "/pages/cashier/cashier?trade_no=" + res.data.trade_no + "&amount=" + this.data.amount + "&is_deliver=" + is_deliver + "&pay_type=welfarePay"
let payInfo = JSON.parse(res.data)
wx.requestPayment({
timeStamp: payInfo.timeStamp,
nonceStr : payInfo.nonceStr,
package : payInfo.package,
paySign : payInfo.paySign,
signType : payInfo.signType,
success : res=>{
if(res.errMsg == "requestPayment:ok"){
wx.showToast({
title: '支付成功',
icon : 'success'
})
setTimeout(()=>{
if(this.data.isdeliver == 1) {
wx.reLaunch({
url: '/pages/order/order?orderType=welfareGoods'
})
} else {
wx.reLaunch({
url: '/pages/order/order?orderType=welfare'
}) })
} }
},3000) }).catch(err => {});
}
},
fail : res=>{
if(this.data.isdeliver == 1) {
wx.reLaunch({
url: '/pages/order/order?orderType=welfareGoods&stateType=unpay'
})
} else {
wx.reLaunch({
url: '/pages/order/order?orderType=welfare&stateType=unpay'
})
}
}
})
})
}
// payWayIndex为1的时候为沃钱包支付
if(this.data.payWayIndex == 1) {
const newUrl = "https://lifetest.ysd-bs.com/unicom/payment?trade_no=" + res.data.trade_no
let url= encodeURIComponent(newUrl)
wx.redirectTo({
// 跳转到webview页面
url: `/pages/webView/webView?url=${url}`
});
}
}
})
}, },
/** /**

View File

@@ -18,5 +18,6 @@
提现费用收取,手续费{{tax}}% 提现费用收取,手续费{{tax}}%
</view> </view>
<button class="withdrawalForm-btn" formType="submit" disabled="{{disabled}}">立即提现</button> <button class="withdrawalForm-btn" formType="submit" disabled="{{disabled}}">立即提现</button>
<navigator class="withdrawalForm-url" hover-class="none" url="/pages/withdrawal_record/withdrawal_record?status=''&idx=0">提现记录</navigator>
</form> </form>
</view> </view>

View File

@@ -52,3 +52,21 @@
margin-top: 40rpx; margin-top: 40rpx;
font-size: 32rpx; font-size: 32rpx;
} }
.withdrawalForm-url {
text-align: center;
width: 100%;
margin-top: 20rpx;
position: relative;
color: #ff6d6d;
}
.withdrawalForm-url::after {
position: absolute;
content: '';
left: calc(50% - 60rpx);
bottom: 0rpx;
width: 120rpx;
height: 4rpx;
background-color: #ff6d6d;
}

View File

@@ -9,13 +9,23 @@ Page({
accounts : [], //列表 accounts : [], //列表
page : {}, //分页信息 page : {}, //分页信息
lodingStats : false, //加载状态 lodingStats : false, //加载状态
WithdrawalWay : [
{value: '', name: "全部", status: ''},
{value: 0, name: "提现中", status: 'init'},
{value: 1, name: "已提现", status: 'end'}
],
WithdrawalIndex : 0, //收益订单筛选列表index
WithdrawalValue : 'init', //收益订单筛选列表value
}, },
/** /**
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
onLoad (options) { onLoad (options) {
this.setData({
WithdrawalValue: options.status,
WithdrawalIndex: parseInt(options.idx)
})
}, },
/** /**
@@ -30,7 +40,7 @@ Page({
* 提现列表 * 提现列表
*/ */
recordInfo(page) { recordInfo(page) {
wx.$api.user.withdrawsList(page).then(res=>{ wx.$api.user.withdrawsList(this.data.WithdrawalValue, page).then(res=>{
let listArr = this.data.accounts, let listArr = this.data.accounts,
newData = [] newData = []
if(page == 1 || page == undefined) listArr = [] if(page == 1 || page == undefined) listArr = []
@@ -40,7 +50,19 @@ Page({
accounts : newData, accounts : newData,
page : res.data.page page : res.data.page
}) })
}).catch(err => {});
},
/**
* 团队类型选择
*/
screenWithdrawal(val) {
this.setData({
WithdrawalIndex: val.detail.value,
WithdrawalValue: this.data.WithdrawalWay[val.detail.value].status
}) })
// 获取提现列表
this.recordInfo();
}, },
/** /**

View File

@@ -1,4 +1,16 @@
<block wx:if="{{accounts.length > 0}}"> <view class="profigOrder-module-title">
<view class="profigOrder-module-name">
提现列表
</view>
<view class="profigReport-module-picker">
<picker bindchange="screenWithdrawal" value="{{WithdrawalIndex}}" range-key="name" range="{{WithdrawalWay}}">
{{WithdrawalWay[WithdrawalIndex].name}}
</picker>
<image class="profigReport-module-icon" src="/static/icon/arrow_down.png"></image>
</view>
</view>
<view wx:if="{{accounts.length > 0}}" class="recordCont">
<view class="record-list" wx:for="{{accounts}}" wx:key="accounts"> <view class="record-list" wx:for="{{accounts}}" wx:key="accounts">
<view class="record-top"> <view class="record-top">
<view class="record-way">{{item.way}}</view> <view class="record-way">{{item.way}}</view>
@@ -11,8 +23,8 @@
</view> </view>
<view class="record-label"> <view class="record-label">
<view class="record-label-name">提现状态</view> <view class="record-label-name">提现状态</view>
<view class="record-label-status" wx:if="{item.status.status_text == 2 && item.status.status_text == 4}">{{item.status.status_text}}</view> <view class="record-label-status {{item.status.status == 3 ? 'record-label-green' : ''}}">
<view class="record-label-status record-label-green" wx:elif="{item.status.status_text == 0 && item.status.status_text == 1 && item.status.status_text == 3}">{{item.status.status_text}}</view> {{item.status.status_text}}</view>
</view> </view>
</view> </view>
</view> </view>
@@ -24,7 +36,7 @@
没有更多了~ 没有更多了~
</block> </block>
</view> </view>
</block> </view>
<!-- 暂无内容 --> <!-- 暂无内容 -->
<view class="pack-center pages-hint" wx:else> <view class="pack-center pages-hint" wx:else>
<image src="/static/img/legal_tips.png"></image> <image src="/static/img/legal_tips.png"></image>

View File

@@ -1,3 +1,4 @@
/* 记录列表 */ /* 记录列表 */
.record-list { .record-list {
background-color: #fff; background-color: #fff;
@@ -38,6 +39,44 @@
color: red; color: red;
} }
.record-label-green { .record-label-status.record-label-green {
color: green; color: green;
} }
.profigOrder-module-title {
position: fixed;
width: 100%;
left: 0;
top: 0;
z-index: 9;
background-color: #ffffff;
display: flex;
box-sizing: border-box;
height: 80rpx;
line-height: 80rpx;
margin-bottom: 30rpx;
padding: 0 30rpx;
box-sizing: border-box;
}
.profigOrder-module-name {
font-weight: 600;
flex: 1;
}
.profigReport-module-picker {
display: flex;
color: #797979;
font-size: 28rpx;
padding-top: 4rpx;
}
.profigReport-module-icon {
width: 28rpx;
height: 28rpx;
margin: 26rpx 0 0 10rpx;
}
.recordCont {
margin-top: 110rpx;
}

View File

@@ -31,15 +31,14 @@
}, },
"enableEngineNative": false, "enableEngineNative": false,
"useIsolateContext": true, "useIsolateContext": true,
"useCompilerModule": true,
"userConfirmedUseCompilerModuleSwitch": false,
"userConfirmedBundleSwitch": false, "userConfirmedBundleSwitch": false,
"packNpmManually": false, "packNpmManually": false,
"packNpmRelationList": [], "packNpmRelationList": [],
"minifyWXSS": true "minifyWXSS": true,
"showES6CompileOption": false
}, },
"compileType": "miniprogram", "compileType": "miniprogram",
"libVersion": "2.12.1", "libVersion": "2.18.1",
"appid": "wx8e424dbdc443381f", "appid": "wx8e424dbdc443381f",
"projectname": "%E4%BA%BF%E6%97%B6%E4%BB%A3%EF%BC%88%E6%B5%8B%E8%AF%95%EF%BC%89", "projectname": "%E4%BA%BF%E6%97%B6%E4%BB%A3%EF%BC%88%E6%B5%8B%E8%AF%95%EF%BC%89",
"debugOptions": { "debugOptions": {

View File

@@ -55,6 +55,18 @@
"pathName": "pages/password_forget/password_forget", "pathName": "pages/password_forget/password_forget",
"query": "", "query": "",
"scene": null "scene": null
},
{
"name": "pages/userStored/userStored",
"pathName": "pages/userStored/userStored",
"query": "",
"scene": null
},
{
"name": "pages/userGoods/userGoods",
"pathName": "pages/userGoods/userGoods",
"query": "",
"scene": null
} }
] ]
} }

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.2 KiB

After

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.4 KiB

After

Width:  |  Height:  |  Size: 6.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.4 KiB

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 17 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 17 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 274 B

Some files were not shown because too many files have changed in this diff Show More