main
liudan 2 years ago
parent aa0b3bb48e
commit 6fd50e7995
  1. 8
      api/user.js
  2. 6
      pages.json
  3. 68
      pages/recharge/index.vue
  4. 9
      pages/user/index.vue
  5. 37
      pages/webview/webview.vue
  6. BIN
      static/xieyi.png
  7. BIN
      static/yinsi.png

@ -4,7 +4,8 @@ import request from '@/utils/request'
const api = {
userInfo: 'user/info',
assets: 'user/assets',
bindMobile: 'user/bindMobile'
bindMobile: 'user/bindMobile',
artical:'article/detail'
}
// 当前登录的用户信息
@ -26,3 +27,8 @@ export const assets = (param, option) => {
export const bindMobile = (data, option) => {
return request.post(api.bindMobile, data, option)
}
//获取用户协议和隐私政策
export const getArticle = (data, option) => {
return request.get(api.artical, data, option)
}

@ -232,6 +232,12 @@
"navigationBarTitleText" : "申请售后"
}
},
{
"path" : "pages/webview/webview",
"style" : {
"navigationBarTitleText" : ""
}
},
{
"path" : "pages/recharge/index",
"style" : {}

@ -1,18 +1,18 @@
<template>
<view class="container" v-if="userInfo.user_id">
<view class="account-panel dis-flex flex-y-center">
<!-- <view class="account-panel dis-flex flex-y-center">
<view class="panel-lable">
<text>账户余额</text>
</view>
<view class="panel-balance flex-box">
<text>{{ userInfo.balance }}</text>
</view>
</view>
</view> -->
<view class="recharge-panel">
<view class="recharge-label">
<text>充值卡兑换</text>
<text>礼品卡兑换</text>
</view>
<view class="recharge-plan clearfix">
<!-- <view class="recharge-plan clearfix">
<block v-for="(item, index) in planList" :key="index">
<view class="recharge-plan_item" :class="{ active: selectedPlanId == item.plan_id }" @click="onSelectPlan(item.plan_id)">
<view class="plan_money">
@ -23,10 +23,14 @@
</view>
</view>
</block>
</view>
</view> -->
<view class="btnContainer">
<view :class="activeIndex==index?'btnItem active':'btnItem'" @click="getPrizeItem(item)" v-for="(item,index) in btnList" :key="index">{{item.name}}</view>
</view>
<!-- 手动充值输入框 -->
<view class="recharge-input" >
<input type="text" placeholder="请输入充值卡CDKEY" v-model="inputValue" @input="onChangeMoney" />
<input type="text" placeholder="请输入礼品卡CDKEY" v-model="inputValue" @input="onChangeMoney" />
</view>
<!-- 确认按钮 -->
<view class="recharge-submit btn-submit">
@ -38,7 +42,7 @@
<!-- 充值描述 -->
<view class="recharge-describe">
<view class="recharge-label">
<text>充值卡说明</text>
<text>礼品卡说明</text>
</view>
<view class="content">
<!-- <text space="ensp">{{ setting.describe }}</text> -->
@ -52,6 +56,7 @@
<text space="ensp">3CDKEY区分大小写请严格输入</text>
</view>
</view>
<u-toast ref="uToast" />
</view>
</template>
@ -80,6 +85,12 @@
selectedPlanId: 0,
//
inputValue: '',
remark:'牛肉',
btnList:[
{name:'牦牛肉礼盒',value:0},
{name:'藏羊肉礼盒',value:1},
],
activeIndex:0
}
},
@ -127,13 +138,26 @@
//
app.disabled = true
//
cdkeyApi.submit({ cdkey:app.inputValue })
cdkeyApi.submit({ cdkey:app.inputValue,remark:app.remark })
.then(result => {
app.$toast(result.message),
console.log(result)
// app.$toast('')
// app.$toast(result.message),
app.getPageData()
})
.finally(() => app.disabled = false)
app.$refs.uToast.show({
title: '兑换成功'
})
}).finally(() => app.disabled = false)
},
getPrizeItem(item){
this.activeIndex = item.value;
if(item.value==0){
this.remark = '牛肉'
}else{
this.remark = '羊肉'
}
}
}
}
@ -179,7 +203,7 @@
}
.recharge-panel {
margin-top: 60rpx;
padding-top: 100rpx;
padding: 0 60rpx;
}
@ -265,4 +289,24 @@
color: #888;
}
}
.btnContainer{
display: flex;
align-items: center;
.btnItem{
flex:1;
border:1px solid #eaeaea;
background-color: #ffffff;
color:#000000;
font-size: 28rpx;
border-radius:10rpx;
padding:20rpx 0;
text-align: center;
margin:0 10rpx;
}
.active{
background-color: #17C161;
border:1px solid #17C161;
color:#ffffff;
}
}
</style>

@ -173,7 +173,10 @@
{ id: 'contact', name: '在线客服', icon: '/static/m5.png', type: 'button', openType: 'contact' },
// { id: 'points', name: '', icon: 'jifen', type: 'link', url: 'pages/points/log' },
{ id: 'refund', name: '退换/售后', icon: '/static/m6.png', type: 'link', url: 'pages/refund/index', count: 0 },
{ id: 'recharge', name: '卡密兑换', icon: '/static/kami.png', type: 'link', url: 'pages/recharge/index' }
{ id: 'recharge', name: '卡密兑换', icon: '/static/kami.png', type: 'link', url: 'pages/recharge/index' },
//
{ id: 'recharge', name: '用户协议', icon: '/static/xieyi.png', type: 'link', url: 'pages/webview/webview?articleId=10001' },
{ id: 'recharge', name: '隐私政策', icon: '/static/yinsi.png', type: 'link', url: 'pages/webview/webview?articleId=10002' }
]
export default {
@ -211,9 +214,8 @@
onShow(options) {
this.onRefreshPage()
},
methods: {
//
onRefreshPage() {
//
@ -654,6 +656,7 @@
display: flex;
justify-content: center;
margin-top: 60rpx;
padding-bottom: 60rpx;
.logout-btn {
width: 50%;

@ -0,0 +1,37 @@
<template>
<view class="">
<rich-text :nodes="content"></rich-text>
</view>
</template>
<script>
import * as UserApi from '@/api/user'
export default {
data() {
return {
content:''
}
},
methods:{
getArticleHandle(articleId){
UserApi.getArticle({articleId:articleId}).then(res=>{
console.log(res,"0000")
uni.setNavigationBarTitle({
title: res.data.detail.title
});
this.content = res.data.detail.content
})
},
},
onLoad(e) {
this.getArticleHandle(e.articleId);
}
}
</script>
<style>
</style>

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.4 KiB

Loading…
Cancel
Save