This commit is contained in:
zmj 2023-11-20 14:41:58 +08:00
parent dcf5a1a22f
commit 1f0ea2fe29
4 changed files with 391 additions and 355 deletions

View File

@ -151,6 +151,10 @@
], // /subpkg/townTask/townTask 1 ], // /subpkg/townTask/townTask 1
navToList: ["village_task_type_4", "village_task_type_5", "town_task_type_6", "town_task_type_master_6", ], navToList: ["village_task_type_4", "village_task_type_5", "town_task_type_6", "town_task_type_master_6", ],
// /subpkg/townTask/villageTask6
navToVillageTask6List: ['village_task_type_8', 'town_task_type_master_2', 'town_task_type_master_7',
'town_task_type_master_8'
]
}; };
@ -206,6 +210,10 @@
return this.navTo( return this.navTo(
`/subpkg/townTask/villageTask4?task_id=${this.$props.datas?.id}&type_value=${this.$props.datas.task_type_value}` `/subpkg/townTask/villageTask4?task_id=${this.$props.datas?.id}&type_value=${this.$props.datas.task_type_value}`
); );
if (this.navToVillageTask6List.includes(this.$props.datas.task_type_value))
return this.navTo(
`/subpkg/townTask/villageTask6?task_id=${this.$props.datas?.id}&type_value=${this.$props.datas.task_type_value}`
);
switch (this.$props.datas.task_type_value) { switch (this.$props.datas.task_type_value) {
case "1": case "1":
if (this.$store.state.app.userInfo.admin_id) this.navTo( if (this.$store.state.app.userInfo.admin_id) this.navTo(
@ -239,27 +247,27 @@
// case 67: // case 67:
// this.navTo(`/subpkg/townTask/villageTask6?task_id=${this.$props.datas?.id}`); // this.navTo(`/subpkg/townTask/villageTask6?task_id=${this.$props.datas?.id}`);
// break; // break;
case "village_task_type_8": // case "village_task_type_8":
this.navTo(`/subpkg/townTask/villageTask6?task_id=${this.$props.datas?.id}`); // this.navTo(`/subpkg/townTask/villageTask6?task_id=${this.$props.datas?.id}`);
break; // break;
case "town_task_type_master_2": // case "town_task_type_master_2":
this.navTo( // this.navTo(
`/subpkg/townTask/villageTask6?task_id=${this.$props.datas?.id}&type_value=${this.$props.datas.task_type_value}` // `/subpkg/townTask/villageTask6?task_id=${this.$props.datas?.id}&type_value=${this.$props.datas.task_type_value}`
); // );
break; // break;
case "town_task_type_master_3": case "town_task_type_master_3":
this.navTo(`/subpkg/townTask/gatherRecords?task_id=${this.$props.datas?.id}`); this.navTo(`/subpkg/townTask/gatherRecords?task_id=${this.$props.datas?.id}`);
break; break;
case "town_task_type_master_7": // case "town_task_type_master_7":
this.navTo( // this.navTo(
`/subpkg/townTask/villageTask6?task_id=${this.$props.datas?.id}&type_value=${this.$props.datas.task_type_value}` // `/subpkg/townTask/villageTask6?task_id=${this.$props.datas?.id}&type_value=${this.$props.datas.task_type_value}`
); // );
break; // break;
case "town_task_type_master_8": // case "town_task_type_master_8":
this.navTo( // this.navTo(
`/subpkg/townTask/villageTask6?task_id=${this.$props.datas?.id}&type_value=${this.$props.datas.task_type_value}` // `/subpkg/townTask/villageTask6?task_id=${this.$props.datas?.id}&type_value=${this.$props.datas.task_type_value}`
); // );
break; // break;
default: default:
this.navTo(''); this.navTo('');
break; break;

View File

@ -17,9 +17,12 @@
<view v-else class="item" :class="index==changeMoney?'active':''" @click="changePrice(index)" <view v-else class="item" :class="index==changeMoney?'active':''" @click="changePrice(index)"
v-for="(item, index) in priceList" :key="index">{{item}}</view> v-for="(item, index) in priceList" :key="index">{{item}}</view>
</view> </view>
<input v-if="priceList[changeMoney]=='自定义'" class="input" type="digit" placeholder="输入充值金额(元)" v-model="payMoney.money" /> <input v-if="priceList[changeMoney]=='自定义'" class="input" type="digit" placeholder="输入充值金额(元)"
v-model="payMoney.money" />
<button class="btn" @click="pay">充值</button> <button class="btn" @click="pay">充值</button>
<button class="btn btn2" @click="navToRecord">充值记录</button> <button class="btn btn2" @click="navToRecord">充值记录</button>
</view> </view>
<!-- <view class="tip"> <!-- <view class="tip">
<view class="title">注意事项</view> <view class="title">注意事项</view>
@ -30,10 +33,22 @@
</template> </template>
<script> <script>
import { recharge, payWay, payPrepay, wechatJsConfig, payStatus } from "@/api/pay.js" import {
import { userInfo } from "@/api/oaUser.js" recharge,
import { Toast } from '@/libs/uniApi.js' payWay,
import { taskShareholder } from "@/api/task.js" payPrepay,
wechatJsConfig,
payStatus
} from "@/api/pay.js"
import {
userInfo
} from "@/api/oaUser.js"
import {
Toast
} from '@/libs/uniApi.js'
import {
taskShareholder
} from "@/api/task.js"
export default { export default {
data() { data() {
return { return {
@ -45,7 +60,8 @@
payTimer: null, payTimer: null,
timeCount: 5, timeCount: 5,
task_id: -1, //id,, task_id: -1, //id,,
task: {} task: {},
obj: "323",
} }
}, },
// //
@ -61,6 +77,12 @@
} }
}, },
methods: { methods: {
aa() {
return JSON.parse(this.obj)
},
changePrice(index) { changePrice(index) {
if (this.changeMoney == index) this.changeMoney = -1; if (this.changeMoney == index) this.changeMoney = -1;
else this.changeMoney = index; else this.changeMoney = index;
@ -100,10 +122,10 @@
this.timeCount = 5; this.timeCount = 5;
} }
}, 1000) }, 1000)
} } else Toast(this.timeCount + '秒后再支付!')
else Toast(this.timeCount+'秒后再支付!')
}, },
goRecharge() { goRecharge() {
let that = this
// console.log(obj); // console.log(obj);
uni.showLoading({ uni.showLoading({
title: '获取支付信息', title: '获取支付信息',
@ -115,7 +137,9 @@
if (this.task_id > 0) { if (this.task_id > 0) {
queryData.task_id = this.task_id; queryData.task_id = this.task_id;
} }
let { data } = await recharge(queryData); let {
data
} = await recharge(queryData);
let res = await payWay({ let res = await payWay({
order_id: data.order_id, order_id: data.order_id,
from: data.from, from: data.from,
@ -128,14 +152,15 @@
}) })
// console.log(res1.data, res1.data.config.package.split('=')[1]); // console.log(res1.data, res1.data.config.package.split('=')[1]);
let obj = { let obj = {
"appid": res1.data.config.appId, // - - AppId AppId "appid": res1.data.appid, // - - AppId AppId
"noncestr": res1.data.config.nonceStr, // "noncestr": res1.data.noncestr, //
"package": res1.data.config.package, // "package": res1.data.package, //
"partnerid": res1.data.config.partnerid, // "partnerid": res1.data.partnerid, //
"prepayid": res1.data.config.package.split('=')[1], // "prepayid": res1.data.prepayid, //
"timestamp": res1.data.config.timestamp, // "timestamp": res1.data.timestamp, //
"sign": res1.data.config.paySign "sign": res1.data.sign
} }
uni.getProvider({ uni.getProvider({
service: 'payment', service: 'payment',
success: (paymentList) => { success: (paymentList) => {
@ -156,16 +181,21 @@
from: data.from, from: data.from,
}).then((status) => { }).then((status) => {
uni.showToast({ uni.showToast({
icon: status.data.pay_status?'success':'none', icon: status.data
title: status.data.pay_status?'支付成功':'支付失败' .pay_status ?
'success' : 'none',
title: status.data
.pay_status ?
'支付成功' : '支付失败'
}) })
if (this.task_id > 0) { if (this.task_id > 0) {
uni.$emit('upBuyShare'); uni.$emit('upBuyShare');
uni.navigateBack(); uni.navigateBack();
} } else {
else{
userInfo().then(user => { userInfo().then(user => {
this.$store.commit('setUserInfo', user.data); this.$store.commit(
'setUserInfo',
user.data);
}) })
} }
}) })
@ -179,7 +209,8 @@
}) })
}, },
complete: () => { complete: () => {
if(this.task_id<=0)this.payMoney.money = ''; if (this.task_id <= 0) this.payMoney.money =
'';
}, },
}); });
} }
@ -250,6 +281,7 @@
font-size: 32rpx; font-size: 32rpx;
font-weight: 400; font-weight: 400;
color: #333333; color: #333333;
text:nth-child(1) { text:nth-child(1) {
flex-shrink: 0; flex-shrink: 0;
margin-right: 18rpx; margin-right: 18rpx;
@ -327,6 +359,7 @@
font-weight: 400; font-weight: 400;
color: #FFFFFF; color: #FFFFFF;
} }
.btn2 { .btn2 {
background-color: #fff; background-color: #fff;
color: #333; color: #333;

View File

@ -163,8 +163,6 @@
} }
}, },
async submitFn() { async submitFn() {
if (!this.amount) return Toast("请输入金额") if (!this.amount) return Toast("请输入金额")
let data = { let data = {
id: this.task_id, id: this.task_id,

View File

@ -211,9 +211,6 @@
video_annex: this.videoList video_annex: this.videoList
}); });
} }
this.other.is_commit = 1; this.other.is_commit = 1;
this.approve_status = 1; this.approve_status = 1;
Toast('提交成功'); Toast('提交成功');