合并代码

This commit is contained in:
sx 2025-01-06 14:04:49 +08:00
parent be1027eb38
commit 7c1c2af676
8 changed files with 211 additions and 42 deletions

View File

@ -107,6 +107,40 @@ const mine = {
method: 'POST',
})
},
/**
* 返回绑定微信 支付宝账号
*/
getBindAccount() {
return util.request({
url: '/user/Bind/getBindAccount',
method: 'GET',
})
},
/**
* 绑定支付宝账号和微信账号
* @param {Object} param
*/
bindAccount(param) {
return util.request({
url: '/user/Bind/account',
data: param.data,
method: 'POST',
})
},
/**
* 意见反馈
* @param {Object} param
*/
feedback(param) {
return util.request({
url: '/user/protocol/feedback',
data: param.data,
method: 'POST',
})
},
}
export default mine

View File

@ -584,7 +584,7 @@ const util = {
// 格式化默认值
// 图片计数
const count = obj.count ? obj.count : 8
// 多战鼓图片
// 多图片
if (!obj.type) obj.type = 2
// 操作对象
if (obj.value != '' && obj.value == undefined && obj.value == null) obj.value = obj.type == 1 ? '' : []

View File

@ -3,22 +3,26 @@
import {
ref,
computed,
getCurrentInstance
getCurrentInstance,
reactive
} from 'vue'
import {
useStore
} from 'vuex'
import {
onLoad,
onReady,
} from '@dcloudio/uni-app'
//
import util from '@/common/js/util.js'
//
import api from '@/api/index.js'
const {
proxy
} = getCurrentInstance()
//
const store = useStore()
//
const detail = reactive({
wechatId: '',
alipayId: '',
})
//
const bindItem = ref({})
//
@ -29,34 +33,81 @@
//
const bindList = computed(() => {
let result = [{
key: 'wechatId',
img: '/static/wx.png',
name: '微信号',
value: '',
value: detail.wechatId,
},
{
key: 'alipayId',
img: '/static/shop-alipay-payment.png',
name: '支付宝号',
vlaue: '',
value: detail.alipayId,
}
]
return result
})
onReady(() => {
//
onLoad(() => {
//
getDetail()
})
//
function getDetail() {
api.mine.getBindAccount().then(rs => {
if (rs.code == 200) {
//
Object.assign(detail, rs.data)
return
}
util.alert({
content: rs.msg,
showCancel: false,
})
})
}
//
function handleItem(item) {
bindItem.value = item
proxy.$refs.bind.open()
}
//
function handleSubmit() {
//
if (!bindItem.value.name) {
util.alert(`${bindItem.name}不能为空`)
return
}
//
const data = {}
//
data[bindItem.value.key] = bindItem.value.value
//
api.mine.bindAccount({
data,
}).then(rs => {
if (rs.code == 200) {
//
detail[bindItem.value.key] = bindItem.value.value
//
proxy.$refs.bind.close()
return
}
util.alert({
content: rs.msg,
showCancel: false,
})
})
}
</script>
<template>
<view class="app">
<view class="container">
<view class="line rows mtb30 mlr30 ptb40 plr30 bfff br20" v-for="(item,index) in bindList" :key="index"
@click="handleItem(item)">
<image class="wh80" :src="item.img" mode="aspectFit" />
@ -64,34 +115,41 @@
<view class="key f32">{{item.name}}</view>
<view class="content mt10 c999 f26">
<text v-if="item.value">{{item.value}}</text>
<text v-if="item.value != ''">{{item.value}}</text>
<text v-else>未绑定</text>
</view>
</view>
</view>
</view>
<!-- -->
<uni-popup ref="bind" type="bottom">
<view class="bindAlt popBot plr30 bfff">
<view class="header rows mtb30">
<view class="">绑定{{bindItem.name}}</view>
</view>
<view class="inputBox mtb30 ptb10 plr20">
<input type="text" placeholder="请输入" />
</view>
<view class="hint mtb30 c999 f26">请核对信息后进行绑定因信息错误产生的问题后果自负</view>
<view class="btn bar black mtb30">添加</view>
</view>
</uni-popup>
</view>
<!-- 绑定弹窗 -->
<uni-popup ref="bind" type="bottom">
<view class="bindAlt popBot plr30 bfff">
<view class="header rows mtb30">
<view class="">
<text v-if="detail[bindItem.key]">修改</text>
<text v-else>绑定</text>
<text>{{bindItem.name}}</text>
</view>
</view>
<view class="inputBox mtb30 ptb10 plr20">
<input type="text" v-model="bindItem.value" placeholder="请输入" />
</view>
<view class="hint mtb30 c999 f26">请核对信息后进行绑定因信息错误产生的问题后果自负</view>
<view class="btn bar black mtb30" @click="handleSubmit">添加</view>
</view>
</uni-popup>
</template>
<style lang="scss">
<style lang="scss" scoped>
//
.bindAlt {
//
.hint {
color: #aa3333;
}

View File

@ -1,6 +1,77 @@
<script setup>
//
//
import {
ref,
reactive,
computed,
} from 'vue'
import {
onLoad,
onReady,
} from '@dcloudio/uni-app'
//
import util from '@/common/js/util.js'
//
import api from '@/api/index.js'
//
const form = reactive({
feedbackType: '',
content: '',
url: [],
phoneNumber: '',
})
//
function handleSubmit() {
//
const data = {
...form
}
console.log('data', data)
//
if (!data.feedbackType) {
util.alert('问题标题不能为空')
return
}
if (!data.content) {
util.alert('问题详情不能为空')
return
}
if (!data.phoneNumber) {
util.alert('联系方式不能为空')
return
}
//
data.url = data.url.join(',')
api.mine.feedback({
data,
}).then(rs => {
if (rs.code == 200) {
util.alert({
content: '提交成功,请耐心等待平台反馈',
showCancel: false,
}).then(rs => {
uni.navigateBack()
})
return
}
util.alert({
content: rs.msg,
showCancel: false,
})
})
}
//
function uploadImg() {
util.upload_image({
value: form.url,
type: 2,
count: 6,
})
}
</script>
<template>
@ -9,31 +80,37 @@
<view class="line">
<view class="key f36">请输入您遇到的问题标题</view>
<view class="value inputBox">
<input type="text" placeholder="请输入描述问题标题" />
<input v-model.trim="form.feedbackType" placeholder="请输入描述问题标题" />
</view>
</view>
<view class="line">
<view class="key f36">请输入您遇到的问题详情</view>
<view class="value inputBox">
<textarea class="textarea" type="text" placeholder="请输入描述问题详情" />
<textarea v-model.trim="form.content" class="textarea" type="text" placeholder="请输入描述问题详情" />
</view>
</view>
<view class="line">
<view class="key f36">请输入您遇到的问题</view>
<view class="imgList mt30">
<view class="imgs upload fmid wh180 br20">
<view class="imgs wh180 br20" v-for="(item,index) in form.url" :key="index">
<image :src="item" mode="aspectFill" />
</view>
<view class="imgs upload fmid wh180 br20" @click="uploadImg">
<uni-icons type="plusempty" size="80rpx" color="#aaa" />
</view>
</view>
</view>
<view class="line">
<view class="key f36">请输入您的联系方式</view>
<view class="value inputBox">
<input type="text" placeholder="请输入联系方式" />
<input v-model.trim="form.phoneNumber" type="text" placeholder="请输入联系方式" />
</view>
</view>
<view class="btn lg bar black mt60 mb30">提交</view>
<view class="btn lg bar black mt60 mb30" @click="handleSubmit">提交</view>
</view>
<view class="fill"></view>

BIN
jiuyi2/readme_files/1.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 166 KiB

BIN
jiuyi2/readme_files/2.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 166 KiB

BIN
jiuyi2/readme_files/3.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 228 KiB

View File

@ -14,20 +14,20 @@ export default defineConfig({
changeOrigin: true,
},
"/user": {
target: "http://192.168.1.241:8080",
target: "http://192.168.1.235:8080",
// target: "http://7fee92ac.r22.cpolar.top",
changeOrigin: true,
},
"/coreplay": {
target: "http://192.168.1.241:8080",
target: "http://192.168.1.235:8080",
changeOrigin: true,
},
"/file": {
target: "http://192.168.1.236:8080",
target: "http://192.168.1.235:8080",
changeOrigin: true,
},
"/video": {
target: "http://192.168.1.241:8080",
target: "http://192.168.1.235:8080",
// target: "http://7fee92ac.r22.cpolar.top",
changeOrigin: true,
},