个人中心新增绑定关系

This commit is contained in:
唐明明
2022-07-19 11:57:20 +08:00
28 changed files with 10492 additions and 4458 deletions

View File

@@ -95,6 +95,29 @@ const paymentpre = () => {
}) })
} }
// 我的版通账户信息
const wbtInfo = () => {
return request({
url: 'wallet/wbt/info'
})
}
// 是否绑定了文版通账户
const wbtCheck = () => {
return request({
url: 'wallet/wbt/check'
})
}
// 绑定账户版通账户
const wbtBind = (data) => {
return request({
url: 'wallet/wbt/bind',
data:data,
method:'POST',
})
}
export { export {
dt, dt,
recharge, recharge,
@@ -106,6 +129,9 @@ export {
getSms, getSms,
submitTransfer, submitTransfer,
integral, integral,
paymentpre paymentpre,
wbtInfo,
wbtCheck,
wbtBind
} }

40
apis/interfaces/news.js Normal file
View File

@@ -0,0 +1,40 @@
/**
* Web-zdx
* moduleName: 消息中心
*/
import {
request
} from '../index'
// 意见反馈通知列表
const list = (type,data) => {
return request({
url: 'notifications/'+type+'/list',
data:data,
})
}
// 意见反馈 详情
const detail = (notification_id) => {
return request({
url: 'notifications/'+notification_id,
})
}
// 全部已读
const readAll = (type) => {
return request({
url: 'notifications/'+type,
method:'PUT',
})
}
export {
list,
detail,
readAll,
}

View File

@@ -30,8 +30,31 @@ const invitationCode = () => {
}) })
} }
// 绑定分享关系
const relationsBind = (invite) => {
return request({
url: 'user/relations/bind',
data: {
invite
},
method: 'POST'
})
}
// 确认绑定关系
const relationsVerify = (invite) => {
return request({
url: 'user/relations/verify',
data: {
invite
}
})
}
export { export {
info, info,
chainSeed, chainSeed,
invitationCode invitationCode,
relationsBind,
relationsVerify
} }

1040
pages.json

File diff suppressed because it is too large Load Diff

View File

