Browse Source

feat: 接口对接;

pull/1/head
Fox-33 2 months ago
parent
commit
a60e2911cc
21 changed files with 468 additions and 242 deletions
  1. +18
    -0
      api/model/info.js
  2. +20
    -0
      api/model/vip.js
  3. +21
    -12
      components/center/popupActivate.vue
  4. +120
    -0
      components/config/loginPopup.vue
  5. +1
    -1
      config.js
  6. +22
    -26
      pages/index/center.vue
  7. +20
    -1
      pages/index/index.vue
  8. +1
    -0
      pages/index/record.vue
  9. +5
    -1
      pages_order/mine/sharing.vue
  10. +36
    -100
      pages_order/mine/team.vue
  11. +23
    -54
      pages_order/mine/wallet.vue
  12. +29
    -16
      pages_order/mine/withdraw.vue
  13. +1
    -1
      pages_order/record/articleSharing.vue
  14. +1
    -1
      pages_order/record/groupSharing.vue
  15. +1
    -1
      pages_order/record/personalSharing.vue
  16. +5
    -1
      pages_order/record/videoSharing.vue
  17. +30
    -4
      pages_order/sharing/article.vue
  18. +29
    -6
      pages_order/sharing/group.vue
  19. +30
    -7
      pages_order/sharing/personal.vue
  20. +33
    -7
      pages_order/sharing/video.vue
  21. +22
    -3
      store/store.js

+ 18
- 0
api/model/info.js View File

@ -9,6 +9,24 @@ const api = {
method: 'GET',
auth: true,
},
/**
* 获取我的钱包数据信息-钱包流水列表
*/
getWalletList: {
url: '/info/getWalletList',
method: 'GET',
auth: true,
},
/**
* 提现
*/
openMoney: {
url: '/fen/openMoney',
method: 'POST',
auth: true,
limit : 500,
showLoading : true,
},
}
export default api

+ 20
- 0
api/model/vip.js View File

@ -2,6 +2,26 @@
// vip相关接口
const api = {
getUserInfoVip: {
url: '/info/getUserInfoVip',
method: 'GET',
auth: true,
},
getUserInfoVipList: {
url: '/info/getUserInfoVipList',
method: 'GET',
auth: true,
},
/**
* 激活
*/
openVip: {
url: '/fen/openVip',
method: 'POST',
auth: true,
limit : 500,
showLoading : true,
},
}
export default api

+ 21
- 12
components/center/popupActivate.vue View File

@ -20,7 +20,7 @@
</view>
<uv-input
v-model="activateCode"
v-model="code"
:focus="true"
inputAlign="center"
color="#3DFEE0"
@ -37,8 +37,8 @@
></uv-input>
</template>
<template v-else>
<!-- todo: 切换切图 "你还不是代理商" -->
<image class="popup-bg" src="@/pages_order/static/center/activate-code.png"></image>
<!-- todo: 切图 "你还不是代理商" -->
<image class="popup-bg" src=""></image>
<view class="flex popup-btns">
<button plain class="btn-simple" @click="close">
<image class="popup-btn" src="@/pages_order/static/center/cancel.png"></image>
@ -55,31 +55,40 @@
<script>
export default {
props: {
isAgent: {
type: String,
role: {
default: null
}
},
data() {
return {
mode: '',
activateCode: '',
code: '',
}
},
methods: {
open(isAgent) {
this.mode = isAgent ? 'activate' : ''
open(role) {
this.mode = role ? 'activate' : ''
this.$refs.popup.open();
},
close() {
this.$refs.popup.close();
},
onConfirm() {
// todo
async onConfirm() {
try {
await this.$fetch('openVip', { code: this.code })
uni.showToast({
title: '激活成功',
icon: 'none'
})
this.close()
} catch (err) {
// submit activateCode and update userInfo
}
this.close()
}
},
}


+ 120
- 0
components/config/loginPopup.vue View File

@ -0,0 +1,120 @@
<template>
<uv-popup ref="loginPopup"
mode="center"
:round="20"
:closeable="false"
:maskClick="false"
:closeOnClickOverlay="false"
:customStyle="{backgroundColor: '#fff', padding: 0}"
overlayOpacity="0.8">
<view class="login-card">
<view class="login-title">登录后即可查看分享内容</view>
<view class="login-content">
<button class="login-btn" @click="handleLogin">
微信一键登录
</button>
</view>
</view>
</uv-popup>
</template>
<script>
export default {
data(){
return {
}
},
methods: {
open(){
this.$refs.loginPopup.open()
},
close(){
this.$refs.loginPopup.close()
},
//
handleLogin() {
uni.showLoading({
title: '登录中...'
})
uni.login({
success : (res) => {
if (res.errMsg != "login:ok") {
return
}
let data = {
code: res.code,
}
if (uni.getStorageSync('shareId')) {
data.shareId = uni.getStorageSync('shareId')
}
if (uni.getStorageSync('state')) {
data.state = uni.getStorageSync('state')
}
this.$api('wxLogin', data, res => {
uni.hideLoading()
if (res.code != 200) {
this.close()
return
}
uni.setStorageSync('token', res.result.token)
this.$store.commit('getUserInfo')
this.close()
this.$emit('login')
})
}
})
},
}
}
</script>
<style lang="scss" scoped>
.login-card {
width: 600rpx;
padding: 40rpx;
text-align: center;
.login-title {
font-size: 32rpx;
font-weight: bold;
color: #333;
margin-bottom: 40rpx;
}
.login-content {
.login-image {
width: 300rpx;
height: 300rpx;
margin-bottom: 40rpx;
}
.login-btn {
display: flex;
align-items: center;
justify-content: center;
margin: 0 auto;
width: 80%;
height: 88rpx;
background: #07C160;
color: #fff;
border-radius: 44rpx;
font-size: 32rpx;
.wechat-icon {
width: 48rpx;
height: 48rpx;
margin-right: 10rpx;
}
}
}
}
</style>

+ 1
- 1
config.js View File

@ -8,7 +8,7 @@ import uvUI from '@/uni_modules/uv-ui-tools'
Vue.use(uvUI);
// 当前环境
const type = 'dev'
const type = 'prod'
// 环境配置


+ 22
- 26
pages/index/center.vue View File

@ -16,8 +16,7 @@
<text class="tag-label">ID:</text>
<text>{{ userInfo.id }}</text>
</view>
<!-- todo -->
<view v-if="isAgent" style="display: inline-block; width: 172rpx; height: 63rpx; vertical-align: top; margin-top: -6rpx;">
<view v-if="role" style="display: inline-block; width: 172rpx; height: 63rpx; vertical-align: top; margin-top: -6rpx;">
<image src="@/pages_order/static/center/agent-icon.png"></image>
</view>
<view v-else class="tag">
@ -33,11 +32,11 @@
<view class="tools-box">
<image class="tools-bg" src="@/pages_order/static/center/tools-bg.png"></image>
<view class="flex activate">
<template v-if="isAgent">
<template v-if="role">
<view class="activate-tips" style="padding-left: 27rpx;">
<view>代理商权益</view>
<view>
将于<text class="activate-highlight">{{ agentDeadline }}</text>到期
将于<text class="activate-highlight">{{ $dayjs(userInfoVip.vip_time).format('YYYY年M月D日') () }}</text>到期
</view>
</view>
<view class="btn-activate" @click="onActivate">
@ -54,7 +53,6 @@
</template>
</view>
<view class="tools flex">
<!-- todo -->
<view class="tool" @click="$utils.navigateTo('/pages_order/mine/sharing')">
<view class="tool-icon">
<image src="@/pages_order/static/center/tool-share.png"></image>
@ -75,7 +73,6 @@
</view>
<text>我的钱包</text>
</view>
<!-- todo -->
<view class="tool" @click="$utils.navigateTo('/pages_order/mine/team')">
<view class="tool-icon">
<image src="@/pages_order/static/center/tool-team.png"></image>
@ -129,9 +126,9 @@
</view>
</view>
<view class="service" @click="$utils.navigateTo('/pages_order/mine/service')">
<image src="@/pages_order/static/center/service.png" mode=""></image>
</view>
<button plain class="btn-simple service" open-type="contact">
<image class="icon" src="@/pages_order/static/center/service.png" mode=""></image>
</button>
<popupActivate ref="popupActivate"></popupActivate>
<popupSharing ref="popupSharing"></popupSharing>
@ -153,38 +150,34 @@
tabber,
popupActivate,
},
computed: {
...mapState(['userInfo']),
},
data() {
return {
// todo: agent => role
isAgent: false,
agentDeadline: '2025年12月31日',
notice: '',
mixinsListApi : 'getNews',
}
},
computed: {
...mapState(['userInfo', 'userInfoVip']),
role() {
return this.userInfo.role
}
},
onShow() {
this.fetchNotice()
this.getData()
},
onLoad() {
if (uni.getStorageSync('token') && !this.userInfo?.id) {
this.$store.commit('getUserInfo')
}
this.$store.commit('getUserInfo')
this.$store.commit('getUserInfoVip')
},
methods: {
async fetchNotice() {
try {
this.notice = await this.$fetch('getNotice', { id })
// todo: check
this.notice = (await this.$fetch('getNotice'))?.[0]?.title
} catch (err) {
}
},
onActivate() {
this.$refs.popupActivate.open(this.isAgent)
this.$refs.popupActivate.open(this.role)
},
getDesc(str) {
if (!str) {
@ -389,8 +382,11 @@
position: fixed;
right: 29rpx;
bottom: 312rpx;
width: 149rpx;
height: 158rpx;
.icon {
width: 149rpx;
height: 158rpx;
}
}
</style>

+ 20
- 1
pages/index/index.vue View File

@ -61,7 +61,26 @@
onShow() {
this.fetchBg()
},
onLoad() {
onLoad(option) {
const { state, shareId } = option
if (shareId) {
uni.setStorageSync('shareId', shareId)
}
if (state) {
uni.setStorageSync('state', state)
}
if (shareId && !uni.getStorageSync('token')) {
uni.navigateTo({
url: '/pages_order/auth/wxLogin'
})
return
}
if (uni.getStorageSync('token') && !this.userInfo?.id) {
this.$store.commit('getUserInfo')
}


+ 1
- 0
pages/index/record.vue View File

@ -139,6 +139,7 @@
1: '../../static/image/record/pass.png', //
2: '../../static/image/record/fail.png', //
},
// todo
sliderBgUrl: 'https://thumbnail0.baidupcs.com/thumbnail/5128034cfj9ac619ca072da4706a6c90?fid=3983569511-250528-294545550145327&time=1742536800&rt=sh&sign=FDTAER-DCb740ccc5511e5e8fedcff06b081203-iqtAvQatpPXXyCeN8GEAHhPMHEM%3D&expires=8h&chkv=0&chkbd=0&chkpc=&dp-logid=8764190582084176609&dp-callid=0&file_type=0&size=c850_u580&quality=100&vuk=-&ft=video',
mixinsListApi : 'getSharePage',
}


+ 5
- 1
pages_order/mine/sharing.vue View File

@ -37,7 +37,11 @@
methods: {
async fetchQrCode() {
try {
this.wxCodeImage = await this.$fetch('getQrCode')
const url = (await this.$fetch('getQrCode'))?.url
this.wxCodeImage = this.$config.aliOss.url + url
console.log('--wxCodeImage', this.wxCodeImage)
this.draw()
} catch (err) {


+ 36
- 100
pages_order/mine/team.vue View File

@ -6,16 +6,15 @@
<view class="overview">
<view class="title">我的推荐人</view>
<view class="card flex referrer">
<!-- todo: 换回接口提供的 -->
<image class="avatar" src="https://thumbnail0.baidupcs.com/thumbnail/a4166d65fm1072cc3d763d59df8feb8a?fid=3983569511-250528-247083465710867&time=1742544000&rt=sh&sign=FDTAER-DCb740ccc5511e5e8fedcff06b081203-8%2Bjq3Cl0GcBe8y3JIzmmJnNofiY%3D&expires=8h&chkv=0&chkbd=0&chkpc=&dp-logid=8765802821729992500&dp-callid=0&file_type=0&size=c850_u580&quality=100&vuk=-&ft=video"></image>
<image class="avatar" :src="userInfoVip.pidInfo.headImage"></image>
<view class="referrer-info">
<view>
<view class="nick-name">裂变星1号</view>
<view>{{ `ID:${12345678}` }}</view>
<view class="nick-name">{{ userInfoVip.pidInfo.nickName }}</view>
<view>{{ `ID:${userInfoVip.pidInfo.id}` }}</view>
</view>
<view>
<view class="phone-label">手机号</view>
<view>15234567891</view>
<view>{{ userInfoVip.pidInfo.phone }}</view>
</view>
</view>
</view>
@ -23,21 +22,20 @@
<image class="bg" src="../static/center/overview-bg.png"></image>
<view class="flex flex-column summary-info">
<!-- todo: 换回接口提供的 -->
<view class="flex summary-info-total">
<view class="flex flex-column">
<view class="value">100</view>
<view class="value">{{ userInfoVip.user_sum }}</view>
<view class="label">推荐总人数</view>
</view>
</view>
<view class="flex summary-info-detail">
<view class="flex flex-column">
<view class="label">直接推荐</view>
<view class="value">90</view>
<view class="value">{{ userInfoVip.j_sum }}</view>
</view>
<view class="flex flex-column">
<view class="label">间接推荐</view>
<view class="value">10</view>
<view class="value">{{ userInfoVip.z_sum }}</view>
</view>
</view>
</view>
@ -75,18 +73,18 @@
</view>
<view class="card flex list-item"
v-for="item in recordList.records"
v-for="item in list"
:key="item.id"
>
<image class="avatar" :src="item.avatarUrl"></image>
<image class="avatar" :src="item.headImage"></image>
<view class="flex" style="flex: 1; justify-content: space-between;">
<view class="flex flex-column left">
<view class="highlight">{{ item.nickName }}</view>
<view>{{ item.roleName }}</view>
<view>{{ getRoleDesc(item.role) }}</view>
</view>
<view class="flex flex-column right">
<view>{{ item.createTime }}</view>
<view>{{ item.createDate }}</view>
<view>{{ $dayjs(item.createTime).format('HH:mm:ss') }}</view>
<view>{{ $dayjs(item.createDate).format('YYYY-MM-DD') }}</view>
</view>
</view>
</view>
@ -95,9 +93,12 @@
</template>
<script>
import { mapState } from 'vuex'
import mixinsList from '@/mixins/list.js'
import suspendDropdown from '@/components/base/suspendDropdown.vue'
export default {
mixins : [mixinsList],
components: {
suspendDropdown,
},
@ -120,105 +121,40 @@
value: 1,
},
],
recordList: {
records: [
{
id: '001',
avatarUrl: 'https://thumbnail0.baidupcs.com/thumbnail/a4166d65fm1072cc3d763d59df8feb8a?fid=3983569511-250528-247083465710867&time=1742544000&rt=sh&sign=FDTAER-DCb740ccc5511e5e8fedcff06b081203-8%2Bjq3Cl0GcBe8y3JIzmmJnNofiY%3D&expires=8h&chkv=0&chkbd=0&chkpc=&dp-logid=8765802821729992500&dp-callid=0&file_type=0&size=c850_u580&quality=100&vuk=-&ft=video',
nickName: '裂变星1号',
roleName: '普通会员',
createDate: '2025年2月15日',
createTime: '12:56:48',
},
{
id: '002',
avatarUrl: 'https://thumbnail0.baidupcs.com/thumbnail/a4166d65fm1072cc3d763d59df8feb8a?fid=3983569511-250528-247083465710867&time=1742544000&rt=sh&sign=FDTAER-DCb740ccc5511e5e8fedcff06b081203-8%2Bjq3Cl0GcBe8y3JIzmmJnNofiY%3D&expires=8h&chkv=0&chkbd=0&chkpc=&dp-logid=8765802821729992500&dp-callid=0&file_type=0&size=c850_u580&quality=100&vuk=-&ft=video',
nickName: '裂变星1号',
roleName: '代理商',
createDate: '2025年2月15日',
createTime: '12:56:48',
},
{
id: '003',
avatarUrl: 'https://thumbnail0.baidupcs.com/thumbnail/a4166d65fm1072cc3d763d59df8feb8a?fid=3983569511-250528-247083465710867&time=1742544000&rt=sh&sign=FDTAER-DCb740ccc5511e5e8fedcff06b081203-8%2Bjq3Cl0GcBe8y3JIzmmJnNofiY%3D&expires=8h&chkv=0&chkbd=0&chkpc=&dp-logid=8765802821729992500&dp-callid=0&file_type=0&size=c850_u580&quality=100&vuk=-&ft=video',
nickName: '裂变星1号',
roleName: '普通会员',
createDate: '2025年2月15日',
createTime: '12:56:48',
},
{
id: '004',
avatarUrl: 'https://thumbnail0.baidupcs.com/thumbnail/a4166d65fm1072cc3d763d59df8feb8a?fid=3983569511-250528-247083465710867&time=1742544000&rt=sh&sign=FDTAER-DCb740ccc5511e5e8fedcff06b081203-8%2Bjq3Cl0GcBe8y3JIzmmJnNofiY%3D&expires=8h&chkv=0&chkbd=0&chkpc=&dp-logid=8765802821729992500&dp-callid=0&file_type=0&size=c850_u580&quality=100&vuk=-&ft=video',
nickName: '裂变星1号',
roleName: '代理商',
createDate: '2025年2月15日',
createTime: '12:56:48',
},
{
id: '005',
avatarUrl: 'https://thumbnail0.baidupcs.com/thumbnail/a4166d65fm1072cc3d763d59df8feb8a?fid=3983569511-250528-247083465710867&time=1742544000&rt=sh&sign=FDTAER-DCb740ccc5511e5e8fedcff06b081203-8%2Bjq3Cl0GcBe8y3JIzmmJnNofiY%3D&expires=8h&chkv=0&chkbd=0&chkpc=&dp-logid=8765802821729992500&dp-callid=0&file_type=0&size=c850_u580&quality=100&vuk=-&ft=video',
nickName: '裂变星1号',
roleName: '普通会员',
createDate: '2025年2月15日',
createTime: '12:56:48',
},
],
total: 0,
},
// recordList: {
// records: [],
// total: 0,
// },
state: -1,
queryParams: {
pageNo: 1,
pageSize: 10,
role: null,
state: 0,
},
sliderBgUrl: 'https://thumbnail0.baidupcs.com/thumbnail/5128034cfj9ac619ca072da4706a6c90?fid=3983569511-250528-294545550145327&time=1742536800&rt=sh&sign=FDTAER-DCb740ccc5511e5e8fedcff06b081203-iqtAvQatpPXXyCeN8GEAHhPMHEM%3D&expires=8h&chkv=0&chkbd=0&chkpc=&dp-logid=8764190582084176609&dp-callid=0&file_type=0&size=c850_u580&quality=100&vuk=-&ft=video'
// todo
sliderBgUrl: 'https://thumbnail0.baidupcs.com/thumbnail/5128034cfj9ac619ca072da4706a6c90?fid=3983569511-250528-294545550145327&time=1742536800&rt=sh&sign=FDTAER-DCb740ccc5511e5e8fedcff06b081203-iqtAvQatpPXXyCeN8GEAHhPMHEM%3D&expires=8h&chkv=0&chkbd=0&chkpc=&dp-logid=8764190582084176609&dp-callid=0&file_type=0&size=c850_u580&quality=100&vuk=-&ft=video',
mixinsListApi : 'getUserInfoVipList',
}
},
onShow() {
this.orderPage()
},
//
onReachBottom() {
if(this.queryParams.pageSize < this.recordList.total){
this.queryParams.pageSize += 10
this.orderPage()
}
computed: {
...mapState(['userInfo', 'userInfoVip']),
},
onShow() {
this.$store.commit('getUserInfoVip')
},
methods: {
orderPage(){
// todo
return
let queryParams = {
...this.queryParams,
}
if(this.state != -1){
queryParams.state = this.state
}
this.$api('orderPage', queryParams, res => {
if(res.code == 200){
this.recordList = res.result
}
})
},
getRoleDesc(role) {
return this.roleOptions.find(item => item.value == role)?.label
},
//tab
clickTabs(e) {
const { index } = e
if (index == 0) {
this.state = -1;
} else {
this.state = index - 1;
}
this.queryParams.state = e.index
this.queryParams.pageNo = 1
this.queryParams.pageSize = 10
this.orderPage()
this.getData()
},
onRoleChange(role) {
// todo
// fetch list
if (role === null) {
delete this.queryParams.role
} else {
this.queryParams.role = role
}
this.getData()
}
},
}


+ 23
- 54
pages_order/mine/wallet.vue View File

@ -8,14 +8,11 @@
<view class="overview-info">
<view class="flex user-info">
<!-- todo: 换回接口提供的 -->
<image class="avatar" src="https://thumbnail0.baidupcs.com/thumbnail/a4166d65fm1072cc3d763d59df8feb8a?fid=3983569511-250528-247083465710867&time=1742544000&rt=sh&sign=FDTAER-DCb740ccc5511e5e8fedcff06b081203-8%2Bjq3Cl0GcBe8y3JIzmmJnNofiY%3D&expires=8h&chkv=0&chkbd=0&chkpc=&dp-logid=8765802821729992500&dp-callid=0&file_type=0&size=c850_u580&quality=100&vuk=-&ft=video"></image>
<!-- todo: 换回接口提供的 -->
<text class="nick-name">裂变星1号</text>
<image class="avatar" :src="userInfo.headImage"></image>
<text class="nick-name">{{ userInfo.nickName }}</text>
</view>
<view class="account">
<!-- todo: 换回接口提供的 -->
<view class="account-count">{{ `${100.0}` }}</view>
<view class="account-count">{{ `${userInfoVip.money}` }}</view>
<view class="account-desc">可提现余额</view>
</view>
</view>
@ -26,9 +23,8 @@
</button>
<view class="flex overview-summary">
<!-- todo: 换回接口提供的 -->
<view>总收益<text class="highlight">{{ `${276.0}` }}</text></view>
<view>已提现<text class="highlight">{{ `${176.0}` }}</text></view>
<view>总收益<text class="highlight">{{ `${userInfoVip.sum_money}` }}</text></view>
<view>已提现<text class="highlight">{{ `${userInfoVip.get_money}` }}</text></view>
</view>
</view>
<view class="detail">
@ -47,21 +43,22 @@
</view>
<view class="detail-list">
<view class="card detail-list-item"
v-for="item in detailList"
v-for="item in list"
:key="item.id"
>
<view class="flex detail-list-item-row highlight">
<text>{{ item.title }}</text>
<template v-if="item.type === 'in'">
<text class="count count-in">{{ `+${item.count}` }}</text>
<!-- status: 0- 1- -->
<template v-if="item.status === '0'">
<text class="count count-in">{{ `+${item.price}` }}</text>
</template>
<template v-else>
<text class="count count-out">{{ `-${item.count}` }}</text>
<text class="count count-out">{{ `-${item.price}` }}</text>
</template>
</view>
<view class="flex detail-list-item-row">
<text>{{ item.createTime }}</text>
<text>{{ `余额:${item.account}` }}</text>
<text>{{ `余额:${item.money || 0}` }}</text>
</view>
</view>
</view>
@ -72,58 +69,30 @@
</template>
<script>
import { mapState } from 'vuex'
import mixinsList from '@/mixins/list.js'
export default {
mixins : [mixinsList],
data() {
return {
detailList: [
{
id: '001',
title: '提现-微信',
type: 'out',
count: '88.0',
account: '100.0',
createTime: '2025年2月15日 12:56:48',
},
{
id: '002',
title: '活动奖励',
type: 'in',
count: '12.8',
account: '188.0',
createTime: '2025年2月14日 12:56:48',
},
{
id: '003',
title: '提现-微信',
type: 'out',
count: '88.0',
account: '263.2',
createTime: '2025年2月13日 12:56:48',
},
]
mixinsListApi : 'getWalletList',
}
},
computed: {
...mapState(['userInfo', 'userInfoVip']),
},
onShow() {
// todo
// fetch user-info
// fetch detail
},
onReachBottom() {
// todo
// fetch more detail
this.$store.commit('getUserInfoVip')
},
methods: {
openCalendars() {
this.$refs.calendars.open();
},
onSelectDate(e) {
console.log('--onSelectDate', e)
// todo
// fetch detail
this.queryParams.time = e.fulldate
this.queryParams.pageNo = 1
this.getData()
}
},
}


+ 29
- 16
pages_order/mine/withdraw.vue View File

@ -8,7 +8,7 @@
<view class="flex">
<text class="unit"></text>
<uv-input
v-model="count"
v-model="money"
placeholder="请输入提现金额"
:placeholderStyle="{
color: '#999999',
@ -25,23 +25,23 @@
border="none"
focus
></uv-input>
<button plain class="btn-simple btn-withdraw">全部提现</button>
<button plain class="btn-simple btn-withdraw" @click="allIn">全部提现</button>
</view>
<view class="account">{{ `可用金额:¥${account}` }}</view>
<view class="account">{{ `可用金额:¥${userInfoVip.money || 0}` }}</view>
</view>
<view class="info-row">
<!-- 不需要授权 -->
<!-- <view class="info-row">
<view class="flex title">
<text>提现至</text>
<image class="icon-wx" src="../static/center/wx.png"></image>
<text>微信</text>
<!-- todo: check -->
<txt>本人已实名微信账号</txt>
</view>
<view class="flex">
<view class="desc">余额提现至微信钱包提现限额2000元/日次日00:00恢复提现额度</view>
<button plain class="btn-auth">去授权</button>
</view>
</view>
</view> -->
</view>
<button class="btn-submit" @click="onConfirm">确定</button>
@ -50,23 +50,36 @@
</template>
<script>
import { mapState } from 'vuex'
export default {
data() {
return {
count: null,
account: null,
money: null,
}
},
onShow() {
// todo
computed: {
...mapState(['userInfoVip']),
},
methods: {
allIn() {
this.money = this.userInfoVip.money || 0
},
async onConfirm() {
try {
// fetch user-info
await this.$fetch('openMoney', { money: this.money })
uni.showToast({
title: '提现成功',
icon: 'none'
})
setTimeout(uni.navigateBack, 1000, -1)
} catch (err) {
}
this.account = 100.0
},
methods: {
onConfirm() {
// todo
},
},
}


+ 1
- 1
pages_order/record/articleSharing.vue View File

@ -173,7 +173,7 @@
let o = {
title : headTitle,
imageUrl: headImage,
path: `/pages_order/sharing/article?id=${this.id}`
path: `/pages_order/sharing/article?id=${this.id}&state=3&shareId=${this.userInfo.id}`
}
// todo: get times and check is unlocked


+ 1
- 1
pages_order/record/groupSharing.vue View File

@ -208,7 +208,7 @@
let o = {
title : headTitle,
imageUrl: indexImage,
path: `/pages_order/sharing/group?id=${this.id}`
path: `/pages_order/sharing/group?id=${this.id}&state=2&shareId=${this.userInfo.id}`
}
// todo: get times and check is unlocked


+ 1
- 1
pages_order/record/personalSharing.vue View File

@ -215,7 +215,7 @@
let o = {
title : headTitle,
imageUrl: indexImage,
path: `/pages_order/sharing/personal?id=${this.id}`
path: `/pages_order/sharing/personal?id=${this.id}&state=0&shareId=${this.userInfo.id}`
}
// todo: get times and check is unlocked


+ 5
- 1
pages_order/record/videoSharing.vue View File

@ -120,6 +120,7 @@
</template>
<script>
import { mapState } from 'vuex'
import formUpload from '../components/formUpload.vue'
import formInput from '../components/formInput.vue'
import formNumberBox from '../components/formNumberBox.vue'
@ -184,6 +185,9 @@
},
}
},
computed: {
...mapState(['userInfo']),
},
onLoad(option) {
const { id } = option
@ -204,7 +208,7 @@
let o = {
title : headTitle,
imageUrl: indexImage,
path: `/pages_order/sharing/video?id=${this.id}`
path: `/pages_order/sharing/video?id=${this.id}&state=1&shareId=${this.userInfo.id}`
}
// todo: get times and check is unlocked


+ 30
- 4
pages_order/sharing/article.vue View File

@ -20,12 +20,16 @@
<popupQrCode ref="popupQrCode" :src="detail.wxCodeImage"></popupQrCode>
<loginPopup ref="loginPopup" @login="initData"/>
</uv-overlay>
</view>
</template>
<script>
import { mapState } from 'vuex'
import loginPopup from '@/components/config/loginPopup.vue'
import popupUnlock from '../components/popupUnlock.vue'
import popupQrCode from '../components/popupQrCode.vue'
@ -33,9 +37,11 @@
components: {
popupUnlock,
popupQrCode,
loginPopup,
},
data() {
return {
id: null,
detail: {
id: null,
userId: null,
@ -48,12 +54,28 @@
isLocked: true,
}
},
computed: {
...mapState(['userInfo']),
},
async onLoad(option) {
const { id } = option
const { id, state, shareId } = option
if (shareId) {
uni.setStorageSync('shareId', shareId)
}
await this.fetchDetails(id)
if (state) {
uni.setStorageSync('state', state)
}
this.id = id
this.initEditor(this.detail.textDetails)
if(uni.getStorageSync('token')){
this.initData()
}else{
this.$refs.loginPopup.open()
}
},
onShareAppMessage(res) {
const {
@ -64,7 +86,7 @@
let o = {
title : headTitle,
imageUrl: headImage,
query: `id=${this.id}`,
query: `id=${this.id}&state=3&shareId=${this.userInfo.id}`,
}
// todo: get times and check is unlocked
@ -96,6 +118,10 @@
}
},
async initData() {
await this.fetchDetails(this.id)
this.initEditor(this.detail.textDetails)
},
async fetchCheckShare(id) {
try {
return await this.$fetch('checkArticleShare', { id })


+ 29
- 6
pages_order/sharing/group.vue View File

@ -4,7 +4,7 @@
<view class="content">
<image class="avatar" :src="detail.headImage"></image>
<text class="nick-name">{{ detail.headTitle }}</text>
<text class="nick-name">{{ detail.headTitle || '' }}</text>
<template v-if="isLocked">
<button class="btn" type="success" @click="onAdd">加入</button>
@ -15,20 +15,26 @@
</view>
</view>
<loginPopup ref="loginPopup" @login="fetchDetails"/>
<popupUnlock ref="popupUnlock" src="../static/sharing/unlock-group.png"></popupUnlock>
</view>
</template>
<script>
import { mapState } from 'vuex'
import loginPopup from '@/components/config/loginPopup.vue'
import popupUnlock from '../components/popupUnlock.vue'
export default {
components: {
loginPopup,
popupUnlock,
},
data() {
return {
id: null,
detail: {
id: null,
avatarUrl: null,
@ -41,10 +47,27 @@
isLocked: true,
}
},
computed: {
...mapState(['userInfo']),
},
onLoad(option) {
const { id } = option
const { id, state, shareId } = option
if (shareId) {
uni.setStorageSync('shareId', shareId)
}
this.fetchDetails(id)
if (state) {
uni.setStorageSync('state', state)
}
this.id = id
if(uni.getStorageSync('token')){
this.fetchDetails()
}else{
this.$refs.loginPopup.open()
}
},
onShareAppMessage(res) {
const {
@ -55,7 +78,7 @@
let o = {
title : headTitle,
imageUrl: indexImage,
query: `id=${this.id}`,
query: `id=${this.id}&state=2&shareId=${this.userInfo.id}`,
}
// todo: get times and check is unlocked
@ -64,9 +87,9 @@
return o
},
methods: {
async fetchDetails(id) {
async fetchDetails() {
try {
this.detail = await this.$fetch('getGroupShareInfo', { id })
this.detail = await this.$fetch('getGroupShareInfo', { id: this.id })
} catch (err) {
}


+ 30
- 7
pages_order/sharing/personal.vue View File

@ -4,7 +4,7 @@
<view class="content">
<image class="avatar" :src="detail.headImage"></image>
<text class="nick-name">{{ detail.headTitle }}</text>
<text class="nick-name">{{ detail.headTitle || '' }}</text>
<template v-if="isLocked">
<button class="btn" type="success" @click="onAdd">添加</button>
@ -14,20 +14,26 @@
</template>
</view>
<loginPopup ref="loginPopup" @login="fetchDetails"/>
<popupUnlock ref="popupUnlock" src="../static/sharing/unlock-user.png"></popupUnlock>
</view>
</template>
<script>
import { mapState } from 'vuex'
import loginPopup from '@/components/config/loginPopup.vue'
import popupUnlock from '../components/popupUnlock.vue'
export default {
components: {
loginPopup,
popupUnlock,
},
data() {
return {
id: null,
detail: {
id: null,
userId: null,
@ -41,10 +47,28 @@
isLocked: true,
}
},
computed: {
...mapState(['userInfo']),
},
onLoad(option) {
const { id } = option
const { id, state, shareId } = option
if (shareId) {
uni.setStorageSync('shareId', shareId)
}
if (state) {
uni.setStorageSync('state', state)
}
this.id = id
if(uni.getStorageSync('token')){
this.fetchDetails()
}else{
this.$refs.loginPopup.open()
}
this.fetchDetails(id)
},
onShareAppMessage(res) {
const {
@ -55,18 +79,17 @@
let o = {
title : headTitle,
imageUrl: indexImage,
query: `id=${this.id}`,
query: `id=${this.id}&state=0&shareId=${this.userInfo.id}`,
}
// todo: get times and check is unlocked
this.refreshLockStatus()
return o
},
methods: {
async fetchDetails(id) {
async fetchDetails() {
try {
this.detail = await this.$fetch('getShareInfo', { id })
this.detail = await this.$fetch('getShareInfo', { id: this.id })
} catch (err) {
}


+ 33
- 7
pages_order/sharing/video.vue View File

@ -14,20 +14,23 @@
@timeupdate="onTimeupdate"
></video>
<view class="info">
<view class="author">{{ detail.author }}</view>
<view class="title">{{ detail.headTitle }}</view>
<view class="desc">{{ detail.textDetails }}</view>
<view class="author">{{ detail.author || '' }}</view>
<view class="title">{{ detail.headTitle || '' }}</view>
<view class="desc">{{ detail.textDetails || '' }}</view>
</view>
</view>
<uv-overlay :show="timeIsUp" @click="onPlay" zIndex="998">
<popupUnlock ref="popupUnlock" src="../static/sharing/unlock-video.png"></popupUnlock>
<popupQrCode ref="popupQrCode" :src="detail.wxCodeImage"></popupQrCode>
<loginPopup ref="loginPopup" @login="initData"/>
</uv-overlay>
</view>
</template>
<script>
import { mapState } from 'vuex'
import loginPopup from '@/components/config/loginPopup.vue'
import popupUnlock from '../components/popupUnlock.vue'
import popupQrCode from '../components/popupQrCode.vue'
@ -35,9 +38,11 @@
components: {
popupUnlock,
popupQrCode,
loginPopup,
},
data() {
return {
id: null,
detail: {
id: null,
headTitle: null,
@ -53,12 +58,28 @@
videoContext: null
}
},
computed: {
...mapState(['userInfo']),
},
async onLoad(option) {
const { id } = option
const { id, state, shareId } = option
if (shareId) {
uni.setStorageSync('shareId', shareId)
}
await this.fetchDetails(id)
if (state) {
uni.setStorageSync('state', state)
}
this.id = id
this.videoContext = uni.createVideoContext('video');
if(uni.getStorageSync('token')){
this.initData()
}else{
this.$refs.loginPopup.open()
}
},
onShareAppMessage(res) {
const {
@ -69,7 +90,7 @@
let o = {
title : headTitle,
imageUrl: indexImage,
query: `id=${this.id}`,
query: `id=${this.id}&state=1&shareId=${this.userInfo.id}`,
}
// todo: get times and check is unlocked
@ -85,6 +106,11 @@
}
},
async initData() {
await this.fetchDetails(this.id)
this.videoContext = uni.createVideoContext('video');
},
async fetchCheckShare(id) {
try {
return await this.$fetch('checkVideoShare', { id })


+ 22
- 3
store/store.js View File

@ -11,6 +11,7 @@ const store = new Vuex.Store({
configList: {}, //配置列表
shop : false,//身份判断如果不需要,可以删除
userInfo : {}, //用户信息
userInfoVip : {}, //用户Vip信息
},
getters: {
// 角色 true为水洗店 false为酒店 : 身份判断如果不需要,可以删除
@ -54,10 +55,20 @@ const store = new Vuex.Store({
if(res.errMsg != "login:ok"){
return
}
let data = {
code: res.code,
}
if (uni.getStorageSync('shareId')) {
data.shareId = uni.getStorageSync('shareId')
}
if (uni.getStorageSync('state')) {
data.state = uni.getStorageSync('state')
}
api('wxLogin', {
code : res.code
}, res => {
api('wxLogin', data, res => {
uni.hideLoading()
@ -87,6 +98,14 @@ const store = new Vuex.Store({
}
})
},
// 获取用户个人信息
getUserInfoVip(state){
api('getUserInfoVip', res => {
if(res.code == 200){
Vue.set(state, 'userInfoVip', res.result)
}
})
},
// 退出登录
logout(state){
uni.showModal({


Loading…
Cancel
Save