@@ -13,17 +13,17 @@
DT积分冻结 DT积分冻结
<image src="/static/rank/help.png" style="width: 30rpx;" mode="widthFix" /> <image src="/static/rank/help.png" style="width: 30rpx;" mode="widthFix" />
</view> </view>
<view class="num">{{frozenScore}}</view> <view class="num">{{frozenScore || '0.0000'}}</view>
</view> </view>
<button class="transfer" size="mini" @click="onTransfer('AccountRecharge')">充值</button> <button class="transfer" size="mini" @click="dtShow = true">充值</button>
<button class="transfer" size="mini" @click="onTransfer('AccountTransfer')">转账</button> <button class="transfer" size="mini" @click="onTransfer('AccountTransfer')">转账</button>
</view> </view>
<block v-if="logs.length > 0"> <block v-if="logs.length > 0">
<view class="logs-title">账户记录</view> <view class="logs-title">账户记录</view>
<view class="logs-item" v-for="(item,index) in logs" :key="index" @click="frozenInfo(item.description)"> <view class="logs-item" v-for="(item,index) in logs" :key="index" @click="frozenInfo(item.description)">
<view class="logs-item-title"> <view class="logs-item-title">
{{item.remark}} {{item.remark}}
<image v-if ="item.description!== ''" src="/static/rank/help3.png" mode="widthFix" /> <image v-if="item.description!== ''" src="/static/rank/help3.png" mode="widthFix" />
</view> </view>
<view class="logs-item-time">{{item.created_at}}</view> <view class="logs-item-time">{{item.created_at}}</view>
<view class="logs-item-price" :class="item.amount > 0 ? 'add': 'remove'"> <view class="logs-item-price" :class="item.amount > 0 ? 'add': 'remove'">
@@ -38,12 +38,25 @@
</u-empty> </u-empty>
</view> </view>
</block> </block>
<u-popup :show="dtShow" mode="bottom" @close="dtShow = false " :round="10">
<view class="dt-type">
<view class="dt-item" @click="dtSelect('wbt')">
<image src="/static/icon/pay_wbt.png" mode="widthFix" />
文版通充值
</view>
<view class="dt-item" @click="dtSelect('wchat')">
<image src="/static/icon/pay_wechat.png" mode="widthFix" />
微信充值
</view>
</view>
</u-popup>
</view> </view>
</template> </template>
<script> <script>
import { import {
dt dt,wbtCheck
} from '@/apis/interfaces/account.js' } from '@/apis/interfaces/account.js'
export default { export default {
data() { data() {
@@ -52,8 +65,9 @@
frozenScore: '0.00', frozenScore: '0.00',
logs: [], logs: [],
page: 1, page: 1,
has_more: true, has_more: true,
description:'', description: '',
dtShow: false, // 是否显示重置弹窗
}; };
}, },
onShow() { onShow() {
@@ -69,7 +83,35 @@
this.page = 1; this.page = 1;
this.getDt(); this.getDt();
}, },
methods: { methods: {
dtSelect(type){
switch(type){
case 'wchat':
this.onTransfer('AccountRecharge');
break;
case 'wbt':
wbtCheck().then(res=>{
if(res){
uni.showToast({
title:' 跳转文版通APP, 努力开发中~',
icon:"none",
mask:true,
duration:3000
})
}else{
this.$Router.push({name:'WbtBind'})
}
this.dtShow = false;
}).catch(err=>{
uni.showToast({
title:err.message,
icon:"none",
mask:true
})
})
break;
}
},
getDt() { getDt() {
dt({ dt({
page: this.page page: this.page
@@ -79,7 +121,7 @@
} }
this.score = res.score; this.score = res.score;
this.frozenScore = res.frozenScore; this.frozenScore = res.frozenScore;
this.logs = this.logs.concat(res.lists.data); this.logs = this.logs.concat(res.lists.data);
this.description = res.description; this.description = res.description;
this.has_more = res.lists.page.has_more; this.has_more = res.lists.page.has_more;
uni.stopPullDownRefresh(); uni.stopPullDownRefresh();
@@ -95,19 +137,19 @@
this.$Router.push({ this.$Router.push({
name name
}) })
}, },
frozenInfo(description){ frozenInfo(description) {
if(description!== ''){ if (description !== '') {
uni.showModal({ uni.showModal({
title:'温馨提示', title: '温馨提示',
content:description, content: description,
showCancel:false, showCancel: false,
confirmColor:"#34ce98", confirmColor: "#34ce98",
confirmText:' 知道了' confirmText: ' 知道了'
}) })
} }
}, },
}, },
onNavigationBarButtonTap() { onNavigationBarButtonTap() {
this.$Router.push({ this.$Router.push({
@@ -188,9 +230,10 @@
flex-direction: row; flex-direction: row;
align-items: center; align-items: center;
justify-content: flex-start; justify-content: flex-start;
box-sizing: border-box; box-sizing: border-box;
image{
padding-left: 4rpx; image {
padding-left: 4rpx;
} }
} }
@@ -203,14 +246,14 @@
} }
.transfer[size="mini"] { .transfer[size="mini"] {
width: 160rpx; width: 150rpx;
height: 70rpx; height: 66rpx;
border-radius: 40rpx; border-radius: 40rpx;
line-height: 70rpx; line-height: 66rpx;
background: white; background: white;
font-size: 30rpx; font-size: 30rpx;
color: $main-color; color: $main-color;
margin: 0; margin: 4rpx;
font-weight: bold; font-weight: bold;
&::after { &::after {
@@ -240,15 +283,16 @@
.logs-item-title { .logs-item-title {
font-weight: bold; font-weight: bold;
font-size: 30rpx; font-size: 30rpx;
line-height: 50rpx; line-height: 50rpx;
display: flex; display: flex;
flex-direction: row; flex-direction: row;
align-items: center; align-items: center;
justify-content: flex-start; justify-content: flex-start;
box-sizing: border-box; box-sizing: border-box;
image{
width: 30rpx; image {
padding-left: 4rpx; width: 30rpx;
padding-left: 4rpx;
} }
} }
@@ -288,4 +332,27 @@
} }
} }
} }
.dt-type {
display: flex;
flex-direction: row;
align-items: center;
justify-content: center;
box-sizing: border-box;
padding: $padding *2 $padding;
.dt-item{
flex: 1;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
box-sizing: border-box;
font-size: 28rpx;
color:grey;
image{
width: 80rpx;
margin-bottom: $margin;
}
}
}
</style> </style>

View File

@@ -3,7 +3,7 @@
<!-- 设置支付密码 --> <!-- 设置支付密码 -->
<view class="password"> <view class="password">
<view class="prompt"> <view class="prompt">
<view class="prompt-code">验证码发送至{{phone}} <view class="prompt-code">验证码发送至{{phone}}
<!-- <button size="mini" :disabled="getCodeState" @click="getCode">{{sendCode}}</button> --> <!-- <button size="mini" :disabled="getCodeState" @click="getCode">{{sendCode}}</button> -->
</view> </view>
<view>请设置6位数字密码建议不要使用连续的数字</view> <view>请设置6位数字密码建议不要使用连续的数字</view>

200
pages/account/wbtBind.vue Normal file
View File

@@ -0,0 +1,200 @@
<template>
<view class="wbtBind">
<view class="input">
<view class="title">文版通编号</view>
<input type="number" maxlength="13" v-model="account" placeholder-class="placeholderClass" placeholder="请输入13位数字的文版通账号" />
</view>
<view class="input">
<view class="title">文版通姓名</view>
<input type="text" v-model="name" placeholder-class="placeholderClass" placeholder="请输入您的文版通姓名" />
</view>
<view class="group">
<u-radio-group>
<u-radio :checked='true' activeColor="#34ce98" labelColor="#999" labelSize="13" label="我有文版通账号" />
</u-radio-group>
<view class="created" >创建账号</view>
</view>
<view class="sure" @click="wbtBind"> 确认绑定文版通 </view>
<navigator hover-class="none" url="/pages/vip/agreement?id=9">
<view class="agree"> 同意
<span>文版通使用协议</span>
</view>
</navigator>
<view class="help">
<view class="title"> 温馨提示 </view>
<view class="help_1" v-for="item in 4" :key='item'>
{{item}}.文版通使用注意事项文版通使用注意事项文版通使用注意事项文版通使用注意事项文版通使用注意事项文版通使用注意事项
</view>
</view>
</view>
</template>
<script>
import { wbtBind } from '@/apis/interfaces/account'
export default {
data() {
return {
account: '',
name: ''
};
},
methods:{
wbtBind(){
let data = {
account: this.account,
name: this.name
}
if(data.account === '' && data.account.length !== 13){
uni.showToast({
title:'请核对账号',
icon:"none",
mask:true
})
return ;
}
if(data.name === ''){
uni.showToast({
title:'请核对姓名',
icon:"none",
mask:true
})
return ;
}
uni.showModal({
title:'温馨提示',
content:'确认绑定该文版通账号,绑定后无法撤回!',
success:(res)=> {
if(res.confirm){
wbtBind(data).then(res=>{
uni.showToast({
title:'文版通账号绑定成功',
icon:"none",
mask:true,
duration:1500
})
setTimeout(()=>{
uni.navigateBack({})
},2000)
}).catch(err=>{
uni.showToast({
title:err.message,
icon:"none",
mask:true
})
})
}
}
})
}
}
}
</script>
<style lang="scss">
.wbtBind {
min-height: 100vh;
background-color: #f9f9f9;
width: 100%;
box-sizing: border-box;
padding-top: 20rpx;
.input {
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
box-sizing: border-box;
padding: $padding + 20 $padding;
background-color: #fff;
border-bottom: solid 1rpx #f9f9f9;
input {
flex: 1;
text-align: left;
font-size: 30rpx;
}
.title {
font-size: 32rpx;
color: #333;
width: 200rpx;
margin-right: $margin;
font-weight: 600;
}
.placeholderClass {
color: #cacaca;
font-size: 30rpx;
}
}
.group {
font-size: 28rpx;
padding: $padding;
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
box-sizing: border-box;
margin-top: 10rpx;
.created {
color: #34CE98;
}
}
.sure {
background-color: $main-color;
color: #FFFFFF;
font-size: 34rpx;
font-weight: bold;
margin: 0 $margin $margin $margin;
border-radius: 10rpx;
text-align: center;
padding: $padding;
font-weight: bold;
}
.agree {
display: flex;
flex-direction: row;
align-items: center;
justify-content: flex-start;
box-sizing: border-box;
padding-left: $padding;
font-size: 28rpx;
color: #999;
span {
color: #1482D1;
margin-left: 10rpx;
}
}
.help {
padding: $padding;
color: #666;
font-size: 30rpx;
margin-top: $margin;
.title {
font-size: 34rpx;
font-weight: bold;
padding-bottom: 20rpx;
padding-top: 20rpx;
color: #333;
}
.help_1 {
padding-top: 10rpx;
line-height: 1.5;
}
}
}
</style>

316
pages/news/detail.vue Normal file
View File

@@ -0,0 +1,316 @@
<template>
<view class="notification">
<view class="notification-block">
<view class="notification-title">
<view class="" style="display: flex;flex-direction: row;">
<image class="answer-img" src="/static/news/news.png" mode="widthFix" />官方客服回复
</view>
<view class="date" v-if="notificationInfo.detail"> {{notificationInfo.detail.created_at}}</view>
</view>
<view class="notification-radiobox">
<view class="answer show"> A : {{notificationInfo.content}}</view>
</view>
</view>
<view class="notification-block">
<view class="notification-title">
我的意见与建议
<view class="date"> {{notificationInfo.created_at}}</view>
</view>
<view class="notification-radiobox">
<view class="notification-radiobox-item" :class="{'show': radioValue === '页面闪退'}">页面闪退</view>
<view class="notification-radiobox-item" :class="{'show': radioValue === '操作体验'}">操作体验</view>
<view class="notification-radiobox-item" :class="{'show': radioValue === '账号问题'}">账号问题</view>
<view class="notification-radiobox-item" :class="{'show': radioValue === '功能异常'}">功能异常</view>
<view class="notification-radiobox-item" :class="{'show': radioValue === '产品建议'}">产品建议</view>
<view class="notification-radiobox-item" :class="{'show': radioValue === '其他问题'}">其他问题</view>
</view>
</view>
<view class="notification-block" v-if="notificationImg.length>0">
<view class="notification-title">上传应用截图({{notificationImg.length}}/8)</view>
<view class="notification-sbutitle">上传出现问题的应用图片</view>
<view class="notification-imgs">
<view class="notification-imgs-item" v-for="(item, index) in notificationImg" :key="index">
<image :src="item" mode="aspectFill" @click="prieve(index)"></image>
</view>
</view>
</view>
<view class="notification-block" v-if="description.length>0">
<view class="notification-title"> 问题说明</view>
<view class="notification-sbutitle">请对您所遇到的问题进行尽可能详细的描述</view>
<view class="notification-textarea">
<textarea maxlength="200" v-model="description" :disabled="true" />
<view class="notification-textarea-size">{{description.length}}/200</view>
</view>
</view>
<view class="notification-block" v-if="mobile.length>0">
<view class="notification-title">联系方式</view>
<input class="notification-input" type="number" :disabled="true" v-model="mobile" maxlength="11"
placeholder="输入手机号码" />
</view>
<!-- 微信客服 -->
<u-modal :show="wechatCode" title="微信客服" confirmColor="#34CE98" :showCancelButton="true" cancelText="关闭"
confirmText="保存二维码" @cancel="wechatCode = false" @confirm="dowQrCode">
<slot>
<view class="wechat-content">
<image class="wechat-qrcode" :src="require('@/static/user/qrCode.jpeg')" mode="widthFix"></image>
<view class="wechat-text">扫描企业微信二维码添加微信客服</view>
</view>
</slot>
</u-modal>
</view>
</template>
<script>
import {
notifications
} from '@/apis/interfaces/versions'
import {
detail
} from '@/apis/interfaces/news'
export default {
data() {
return {
radioValue: "页面闪退",
description: "",
mobile: "",
systemInfo: {},
notificationImg: [],
wechatCode: false,
notificationInfo: {}
}
},
onLoad() {
uni.getSystemInfo({
success: systemRes => {
this.systemInfo = {
brand: systemRes.brand,
models: systemRes.model,
pixel: systemRes.pixelRatio,
width: systemRes.windowWidth,
height: systemRes.windowHeight,
version: systemRes.system,
platform: systemRes.platform,
font_size: systemRes.fontSizeSetting,
client_id: systemRes.deviceId,
}
}
})
detail(this.$Route.query.id).then(res => {
this.notificationInfo = res;
this.radioValue = res.detail.type || ''
this.notificationImg = res.detail.pictures || []
this.description = res.detail.description || ''
this.mobile = res.detail.mobile || ''
}).catch(err => {
uni.showToast({
title: err.message,
icon: 'none',
mask: true,
})
})
},
onNavigationBarButtonTap() {
this.wechatCode = true
},
methods: {
dowQrCode() {
uni.saveImageToPhotosAlbum({
filePath: require('@/static/user/qrCode.jpeg'),
success(res) {
uni.showToast({
title: '二维码已保存到系统相册',
icon: 'none'
})
},
fail(err) {
uni.showToast({
title: err.message,
icon: 'none'
})
}
})
},
prieve(index) {
uni.previewImage({
urls: this.notificationImg,
current:index
});
}
}
}
</script>
<style scoped lang="scss">
.notification-block {
padding: 30rpx;
border-top: solid 20rpx #F8F8F8;
}
.notification-title {
font-size: 34rpx;
font-weight: bold;
line-height: 40rpx;
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
box-sizing: border-box;
.date{
color: grey;
font-size: 26rpx;
font-weight: normal;
}
}
.notification-title text {
color: #e6576b;
padding-left: 5rpx;
}
.notification-radiobox {
display: flex;
flex-wrap: wrap;
margin: 20rpx -10rpx 0;
}
.notification-radiobox-item {
position: relative;
width: calc(33.33% - 20rpx);
display: inline-block;
margin: 10rpx;
background: #F8F8F8;
text-align: center;
line-height: 70rpx;
border-radius: 30rpx;
font-size: 30rpx;
}
.answer {
position: relative;
width: calc(100% - 20rpx);
display: inline-block;
margin: 10rpx;
background: rgba($color: #34ce98, $alpha: 0.1);
text-align: center;
line-height: 70rpx;
border-radius: 10rpx;
font-size: 30rpx;
text-align: left;
padding: 10rpx 20rpx;
}
.notification-radiobox-item.show {
background: #34CE98;
color: white;
}
.notification-imgs {
display: flex;
flex-direction: row;
flex-wrap: wrap;
margin: 10rpx -10rpx 0;
}
.notification-imgs-item {
position: relative;
width: calc(25% - 20rpx);
padding-top: calc(25% - 20rpx);
margin: 20rpx 10rpx 0 10rpx;
}
.notification-imgs-item image {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
border: solid 1rpx #f8f8f8;
}
.notification-sbutitle {
font-size: 28rpx;
padding-top: 10rpx;
color: gray;
}
.notification-textarea {
background: #F8F8F8;
border-radius: 20rpx;
padding: 20rpx;
margin-top: 20rpx;
}
.notification-textarea textarea {
width: 100%;
height: 200rpx;
font-size: 32rpx;
}
.notification-textarea-size {
text-align: right;
font-size: 28rpx;
color: gray;
}
.notification-input {
background: #F8F8F8;
border-radius: 20rpx;
height: 90rpx;
line-height: 90rpx;
margin-top: 20rpx;
font-size: 32rpx;
padding: 0 20rpx;
}
.btn {
padding: 30rpx;
}
.btn button {
height: 90rpx;
line-height: 90rpx;
border-radius: 45rpx;
background: #34CE98;
font-size: 34rpx;
font-weight: bold;
color: white;
border: none;
padding: 0;
}
.btn button:after {
display: none;
}
/* 弹出层 */
.wechat-content {
text-align: center;
padding: 30rpx 0;
}
.wechat-qrcode {
width: 248rpx;
height: 248rpx;
}
.wechat-text {
text-align: center;
font-size: 28rpx;
color: gray;
padding-top: 30rpx;
}
.answer-img {
width: 50rpx;
height: 50rpx;
margin-right: 10rpx;
}
</style>

174
pages/news/index.vue Normal file
View File

@@ -0,0 +1,174 @@
<template>
<view class="news">
<block v-if="lists.length > 0">
<view class="list-item" v-for="(item,index) in lists" :key="index" @click="goUrl(item.notification_id,index)">
<u-badge class="bell_fill_dot" :isDot="item.read_at === ''" type="error" />
<image src="/static/news/news.png" mode="widthFix" />
<view class="list-item-right">
<view class="top">
<view class="title">
<view class="titl"> 系统反馈 </view>
<view class="des">官方</view>
</view>
<view class="date">{{item.created_at}}</view>
</view>
<view class="sub-title">快捷反馈:{{item.content}}</view>
</view>
</view>
</block>
<view class="no-list" v-else>
<u-empty mode="message" icon="http://cdn.uviewui.com/uview/empty/message.png" text="暂无消息~" textColor="#999" />
</view>
</view>
</template>
<script>
import {list,readAll} from '@/apis/interfaces/news.js'
export default {
data() {
return {
lists:[],
type:'FeedbackNotification',
has_more: true,
page: 1,
}
},
onLoad() {
this.getList();
},
onReachBottom() {
if(this.has_more){
this.page = this.page + 1;
this.getList();
} else{
uni.showToast({
title:'没有更多啦~',
icon:'none',
mask:true,
})
}
},
onNavigationBarButtonTap() {
readAll(this.type).then(res=>{
uni.showToast({
title:'全部已读',
icon:"none",
mask:true,
duration:3000
});
this.page = 1;
this.has_more = true;
this.getList();
}).catch(err=>{
uni.showToast({
title:err.message,
icon:"none",
mask:true,
duration:3000
})
})
},
methods: {
goUrl(id,index){
this.lists[index].read_at = '11111'
this.$Router.push({name:'newsDetail',params:{id:id}});
},
getList(){
list(this.type,{page:this.page}).then(res=>{
if(this.page === 1){
this.lists = []
}
this.lists = this.lists.concat(res.data)
this.has_more = res.page.has_more
}).catch(err=>{
uni.showToast({
title:err.message,
icon:"none",
mask:true,
duration:3000
})
})
}
}
}
</script>
<style lang="scss">
.list-item {
padding: $padding - 10 $padding;
display: flex;
flex-direction: row;
align-items: flex-start;
justify-content: center;
box-sizing: border-box;
border-bottom: solid 1rpx #f0f0f0;
image {
width: 100rpx;
height: 100rpx;
}
.list-item-right {
padding-left: $padding - 10;
flex: 1;
.top {
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
box-sizing: border-box;
.title {
display: flex;
flex-direction: row;
align-items: center;
justify-content: center;
box-sizing: border-box;
.titl {
font-size: 32rpx;
font-weight: bold;
}
.des {
margin-left: 10rpx;
border-radius: 6rpx;
border: solid 1rpx #F76260;
font-size: 24rpx;
font-weight: bold;
color: #F76260;
padding: 0 10rpx;
}
}
.date {
font-size: 26rpx;
color: grey;
padding-right: 10rpx;
}
}
.sub-title {
font-size: 26rpx;
color: grey;
padding-top: 10rpx;
display: -webkit-box;
overflow: hidden;
text-overflow: ellipsis;
-webkit-box-orient: vertical;
-webkit-line-clamp: 2;
}
}
}
.no-list {
height: 80vh;
display: flex;
flex-direction: row;
align-items: center;
justify-content: center;
box-sizing: border-box;
}
</style>

View File

@@ -100,7 +100,7 @@
orders({ orders({
state: this.tabs[this.index].type, state: this.tabs[this.index].type,
page: this.page page: this.page
}).then(res => { }).then(res => {
if (res.page.current === 1) { if (res.page.current === 1) {
this.array = [] this.array = []
} }
@@ -114,7 +114,8 @@
stateText: val.state, stateText: val.state,
cans: val.can, cans: val.can,
shop: val.shop, shop: val.shop,
goods_id:val.items[0].sku.goods_id goods_id:val.items[0].sku.goods_id,
unit:val.items[0].sku.unit
} }
}) })
this.array = this.array.concat(ordersArr) this.array = this.array.concat(ordersArr)
@@ -149,10 +150,8 @@
success: (res) => { success: (res) => {
if (res.confirm) { if (res.confirm) {
cancel(orderNo).then(res => { cancel(orderNo).then(res => {
console.log(res)
let orderIndex = this.array.findIndex(val => val.no === e let orderIndex = this.array.findIndex(val => val.no === e
.order.no) .order.no)
console.log(this.index, typeof this.index, orderIndex);
if (this.index == '0') { if (this.index == '0') {
this.array[orderIndex].stateText = "已取消"; this.array[orderIndex].stateText = "已取消";
this.array[orderIndex].cans = { this.array[orderIndex].cans = {
@@ -208,10 +207,8 @@
success: (res) => { success: (res) => {
if (res.confirm) { if (res.confirm) {
sign(orderNo).then(res => { sign(orderNo).then(res => {
console.log(res)
let orderIndex = this.array.findIndex(val => val.no === e let orderIndex = this.array.findIndex(val => val.no === e
.order.no) .order.no)
console.log(this.index, typeof this.index, orderIndex);
if (this.index == '0') { if (this.index == '0') {
this.array[orderIndex].stateText = "已签收"; this.array[orderIndex].stateText = "已签收";
this.array[orderIndex].cans = { this.array[orderIndex].cans = {

View File

@@ -8,7 +8,8 @@
<image :src="goodsInfo.cover" mode="aspectFill" class="good-img" /> <image :src="goodsInfo.cover" mode="aspectFill" class="good-img" />
<view class="item--content"> <view class="item--content">
<view class="title">{{goodsInfo.goods_name}}</view> <view class="title">{{goodsInfo.goods_name}}</view>
<view class="sub_title" v-if="goodsInfo.shop">{{goodsInfo.shop.name}}</view> <view class="sub_title" v-if="goodsInfo.shop">{{goodsInfo.shop.name}}</view>
<view class="unit" v-if="goodsInfo.unit"> {{goodsInfo.unit}} </view>
<view class="price">{{goodsInfo.price || '0'}} <view class="price">{{goodsInfo.price || '0'}}
<view class="price-type"> <view class="price-type">
<text> DT积分</text> <text> DT积分</text>
@@ -22,7 +23,7 @@
<view class="sales-item" @click="goSales('refund')"> <view class="sales-item" @click="goSales('refund')">
<view class="sales-item-left"> <view class="sales-item-left">
<image class="icon" <image class="icon"
src="http://storage.zh.shangkelian.cn/images/2022/01/11/9093c59ea5d513008926ac4233c20992.png" src="/static/icon/icon-back.png"
mode="aspectFill" /> mode="aspectFill" />
<view class="sales-title">退货</view> <view class="sales-title">退货</view>
</view> </view>
@@ -38,7 +39,7 @@
<view class="sales-item" @click="goSales('exchange')"> <view class="sales-item" @click="goSales('exchange')">
<view class="sales-item-left"> <view class="sales-item-left">
<image class="icon" <image class="icon"
src="http://storage.zh.shangkelian.cn/images/2022/01/11/9093c59ea5d513008926ac4233c20992.png" src="/static/icon/icon-exchange.png"
mode="aspectFill" /> mode="aspectFill" />
<view class="sales-title">换货</view> <view class="sales-title">换货</view>
</view> </view>
@@ -182,6 +183,11 @@
font-size: 26rpx; font-size: 26rpx;
padding-top: 6rpx; padding-top: 6rpx;
// @extend .ellipsis-1; // @extend .ellipsis-1;
}
&>.unit{
color:#999;
font-size: 26rpx;
padding-top: 10rpx;
} }
&>.price { &>.price {
@@ -248,8 +254,8 @@
font-weight: bold; font-weight: bold;
.icon { .icon {
width: 60rpx; width: 46rpx;
height: 60rpx; height: 46rpx;
border-radius: 50%; border-radius: 50%;
margin-right: $margin - 10; margin-right: $margin - 10;
} }

View File

@@ -16,7 +16,10 @@
<image :src="goodsInfo.cover" mode="aspectFill" class="good-img" /> <image :src="goodsInfo.cover" mode="aspectFill" class="good-img" />
<view class="item--content"> <view class="item--content">
<view class="title">{{goodsInfo.goods_name}}</view> <view class="title">{{goodsInfo.goods_name}}</view>
<view class="sub_title" v-if="goodsInfo.shop">{{goodsInfo.shop.name}}</view> <view class="sub_title" v-if="goodsInfo.shop">{{goodsInfo.shop.name}}</view>
<view class="unit" v-if="goodsInfo.unit">
{{goodsInfo.unit}}
</view>
<view class=" number"> <view class=" number">
{{goodsInfo.qty}} {{goodsInfo.qty}}
</view> </view>
@@ -318,6 +321,11 @@
font-size: 26rpx; font-size: 26rpx;
padding-top: 6rpx; padding-top: 6rpx;
// @extend .ellipsis-1; // @extend .ellipsis-1;
}
.unit{
color:#999;
font-size: 26rpx;
padding-top: 10rpx;
} }
&>.price { &>.price {

View File

@@ -23,7 +23,13 @@
<view class="order--flex" @click="$Router.push({ name: 'StoreGoods', params: {id: item.items[0].goods_id}})"> <view class="order--flex" @click="$Router.push({ name: 'StoreGoods', params: {id: item.items[0].goods_id}})">
<image class="order--cover" :src="item.items[0].cover" mode="aspectFill"></image> <image class="order--cover" :src="item.items[0].cover" mode="aspectFill"></image>
<view class="order--title">{{item.items[0].goods_name}}</view> <view class="order--title">
{{item.items[0].goods_name}}
<view class="unit" v-if="item.items[0].sku.unit">
{{item.items[0].sku.unit}}
</view>
</view>
<view class="order--count"> <view class="order--count">
<view class="order--price">{{item.items[0].price}}<text>DT积分</text></view> <view class="order--price">{{item.items[0].price}}<text>DT积分</text></view>
<view class="order--sum">{{item.items[0].qty}}</view> <view class="order--sum">{{item.items[0].qty}}</view>
@@ -85,7 +91,7 @@
getOrder() { getOrder() {
refunds({ refunds({
page: this.page page: this.page
}).then(res => { }).then(res => {
if (res.page.current === 1) { if (res.page.current === 1) {
this.array = [] this.array = []
} }
@@ -234,6 +240,11 @@
padding-left: $margin; padding-left: $margin;
font-size: 28rpx; font-size: 28rpx;
line-height: 40rpx; line-height: 40rpx;
}
.unit{
color:#999;
font-size: 26rpx;
padding-top: 10rpx;
} }
.order--count { .order--count {

View File

@@ -5,21 +5,24 @@
<view class="item--content"> <view class="item--content">
<view class="title">{{goodsInfo.goods_name}}</view> <view class="title">{{goodsInfo.goods_name}}</view>
<view class="sub_title" v-if="goodsInfo.shop">{{goodsInfo.shop.name}}</view> <view class="sub_title" v-if="goodsInfo.shop">{{goodsInfo.shop.name}}</view>
<view class="unit" v-if="goodsInfo.unit">
{{goodsInfo.unit}}
</view>
<view class=" number"> <view class=" number">
{{goodsInfo.qty}} {{goodsInfo.qty}}
</view> </view>
</view> </view>
</view> </view>
<view class="total"> <view class="total">
<view class="total-item grey"> <view class="total-item grey">
申请金额<text>{{refund_total || '0.00'}} DT</text> 申请金额<text>{{refund_total || '0.00'}} DT</text>
</view> </view>
<view class="total-item"> <view class="total-item">
合计退款<text>{{refund_total|| '0.00'}} DT</text> 合计退款<text>{{refund_total|| '0.00'}} DT</text>
</view> </view>
</view> </view>
<view class="logistics--logs"> <view class="logistics--logs">
<block v-for="(log, logIndex) in logs" :key="logIndex"> <block v-for="(log, logIndex) in logs" :key="logIndex">
<view class="item"> <view class="item">
@@ -39,14 +42,14 @@
data() { data() {
return { return {
logs: [], logs: [],
goodsInfo: {}, goodsInfo: {},
refund_total:'' refund_total: ''
} }
}, },
onLoad() { onLoad() {
refundsLogs(this.$Route.query.id).then(res => { refundsLogs(this.$Route.query.id).then(res => {
this.logs = res.logs this.logs = res.logs
this.goodsInfo = res.refund.items[0] this.goodsInfo = res.refund.items[0]
this.refund_total = res.refund.refund_total this.refund_total = res.refund.refund_total
}).catch(err => { }).catch(err => {
uni.showToast({ uni.showToast({
@@ -76,8 +79,8 @@
$radius: 10rpx; $radius: 10rpx;
.RefundHistory { .RefundHistory {
padding: $padding; padding: $padding;
min-height: 100vh; min-height: 100vh;
background-color: #f9f9f9; background-color: #f9f9f9;
} }
@@ -124,8 +127,8 @@
border-radius: $radius $radius 0 0; border-radius: $radius $radius 0 0;
z-index: 9; z-index: 9;
padding: $margin; padding: $margin;
overflow: hidden; overflow: hidden;
margin-top: 30rpx; margin-top: 30rpx;
min-height: 50vh; min-height: 50vh;
.item { .item {
@@ -214,6 +217,12 @@
// @extend .ellipsis-1; // @extend .ellipsis-1;
} }
.unit {
color: #999;
font-size: 26rpx;
padding-top: 10rpx;
}
&>.price { &>.price {
padding-top: 10rpx; padding-top: 10rpx;
display: flex; display: flex;
@@ -250,31 +259,31 @@
} }
} }
} }
.total { .total {
background-color: #fff; background-color: #fff;
padding: 0 $padding $padding $padding; padding: 0 $padding $padding $padding;
border-top: solid 2rpx #f9f9f9; border-top: solid 2rpx #f9f9f9;
font-size: 28rpx; font-size: 28rpx;
color: #333; color: #333;
.total-item { .total-item {
flex: 1; flex: 1;
display: flex; display: flex;
flex-direction: row; flex-direction: row;
align-items: center; align-items: center;
justify-content: space-between; justify-content: space-between;
box-sizing: border-box; box-sizing: border-box;
padding-top: $padding; padding-top: $padding;
text { text {
font-size: 32rpx; font-size: 32rpx;
} }
} }
.grey { .grey {
color: #666; color: #666;
} }
} }
</style> </style>

View File

@@ -10,6 +10,9 @@
<view class="item--content"> <view class="item--content">
<view class="title">{{goodsInfo.goods_name}}</view> <view class="title">{{goodsInfo.goods_name}}</view>
<view class="sub_title" v-if="goodsInfo.shop">{{goodsInfo.shop.name}}</view> <view class="sub_title" v-if="goodsInfo.shop">{{goodsInfo.shop.name}}</view>
<view class="unit" v-if="goodsInfo.unit">
{{goodsInfo.unit}}
</view>
<view class="price">{{goodsInfo.price || '0'}} <view class="price">{{goodsInfo.price || '0'}}
<view class="price-type"> <view class="price-type">
<text> DT积分</text> <text> DT积分</text>
@@ -22,7 +25,7 @@
<view class="block info-box"> <view class="block info-box">
<view class="info-item"> <view class="info-item">
<view class="label">申请类型</view> <view class="label">申请类型</view>
<view class="nowrap info-item-title" >我要退款无需退货</view> <view class="nowrap info-item-title">我要退款无需退货</view>
</view> </view>
<view class="info-item"> <view class="info-item">
<view class="label">申请原因</view> <view class="label">申请原因</view>
@@ -82,8 +85,8 @@
params = { params = {
title: this.ttext, title: this.ttext,
remark: this.remark, remark: this.remark,
pictures: [], pictures: [],
type:1, type: 1,
}; };
if (this.ttext === '请选择申请原因') { if (this.ttext === '请选择申请原因') {
uni.showToast({ uni.showToast({
@@ -179,6 +182,7 @@
} }
} }
} }
.goods-item { .goods-item {
background-color: #Fff; background-color: #Fff;
width: 100%; width: 100%;
@@ -219,6 +223,12 @@
// @extend .ellipsis-1; // @extend .ellipsis-1;
} }
&>.unit {
color: #999;
font-size: 26rpx;
padding-top: 10rpx;
}
&>.price { &>.price {
padding-top: 10rpx; padding-top: 10rpx;
display: flex; display: flex;

View File

@@ -8,7 +8,10 @@
<image :src="goodsInfo.cover" mode="aspectFill" class="good-img" /> <image :src="goodsInfo.cover" mode="aspectFill" class="good-img" />
<view class="item--content"> <view class="item--content">
<view class="title">{{goodsInfo.goods_name}}</view> <view class="title">{{goodsInfo.goods_name}}</view>
<view class="sub_title" v-if="goodsInfo.shop">{{goodsInfo.shop.name}}</view> <view class="sub_title" v-if="goodsInfo.shop">{{goodsInfo.shop.name}}</view>
<view class="unit" v-if="goodsInfo.unit">
{{goodsInfo.unit}}
</view>
<view class="price">{{goodsInfo.price || '0'}} <view class="price">{{goodsInfo.price || '0'}}
<view class="price-type"> <view class="price-type">
<text> DT积分</text> <text> DT积分</text>
@@ -242,6 +245,11 @@
font-size: 26rpx; font-size: 26rpx;
padding-top: 6rpx; padding-top: 6rpx;
// @extend .ellipsis-1; // @extend .ellipsis-1;
}
&>.unit{
color:#999;
font-size: 26rpx;
padding-top: 10rpx;
} }
&>.price { &>.price {

View File

@@ -63,7 +63,7 @@
export default { export default {
data() { data() {
return { return {
qty : 1, qty : 0,
goodsInfo : [], goodsInfo : [],
total : 0, total : 0,
freight : 0, freight : 0,
@@ -74,6 +74,7 @@
}, },
onShow(){ onShow(){
if(JSON.stringify(this.$store.getters.getAddress) !== '{}') this.address = this.$store.getters.getAddress if(JSON.stringify(this.$store.getters.getAddress) !== '{}') this.address = this.$store.getters.getAddress
this.qty= this.$Route.query.qty;
}, },
mounted() { mounted() {
this.getBuy() this.getBuy()

View File

@@ -1,322 +1,614 @@
<template> <template>
<view> <view>
<!-- 产品封面 --> <!-- 产品封面 -->
<view class="goods-swiper"> <view class="goods-swiper">
<swiper :indicator-dots="false" @change="current = $event.detail.current + 1"> <swiper :indicator-dots="false" @change="current = $event.detail.current + 1">
<swiper-item v-for="(item, index) in goods.pictures" :key="index"> <swiper-item v-for="(item, index) in goods.pictures" :key="index">
<view class="swiper-cover"> <view class="swiper-cover">
<image :src="item" mode="aspectFill" /> <image :src="item" mode="aspectFill" />
</view> </view>
</swiper-item> </swiper-item>
</swiper> </swiper>
<view class="swiper-pages"> <view class="swiper-pages">
{{current}}/{{goods.pictures.length}} {{current}}/{{goods.pictures.length}}
</view> </view>
</view> </view>
<!-- 详情 --> <!-- 详情 -->
<view class="main"> <view class="main">
<view class="title">{{goods.name}}</view> <view class="title">{{goods.name}}</view>
<view class="sub-title">{{goods.description}}</view> <view class="sub-title">{{goods.description}}</view>
<view class="box-flex"> <view class="box-flex">
<view class="price"> <view class="price">
{{goods.price.show}}<text>DT积分</text> {{goods.price.show}}<text>DT积分</text>
</view> </view>
<view class="sales" v-if="goods.skus">库存量{{goods.skus[0].stock}}</view> <view class="sales" v-if="goods.skus">库存量{{goods.skus[0].stock}}</view>
</view> </view>
<view class="unit" v-if="goods.skus && goods.skus[0].unit !== ''"> <view class="unit" v-if="goods.skus && goods.skus[0].unit !== ''" @click="open()">
规格 : {{goods.skus[0].unit_text}} <span> 规格 : {{selectSkusValues.unit_text}}</span>
</view> <uni-icons type="right" color="#cacaca" />
</view>
<!-- 店铺信息 -->
<view class="shopInfo" @click="toShop(goods.shop.shop_id)" v-if="goods.shop"> <!-- 店铺信息 -->
<view class="shopInfo-title-left"> <view class="shopInfo" @click="toShop(goods.shop.shop_id)" v-if="goods.shop">
<image class="shop-logo" :src="goods.shop.cover" mode="aspectFill" /> <view class="shopInfo-title-left">
<view class="shop-title"> <image class="shop-logo" :src="goods.shop.cover" mode="aspectFill" />
<view class="shop-titl" >{{goods.shop.name}}</view> <view class="shop-title">
<view> 店铺评分:<span class='no'>5.0</span> <text style="padding-left: 20rpx;">服务态度:<span class='no'>5.0</span></text> </view> <view class="shop-titl">{{goods.shop.name}}</view>
</view> <view> 店铺评分:
</view> <span class='no'>5.0</span>
<view class="shopInfo-title-right" >全部商品 {{goods.shop.goods_count || 0}} <uni-icons type="right" color="grey"/></view> <text style="padding-left: 20rpx;">
</view> 服务态度:
<span class='no'>5.0</span>
<view class="imgs"> </text>
<block v-for="(item, index) in goods.content" :key="index"> </view>
<image :src="item" mode="widthFix"></image> </view>
</block> </view>
</view> <view class="shopInfo-title-right">全部商品 {{goods.shop.goods_count || 0}}
</view> <uni-icons type="right" color="grey" />
<!-- 立即购买 --> </view>
<view class="footer"> </view>
<view @click="toShop(goods.shop.shop_id)" class=" shop"><uni-icons type="shop" size="26" color="grey"/>店铺</view>
<button type="default" hover-class="none" @click="buy">立即购买</button> <view class="imgs">
</view> <block v-for="(item, index) in goods.content" :key="index">
</view> <image :src="item" mode="widthFix"></image>
</template> </block>
</view>
<script> </view>
import { goods } from '@/apis/interfaces/store' <!-- 立即购买 -->
import userAuth from '@/public/userAuth' <view class="footer">
export default { <view @click="toShop(goods.shop.shop_id)" class=" shop">
data() { <uni-icons type="shop" size="26" color="grey" />店铺
return { </view>
current: 1, <button type="default" hover-class="none" @click="buy">立即购买</button>
goods : { </view>
pictures : [],
name : "", <!-- 多规格弹窗 -->
description : "", <u-popup :show="skuShow" :round="10" mode="bottom" @close="close" @open="open">
content : [], <scroll-view class="skuView" scroll-y="true">
price : { <view class="goods-info">
show: 0 <image class="goods-cover" :src="selectSkusValues.cover" mode="aspectFill" />
} <view class="baseInfo">
} <view class="money"> {{selectSkusValues.price}}<span>DT积分</span> </view>
}; <view class="shop-name" v-if="goods.shop"> {{goods.shop.name}} </view>
}, <view class="sku-text"> 商品规格{{selectSkusValues.unit_text}} </view>
mounted() { <view class="stock" v-if="selectSkusValues.stock>0"> 剩余库存{{selectSkusValues.stock}} </view>
this.getGoods() <view class="stock" v-else> 当前商品库存不足</view>
}, </view>
methods:{ </view>
getGoods(){
goods(this.$Route.query.id).then(res => { <view class="sku" v-for="(item,index) in specs" :key="item.spec_id">
console.log(res) <view class="sku-title">{{item.name}}</view>
this.goods = res <view class="sku-list">
}) <block v-for="it in item.values" :keys='it.value_id'>
}, <view :class="['sku-item',specselect[index] == it.value_id ? 'sku-active':'']"
buy(){ @click="clickSkus(index,it.value_id)">
if(this.$store.state.token === ''){ {{it.value}}
const Auth = new userAuth() </view>
Auth.Login() </block>
return </view>
} </view>
this.$Router.push({
name: 'StoreBuy', <view class="buy-number">
params: { <view class="buy-title">数量</view>
skuId: this.goods.skus[0].sku_id <uni-number-box :min="1" :max="selectSkusValues.stock" :disabled="selectSkusValues.stock == 0"
} @change="qty = $event" />
}) </view>
},
toShop(id){ <button class="now-buy" type="default" hover-class="none" @click="buy2(selectSkusValues)">立即购买</button>
this.$Router.push({ </scroll-view>
name: 'ShopDetail', </u-popup>
params: { </view>
ShopId: id </template>
}
}) <script>
} import {
} goods
} } from '@/apis/interfaces/store'
</script> import userAuth from '@/public/userAuth'
export default {
<style lang="scss"> data() {
.goods-swiper{ return {
position: relative; current: 1,
width: 100%; goods: {
padding-top: 110%; pictures: [],
background: $window-color; name: "",
&> swiper{ description: "",
position: absolute; content: [],
top: 0; price: {
left: 0; show: 0
width: 100%; }
height: 100%; },
.swiper-cover{ skus: [],
width: 100%; skuid: '',
height: 100%; skuShow: false,
image{ specs: [],
position: absolute; unitText: '',
top: 0; specselect: [],
left: 0; selectSkusValues: {},
width: 100%; qty: 1,
height: 100%; };
} },
} mounted() {
} this.getGoods()
.swiper-pages{ },
position: absolute; methods: {
bottom:20rpx; getGoods() {
left: 0; let id = this.$Route.query.id
right: 0; // let id = 61;
z-index: 9; goods(id).then(res => {
line-height: 90rpx; this.goods = res
text-align: center; this.specs = res.specs
color: white; this.skus = res.skus
font-size: $title-size-m; this.skuid = res.skus[0].sku_id
text-shadow: 0 5rpx 5rpx rgba($color: #000000, $alpha: .02); this.unitText = res.skus[0].unit_text
} this.specselect = res.skus[0].unit.split('|')
} this.selectSkusValues = res.skus[0]
// 详情 })
.main{ },
position: relative; open() {
z-index: 9; this.skuShow = true
margin-top: -20rpx; this.qty = 1;
background: white; },
border-radius: $radius $radius 0 0; close() {
box-shadow: 0 0 10rpx 10rpx rgba($color: #000000, $alpha: .02); this.skuShow = false
padding-bottom: ($padding*2) + 90; this.qty = 1;
.hr{ // this.specselect = this.skus[0].unit.split('|')
position: relative; // this.selectSkusValues = this.skus[0]
min-height: 1rpx; },
margin: 0 $margin; clickSkus(index, id) {
text-align: center; this.skuid = ''
text{ this.specselect[index] = id;
position: relative; let newlist = []
z-index: 1; let str = ''
color: $text-gray; for (var i in this.specselect) {
font-size: $title-size-m; if (i == index) {
background: white; newlist.push(id);
padding: 0 $padding; if (i == 0) {
} str = id
&::after{ } else {
content: " "; str = str + '|' + id
background: $border-color; }
width: 100%; } else {
height: 1rpx; newlist.push(this.specselect[i])
position: absolute; if (i == 0) {
left: 0; str = this.specselect[i]
top: 50%; } else {
} str = str + '|' + this.specselect[i]
} }
.title{ }
padding: $padding;
font-weight: bold; }
font-size: $title-size + 14; for (var i in this.skus) {
} if (this.skus[i].unit === str) {
.sub-title{ this.selectSkusValues = this.skus[i];
padding: 0 $padding; break;
font-size: $title-size-m; }
color: $text-gray; }
} this.specselect = newlist
.box-flex{ },
padding: $padding;
display: flex; buy() {
justify-content: space-between; if (this.$store.state.token === '') {
align-items: center; const Auth = new userAuth()
.price{ Auth.Login()
font-weight: bold; return
color: $text-price; }
font-size: $title-size + 10; if (this.goods.type === 2) {
text{ this.open();
font-size: 60%; return
margin-left: 10rpx; }
} this.goUrl();
}
.sales{ },
font-size: $title-size-m; buy2(value) {
color: $text-gray; let {
} sku_id,
} stock
.unit{ } = value;
padding: 30rpx; if (stock > 0) {
font-size: $title-size-m; this.skuid = sku_id;
color: #333; this.goUrl()
border-top:solid 20rpx #f9f9f9; } else {
} uni.showToast({
.imgs{ title: '当前商品库存不足',
image{ icon: 'none',
vertical-align: top; mask: true,
width: 100%; duration: 2000
} })
} }
},
.shopInfo{ goUrl() {
border-top: solid $padding #f9f9f9; this.$Router.push({
name: 'StoreBuy',
params: {
skuId: this.skuid,
qty: this.qty
}
})
this.close()
},
toShop(id) {
this.$Router.push({
name: 'ShopDetail',
params: {
ShopId: id
}
})
},
}
}
</script>
<style lang="scss">
.goods-swiper {
position: relative;
width: 100%;
padding-top: 110%;
background: $window-color;
&>swiper {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
.swiper-cover {
width: 100%;
height: 100%;
image {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
}
}
}
.swiper-pages {
position: absolute;
bottom: 20rpx;
left: 0;
right: 0;
z-index: 9;
line-height: 90rpx;
text-align: center;
color: white;
font-size: $title-size-m;
text-shadow: 0 5rpx 5rpx rgba($color: #000000, $alpha: .02);
}
}
// 详情
.main {
position: relative;
z-index: 9;
margin-top: -20rpx;
background: white;
border-radius: $radius $radius 0 0;
box-shadow: 0 0 10rpx 10rpx rgba($color: #000000, $alpha: .02);
padding-bottom: ($padding*2) + 90;
.hr {
position: relative;
min-height: 1rpx;
margin: 0 $margin;
text-align: center;
text {
position: relative;
z-index: 1;
color: $text-gray;
font-size: $title-size-m;
background: white;
padding: 0 $padding;
}
&::after {
content: " ";
background: $border-color;
width: 100%;
height: 1rpx;
position: absolute;
left: 0;
top: 50%;
}
}
.title {
padding: $padding;
font-weight: bold;
font-size: $title-size + 14;
}
.sub-title {
padding: 0 $padding;
font-size: $title-size-m;
color: $text-gray;
}
.box-flex {
padding: $padding;
display: flex;
justify-content: space-between;
align-items: center;
.price {
font-weight: bold;
color: $text-price;
font-size: $title-size + 10;
text {
font-size: 60%;
margin-left: 10rpx;
}
}
.sales {
font-size: $title-size-m;
color: $text-gray;
}
}
.unit {
padding: 30rpx;
font-size: $title-size;
color: #333;
border-top: solid 20rpx #f9f9f9;
display: flex; display: flex;
flex-direction: row; flex-direction: row;
align-items: center; align-items: center;
justify-content: space-between; justify-content: space-between;
box-sizing: border-box; box-sizing: border-box;
width: 100%;
padding:$padding $padding - 10; }
border-bottom: solid 10rpx #f9f9f9;
.shopInfo-title-left{ .imgs {
width: 500rpx; image {
display: flex; vertical-align: top;
flex-direction: row; width: 100%;
align-items: center; }
justify-content: flex-start; }
box-sizing: border-box;
.shop-logo{ .shopInfo {
width: 100rpx; border-top: solid $padding #f9f9f9;
height: 100rpx; display: flex;
border-radius: 10rpx; flex-direction: row;
border:solid 1rpx #f9f9f9; align-items: center;
} justify-content: space-between;
.shop-title{ box-sizing: border-box;
display: flex; width: 100%;
flex-direction: column; padding: $padding $padding - 10;
align-items: flex-start; border-bottom: solid 10rpx #f9f9f9;
justify-content: flex-start;
box-sizing: border-box; .shopInfo-title-left {
font-size: 26rpx; width: 500rpx;
margin-left: $margin; display: flex;
color: #999; flex-direction: row;
width:370rpx; align-items: center;
.no { justify-content: flex-start;
color: $text-price; box-sizing: border-box;
padding-left: 4rpx;
} .shop-logo {
width: 100rpx;
.shop-titl{ height: 100rpx;
font-size: 34rpx; border-radius: 10rpx;
color: #333; border: solid 1rpx #f9f9f9;
font-weight: bold; }
margin-bottom: 6rpx;
overflow: hidden; .shop-title {
white-space: nowrap; display: flex;
text-overflow: ellipsis; flex-direction: column;
width: 100%; align-items: flex-start;
} justify-content: flex-start;
} box-sizing: border-box;
} font-size: 26rpx;
.shopInfo-title-right{ margin-left: $margin;
display: flex; color: #999;
flex-direction: row; width: 370rpx;
align-items: center;
justify-content: center; .no {
box-sizing: border-box; color: $text-price;
font-size: 26rpx; padding-left: 4rpx;
color: #222; }
}
.shop-titl {
} font-size: 34rpx;
color: #333;
} font-weight: bold;
// 购买 margin-bottom: 6rpx;
.footer{ overflow: hidden;
position: fixed; white-space: nowrap;
bottom: 0; text-overflow: ellipsis;
left: 0; width: 100%;
right: 0; }
padding: $padding; }
z-index: 98; }
background: white;
display: flex; .shopInfo-title-right {
flex-direction: row; display: flex;
align-items: center; flex-direction: row;
justify-content: center; align-items: center;
box-sizing: border-box; justify-content: center;
// linear-gradient(to top, white 86%, rgba(255,255,255,.0)) box-sizing: border-box;
.shop{ font-size: 26rpx;
display: flex; color: #222;
flex-direction: column; }
align-items: center;
justify-content: center; }
box-sizing: border-box;
font-size: 24rpx; }
color: $text-gray;
} // 购买
button{ .footer {
background: $main-color; position: fixed;
margin-left: 60rpx; bottom: 0;
flex: 1; left: 0;
color: white; right: 0;
border-radius: $radius-lg; padding: $padding;
height: 90rpx; z-index: 98;
line-height: 90rpx; background: white;
font-weight: bold; display: flex;
font-size: $title-size; flex-direction: row;
&::after{ align-items: center;
display: none; justify-content: center;
} box-sizing: border-box;
}
} // linear-gradient(to top, white 86%, rgba(255,255,255,.0))
.shop {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
box-sizing: border-box;
font-size: 24rpx;
color: $text-gray;
}
button {
background: $main-color;
margin-left: 60rpx;
flex: 1;
color: white;
border-radius: $radius-lg;
height: 90rpx;
line-height: 90rpx;
font-weight: bold;
font-size: $title-size;
&::after {
display: none;
}
}
}
// 规格弹窗
.skuView {
min-height: 30vh;
max-height: 60vh;
padding: $padding + 10 $padding;
color: $text-color;
box-sizing: border-box;
// 商品信息
.goods-info {
display: flex;
flex-direction: row;
align-items: center;
justify-content: center;
box-sizing: border-box;
border-bottom: solid 1rpx #f9f9f9;
padding-bottom: 20rpx;
.goods-cover {
width: 200rpx;
height: 200rpx;
border-radius: 20rpx;
}
.baseInfo {
flex: 1;
padding-left: $padding;
box-sizing: border-box;
.money {
font-size: $title-size + 14;
font-weight: bold;
color: $text-price;
display: flex;
flex-direction: row;
align-items: center;
justify-content: flex-start;
box-sizing: border-box;
span {
font-weight: normal;
font-size: $title-size-m - 4;
padding-left: 10rpx;
padding-top: 12rpx;
display: inline-block;
}
}
.shop-name {
background: linear-gradient(to right, rgba(255, 255, 255, 0), rgba($color: $text-price, $alpha: 0.5));
display: inline-block;
padding: 4rpx 20rpx 4rpx 0;
color: #71440b;
font-size: $title-size-m - 2;
}
.sku-text {
font-size: $title-size-m - 2;
padding-top: 10rpx;
color: $text-gray;
}
.stock {
font-size: $title-size-m - 2;
padding-top: 6rpx;
color: $text-gray;
}
}
}
.buy-number {
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
box-sizing: border-box;
padding: $padding + 20 0 $padding 0;
.buy-title {
font-size: 32rpx;
font-weight: bold;
}
}
// 规格
.sku {
.sku-title {
font-size: 32rpx;
font-weight: bold;
padding-top: 30rpx;
}
.sku-list {
display: flex;
flex-direction: row;
align-items: center;
justify-content: flex-start;
box-sizing: border-box;
flex-wrap: wrap;
.sku-item {
padding: 10rpx 30rpx;
border: solid 1rpx #f9f9f9;
margin-right: 20rpx;
margin-top: 20rpx;
border-radius: 40rpx;
background-color: #f9f9f9;
font-size: 30rpx;
min-width: 70rpx;
text-align: center;
}
.sku-active {
background-color: rgba($color: $main-color, $alpha: 0.2);
color: $main-color;
font-weight: bold;
}
}
}
.now-buy {
background-color: #34ce98;
color: #fff;
border: none;
margin-top: $margin;
}
}
</style> </style>

View File

@@ -1,12 +1,15 @@
<template> <template>
<view class="content"> <view class="content">
<!-- 用户信息 --> <!-- 用户信息 -->
<view class="info-box"> <view class="info-box" style="background-color: red;">
<image src="@/static/user/user_back.png" mode="aspectFill" /> <image src="@/static/user/user_back.png" mode="aspectFill" />
<view class="user-flex"> <view class="user-flex">
<view class="news" @click="onBtn('newsIndex', {})">
<u-icon class="bell_fill" name="bell-fill" color="#fff" size="28" />
<u-badge class="bell_fill_dot" :isDot="messages > 0" type="error" />
</view>
<image class="cover" @click="onBtn('Setting', {})" <image class="cover" @click="onBtn('Setting', {})"
:src="userInfo.avatar || require('@/static/user/cover.png')" mode="aspectFill" /> :src="userInfo.avatar || require('@/static/user/cover.png')" mode="aspectFill" />
<view class="user-content"> <view class="user-content">
<view class="name">{{ userInfo.nickname }}</view> <view class="name">{{ userInfo.nickname }}</view>
<view class="tabs"> <view class="tabs">
@@ -91,6 +94,17 @@
<image class="icon" src="@/static/user/userIcon_02.png" mode="widthFix" /> <image class="icon" src="@/static/user/userIcon_02.png" mode="widthFix" />
导出助记词 导出助记词
<uni-icons class="forward" type="forward" color="#999" /> <uni-icons class="forward" type="forward" color="#999" />
</view>
<view class="btns-box-item" @click="onWbt">
<image class="icon" src="@/static/user/userIcon_02.png" mode="widthFix" />
文版通账号
<uni-icons class="forward" type="forward" color="#999" />
</view>
<view class="btns-box-item" @click="resetPassword">
<image class="icon" src="@/static/user/userIcon_13.png" mode="widthFix" />
{{hasPassword ? '修改' : '设置'}}支付密码
<uni-icons class="forward" type="forward" color="#999" />
</view> </view>
<block v-if="canSeeData"> <block v-if="canSeeData">
<view class="btns-box-item" @click="onBtn('DataBoard', {})"> <view class="btns-box-item" @click="onBtn('DataBoard', {})">
@@ -116,12 +130,19 @@
供应商入驻 供应商入驻
<uni-icons class="forward" type="forward" color="#999" /> <uni-icons class="forward" type="forward" color="#999" />
</view> </view>
<view class="btns-box-item" @click="resetPassword"> </view>
<image class="icon" src="@/static/user/userIcon_13.png" mode="widthFix" /> <view class="btns-box">
{{hasPassword ? '修改' : '设置'}}支付密码 <view class="btns-box-item" @click="onShare">
<uni-icons class="forward" type="forward" color="#999" /> <image class="icon" src="@/static/user/userIcon_14.png" mode="widthFix" />
</view> 绑定分享关系
</view> <block v-if="share == null">
<uni-icons class="forward" type="forward" color="#999" />
</block>
<block v-else>
<text class="forward" style="color: gray;">{{share.nickname}}</text>
</block>
</view>
</view>
<view class="btns-box"> <view class="btns-box">
<view class="btns-box-item" @click="onBtn('Feedback', {})"> <view class="btns-box-item" @click="onBtn('Feedback', {})">
<image class="icon" src="@/static/user/userIcon_06.png" mode="widthFix" /> <image class="icon" src="@/static/user/userIcon_06.png" mode="widthFix" />
@@ -149,7 +170,7 @@
<view>The total force ecological</view> <view>The total force ecological</view>
</view> </view>
<!-- 助记词弹出框 --> <!-- 助记词弹出框 -->
<u-modal :show="wordsShow" :zoom="false" confirmText="复制" @confirm="copyWord" confirmColor="#34CE98"> <u-modal :show="wordsShow" :zoom="false" confirmText="复制" @confirm="copyWord('zjc')" confirmColor="#34CE98">
<slot default> <slot default>
<view class="wordsCont"> <view class="wordsCont">
<view class="wordsCont-title">导出助记词</view> <view class="wordsCont-title">导出助记词</view>
@@ -160,6 +181,18 @@
</view> </view>
</slot> </slot>
</u-modal> </u-modal>
<!-- 查看文版通账号 -->
<u-modal :show="wbtShow" :zoom="false" confirmText="复制" @confirm="copyWord('wbt')" confirmColor="#34CE98">
<slot default>
<view class="wordsCont">
<view class="wordsCont-title">文版通账号</view>
<view class="wordsCont-tips">请务必抄下文版通账号并存在安全的地方若文版通账号丢失重装或换设备登录时将无法查看历史消息若文版通账号被他人获取将可能获取你的信息</view>
<view class="wordsCont-text">账号{{wbtAccount}}</view>
<image class="wordsCont-close" @click="wordsShow = false;wbtShow= false;" src="@/static/icon/userCloes.png"
mode="widthFix"></image>
</view>
</slot>
</u-modal>
<!-- 输入支付密码 --> <!-- 输入支付密码 -->
<u-modal :show="showIv" title="请输入钱包支付密码" :showCancelButton="true" confirmColor="#34CE98" negativeTop="160" <u-modal :show="showIv" title="请输入钱包支付密码" :showCancelButton="true" confirmColor="#34CE98" negativeTop="160"
@confirm="validationIv" @cancel="()=>{ this.showIv = false, this.iv = '' }"> @confirm="validationIv" @cancel="()=>{ this.showIv = false, this.iv = '' }">
@@ -169,21 +202,46 @@
placeholder="输入支付密码" /> placeholder="输入支付密码" />
</view> </view>
</slot> </slot>
</u-modal> </u-modal>
<!-- 绑定分享关系 -->
<u-modal
:show="showBind"
confirmColor="#34CE98"
:showCancelButton="true"
:confirmText="isInvitation ? '校验邀请码': '绑定关系'"
@cancel="()=> {
this.showBind = false
this.isInvitation = true
this.invitation = ''
}"
@confirm="onBind"
>
<slot>
<view class="bind-view" v-if="isInvitation">
<view class="bind-title">邀请码</view>
<view class="bind-subtitle">请输入好友的邀请码</view>
<view class="bind-input">
<input type="text" v-model="invitation" placeholder="输入邀请码">
</view>
</view>
<view class="bind-user" v-else>
<view class="bind-title">邀请用户</view>
<view class="bind-subtitle">请确认绑定关系用户信息</view>
<view class="bind-acitve">
<image :src="invitationUser.avatar" mode="aspectFill"></image>
</view>
<view class="bind-nickname">{{invitationUser.nickname}}</view>
<view class="bind-username">{{invitationUser.username}}</view>
</view>
</slot>
</u-modal>
</view> </view>
</template> </template>
<script> <script>
import { import { info, chainSeed, relationsBind, relationsVerify } from '@/apis/interfaces/user';
info, import { payPassword } from '@/apis/interfaces/account.js'
chainSeed import { getVersions } from '@/apis/interfaces/versions.js'
} from '@/apis/interfaces/user';
import {
payPassword
} from '@/apis/interfaces/account.js'
import {
getVersions
} from '@/apis/interfaces/versions.js'
export default { export default {
data() { data() {
return { return {
@@ -219,42 +277,117 @@
isWallet: false, isWallet: false,
walletNum: 0, walletNum: 0,
// 数据看板权限 // 数据看板权限
canSeeData: false canSeeData: false,
messages:0,
wbtAccount:'',
wbtShow:false,
// 绑定关系
share : null,
showBind : false,
invitation : '',
isInvitation : true,
invitationUser : {}
}; };
}, },
onShow() { onShow() {
// if(uni.getStorageSync('isWalleNum') != '' && uni.getStorageSync('isWalleNum') === 1) this.isWallet = true // if(uni.getStorageSync('isWalleNum') != '' && uni.getStorageSync('isWalleNum') === 1) this.isWallet = true
this.getInfo(); this.getInfo();
}, },
methods: { methods: {
onWbt(){
if(this.wbtAccount === ''){
uni.showModal({
title:'温馨提示',
content:'当前账号没有绑定文版通账号,是否现在就去绑定',
confirmText:'立即绑定',
cancelText:'先不绑定',
success:(res) => {
if(res.confirm){
this.$Router.push({name:'WbtBind'})
}
}
})
}else{
this.wbtShow = true;
}
},
// 绑定分享关系
onShare(){
if(this.share != null){
return
}
this.showBind = true
},
// 绑定邀请码
onBind(){
// 检验邀请码
if(this.isInvitation){
if(this.invitation === ''){
uni.showToast({
title: '请输入邀请码',
icon : 'none'
})
return
}
relationsVerify(this.invitation).then(res => {
this.invitationUser = res
this.isInvitation = false
}).catch(err => {
uni.showToast({
title: err.message,
icon : 'none'
})
})
return
}
// 绑定关系
relationsBind(this.invitation).then(res => {
this.showBind = false
uni.showModal({
title : '提示',
content : '关系绑定成功',
showCancel : false,
success : res => {
this.getInfo()
}
})
}).catch(err => {
uni.showToast({
title: err.message,
icon : 'none'
})
})
},
// 用户信息 // 用户信息
getInfo() { getInfo() {
if (this.$store.state.token === '') return; if (this.$store.state.token === '') return;
info().then(res => { info().then(res => {
uni.setNavigationBarTitle({ uni.setNavigationBarTitle({
title: res.nickname title: res.nickname
}); });
this.canSeeData = res.can_see_data this.share = String(res.share) == '' ? null : res.share
this.order = res.order this.canSeeData = res.can_see_data
this.cardText = res.identity_array this.order = res.order
this.userInfo = { this.cardText = res.identity_array
nickname: res.nickname, this.userInfo = {
addr: res.addr, nickname: res.nickname,
avatar: res.avatar, addr: res.addr,
isOpenVip: res.is_open_vip, avatar: res.avatar,
username: res.username isOpenVip: res.is_open_vip,
} username: res.username
this.identity = res.identity }
this.account = res.account this.identity = res.identity;
this.serial = res.serial this.account = res.account;
this.hasPassword = res.has_transfer_password this.serial = res.serial;
}) this.hasPassword = res.has_transfer_password;
.catch(err => { this.messages = Number(res.messages);
uni.showToast({ this.wbtAccount = res.wbt_account;
title: err.message, }).catch(err => {
icon: 'none' uni.showToast({
}); title: err.message,
}); icon: 'none'
});
});
}, },
// 导出助记词 // 导出助记词
onMnemonic() { onMnemonic() {
@@ -312,7 +445,7 @@
}) })
}, },
// 按钮导航 // 按钮导航
onBtn(name, params) { onBtn(name, params) {
this.$Router.push({ this.$Router.push({
name, name,
params params
@@ -361,13 +494,14 @@
} }
}, },
// 复制助记词 // 复制助记词
copyWord() { copyWord(type) {
uni.setClipboardData({ uni.setClipboardData({
data: this.mnemonic, data: type === 'zjc'?this.mnemonic:this.wbtAccount,
success: () => { success: () => {
this.wordsShow = false this.wordsShow = false
this.wbtShow = false
uni.showToast({ uni.showToast({
title: '助记词已复制', title: type === 'zjc' ? '助记词已复制' : '文版通账号已复制',
icon: 'none', icon: 'none',
mask: true mask: true
}) })
@@ -453,8 +587,82 @@
.content { .content {
background: $window-color; background: $window-color;
min-height: 100vh; min-height: 100vh;
} }
// 邀请码
.bind-view{
padding: 15rpx 30rpx;
width: 100%;
box-sizing: border-box;
.bind-title{
text-align: center;
font-size: 36rpx;
font-weight: bold;
}
.bind-subtitle{
line-height: 40rpx;
font-size: 28rpx;
color: gray;
padding-top: 15rpx;
text-align: center;
}
.bind-input{
padding-top: 30rpx;
input{
background: #f8f8f8;
width: 100%;
height: 80rpx;
padding: 0 30rpx;
border-radius: 40rpx;
text-align: center;
box-sizing: border-box;
font-size: 32rpx;
font-weight: bold;
}
}
}
// 确认绑定用户关系
.bind-user{
padding: 15rpx 30rpx;
width: 100%;
box-sizing: border-box;
.bind-title{
text-align: center;
font-size: 36rpx;
font-weight: bold;
}
.bind-subtitle{
line-height: 40rpx;
font-size: 28rpx;
color: gray;
padding-top: 15rpx;
text-align: center;
}
.bind-acitve{
text-align: center;
padding-top: 30rpx;
image{
width: 108rpx;
height: 108rpx;
background: #f8f8f8;
border-radius: 50%;
}
}
.bind-nickname{
text-align: center;
font-size: 32rpx;
color: #333;
font-weight: bold;
line-height: 40rpx;
padding-top: 20rpx;
}
.bind-username{
text-align: center;
font-weight: bold;
font-size: 28rpx;
color: gray;
}
}
// 版权信息 // 版权信息
.footer-text { .footer-text {
text-align: center; text-align: center;
@@ -476,13 +684,29 @@
right: 0; right: 0;
width: 100%; width: 100%;
height: 100%; height: 100%;
// z-index: 100;
} }
.user-flex { .user-flex {
position: relative; position: relative;
padding: $padding * 2 $padding ($padding * 2 + 60); padding: $padding * 2 $padding ($padding * 2 + 60);
height: 128rpx; height: 128rpx;
.news{
top: -30rpx;
right: -30rpx;
position: relative;
.bell_fill_dot{
position: absolute;
top: 24rpx;
right: 46rpx;
z-index: 1000;
}
.bell_fill{
position: absolute;
right: 50rpx;
top: 30rpx;
z-index: 10000000;
}
}
.cover { .cover {
position: absolute; position: absolute;

BIN
static/icon/pay_alipay.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.3 KiB

BIN
static/icon/pay_wbt.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

BIN
static/icon/pay_wechat.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

BIN
static/news/news.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.2 KiB

BIN
static/user/userIcon_14.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.1 KiB

View File

@@ -19,10 +19,13 @@
</view> </view>
<view class="order--flex" @click="$emit('onBtn', {type: 'goodsDetail', order: orderInfo})"> <view class="order--flex" @click="$emit('onBtn', {type: 'goodsDetail', order: orderInfo})">
<image class="order--cover" :src="orderInfo.cover" mode="aspectFill"></image> <image class="order--cover" :src="orderInfo.cover" mode="aspectFill"></image>
<view class="order--title">{{orderInfo.name}}</view> <view class="order--title">
{{orderInfo.name}}
<view class="unit"> {{orderInfo.unit}} </view>
</view>
<view class="order--count"> <view class="order--count">
<view class="order--price">{{orderInfo.price}}<text>DT积分</text></view> <view class="order--price">{{orderInfo.price}}<text>DT积分</text></view>
<view class="order--sum">{{orderInfo.sum}}</view> <view class="order--sum">{{orderInfo.sum}} </view>
</view> </view>
</view> </view>
</block> </block>
@@ -172,6 +175,16 @@
padding-left: $margin; padding-left: $margin;
font-size: 28rpx; font-size: 28rpx;
line-height: 40rpx; line-height: 40rpx;
display: flex;
flex-direction: column;
align-items: flex-start;
justify-content: center;
box-sizing: border-box;
.unit{
color: #999;
font-size: 26rpx;
padding-top: 10rpx;
}
} }
.order--count{ .order--count{
text-align: right; text-align: right;

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long