5cd6ecbb by 杨炀

no message

1 parent 32ab1e6f
......@@ -173,7 +173,8 @@ export function payForOrder(form) {
}
export function submitOrder(form) {
return request({
url: `/system/order/sumbit`,
// url: `/system/order/sumbit`,
url: `/system/order/newsumbit `,
method: 'post',
params: form
})
......@@ -246,6 +247,12 @@ export function xfList() {
url: `/system/order/mylist?userId=${currUser.userId}`,
method: 'get'
})
}
export function getShareList() {
return request({
url: `/system/userShare/getMyShareList`,
method: 'get'
})
}
......
......@@ -45,7 +45,7 @@
<script setup>
import {
onLoad,
onShow
onShow,onShareAppMessage
} from '@dcloudio/uni-app';
import config from '@/config.js';
import {
......@@ -53,23 +53,34 @@
getCurrentInstance
} from 'vue';
import * as api from '@/common/api.js';
const currUser = uni.getStorageSync('currUser');
const form = ref({})
const isBuy = ref(false)
let goodsId
const isBuy = ref(false)
let shareId = '0'
let goodsId
onLoad((option) => {
uni.showLoading({
title: '加载中'
})
if (option.id) {
goodsId = option.id
}
if (option.shareId) {
console.log(option.shareId)
shareId = option.shareId
}
})
onShow(() => {
if (goodsId)
getData(goodsId)
})
onShareAppMessage(() => {
return {
title: form.value.activityName,
path: `/course/activeDetail?id=${goodsId}&shareId=${currUser.userId}`,
imageUrl: config.baseUrl_api+form.value.activityPic
};
});
function getData(id) {
api.getActiveById(id).then(res => {
form.value = res.data
......@@ -87,7 +98,7 @@
function goBill() {
if(form.value.isFree=='1'){
const obj = encodeURIComponent(JSON.stringify(form.value))
let path = `/course/courseBill?form=${obj}`
let path = `/course/courseBill?form=${obj}&shareId=${shareId}`
uni.navigateTo({
url: path
});
......@@ -95,7 +106,8 @@
} else {
api.submitOrder({
orderType: 1,
goodsId: form.value.activityId,
goodsId: form.value.activityId,
shareId:shareId,
payType: "0"
}).then(res => {
uni.showModal({
......
......@@ -142,7 +142,8 @@
const orderType = ref(0)
const vipPrice = ref(0)
const vippay = ref(null)
const system = uni.getStorageSync('systemType')
const system = uni.getStorageSync('systemType')
let shareId = '0'
onLoad((option) => {
if ('form' in option) {
form.value = JSON.parse(decodeURIComponent(option.form))
......@@ -152,6 +153,9 @@
orderType.value = 1
}
}
if (option.shareId) {
shareId = option.shareId
}
getUserExt()
})
onReady(() => {
......@@ -219,13 +223,15 @@
obj = {
orderType: 0,
goodsId: form.value.courseId,
payType: form.value.payType
payType: form.value.payType,
shareId:shareId
}
} else {
obj = {
orderType: 1,
goodsId: form.value.activityId,
payType: form.value.payType
payType: form.value.payType,
shareId:shareId
}
}
uni.showModal({
......@@ -273,9 +279,10 @@
// const openId = 'oRufa4ifoP2I3hnoLAwoAreKkppA'
api.payForOrder({
payId: res.data.payId,
openId: openId
openId: openId,
shareId:shareId
}).then(Response => {
// wePay(Response.data.weixinData)
wePay(Response.data.weixinData)
})
})
}
......
......@@ -77,7 +77,7 @@
<script setup>
import {
onLoad,
onShow,onReady
onShow,onReady,onShareAppMessage
} from '@dcloudio/uni-app';
import config from '@/config.js';
import {
......@@ -94,17 +94,25 @@
const myaudio = ref(null)
const vUrl = ref('')
const system = uni.getStorageSync('systemType')
let goodsId = ''
let goodsId = ''
let shareId = '0'
onLoad((option) => {
if (option.id) {
goodsId = option.id
}
uni.showShareMenu({
withShareTicket: true,
menus: ['shareAppMessage', 'shareTimeline']
});
}
if (option.shareId) {
console.log(option.shareId)
shareId = option.shareId
}
getData(goodsId)
})
})
onShareAppMessage(() => {
return {
title: form.value.courseName,
path: `/course/courseDetail?id=${goodsId}&shareId=${currUser.userId}`,
imageUrl: config.baseUrl_api+form.value.coursePic
};
});
onShow(() => {
api.getUserIsPay({
orderType: 0,
......@@ -146,7 +154,8 @@
api.submitOrder({
orderType: 0,
goodsId: form.value.courseId,
payType: "0"
payType: "0",
shareId:shareId
}).then(res => {
uni.showModal({
content:'已兑换!',
......
......@@ -192,6 +192,6 @@ font-weight: 600;}
.coverbox{height: 240rpx;position: relative;
.cover{width: 100%;height: 240rpx;}
.name{position: absolute;color: #fff;
font-size: 36rpx;top:40%;left: 40rpx;width: 8em;}
font-size: 36rpx;top:28%;left: 40rpx;width: 8em;}
}
</style>
......
......@@ -122,6 +122,13 @@
"navigationBarTitleText": "消费记录",
"enablePullDownRefresh": false
}
},
{
"path" : "myShare",
"style" :
{
"navigationBarTitleText" : "我的分享"
}
}
]
}, {
......
......@@ -51,7 +51,7 @@
<script setup>
import {
onLoad,
onShow
onShow,onShareAppMessage
} from '@dcloudio/uni-app';
import config from '@/config.js';
import {
......@@ -68,7 +68,6 @@
onShow(() => {
init()
})
function init() {
uni.showLoading({
title: `加载中`
......
......@@ -3,7 +3,10 @@
<view class="topBg">
<image src="/usercenter/img/bg.png" class="topbgimg"></image>
<view class="userInfoBox">
<view class="headImg">
<view class="headImg" v-if="user.avatar">
<image mode="aspectFill" :src="user.avatar"></image>
</view>
<view class="headImg" v-else>
<image v-if="user.sex=='0'" mode="aspectFill" src="/usercenter/img/female.png"></image>
<image v-else mode="aspectFill" src="/usercenter/img/male.png"></image>
</view>
......@@ -113,6 +116,14 @@
</view>
</template>
</uni-list-item>
<uni-list-item :border="false" title="充值记录" showArrow clickable
@click="goPath('/usercenter/mycard/mycard')">
<template v-slot:header>
<view class="slot-box">
<image class="slot-image" src="/usercenter/img/f3.png" mode="widthFix"></image>
</view>
</template>
</uni-list-item>
<uni-list-item :border="false" title="专属客服" showArrow clickable>
<template v-slot:header>
<view class="slot-box">
......@@ -124,6 +135,19 @@
</button>
</template>
</uni-list-item>
<uni-list-item :border="false" title="我的分享" showArrow clickable
@click="goPath('/usercenter/myShare')">
<template v-slot:header>
<view class="slot-box">
<image class="slot-image" src="/usercenter/img/f1.png" mode="widthFix"></image>
</view>
</template>
<template v-slot:footer>
<button size="mini" class="kfbtn" open-type="contact" bindcontact="handleContact" @contact="contactBack" session-from="sessionFrom">
</button>
</template>
</uni-list-item>
<!-- <uni-list-item :border="false" title="意见反馈" showArrow clickable @click="goPath()">
<template v-slot:header>
......
<template>
<view class="fixedbody">
<uni-forms ref="baseForm" :modelValue="form" :rules="rules" label-width="80">
<uni-forms ref="baseForm" :modelValue="form" label-width="80">
<uni-group mode="card" title="个人信息" top="20">
<view class="wBox">
<!-- <uni-forms-item label="照片" required name="picUrl">
<uni-forms-item label="照片" required name="picUrl">
<view class="avatarUrl">
<button type="balanced" open-type="chooseAvatar" @chooseavatar="onChooseavatar">
<image mode="aspectFill" :src="baseFormData.picUrl" class="refreshIcon"></image>
<image mode="aspectFill" :src="form.avatar" class="refreshIcon"></image>
</button>
</view>
</uni-forms-item> -->
<!-- {{form.avatar}} -->
</uni-forms-item>
<uni-forms-item label="姓名" name="realName">
<uni-easyinput v-model="form.nickName" :clearable="false" placeholder="请输入姓名" />
<uni-easyinput type="nickname" v-model="form.nickName" :clearable="false" placeholder="请输入姓名"
@blur="changename"/>
</uni-forms-item>
<uni-forms-item label="手机号码" name="phone">
<!-- <button type="default" open-type="getPhoneNumber" @getphonenumber="decryptPhoneNumber">获取手机号</button> -->
<uni-easyinput v-model="form.phonenumber" :clearable="false" placeholder="请输入联系方式" />
</uni-forms-item>
</uni-forms-item>
</view>
</uni-group>
</uni-forms>
......@@ -39,6 +41,7 @@ const countryList = ref([]);
const regionsList = ref([]);
const groupList = ref([]);
const form = ref({});
const nn = ref({})
const current = ref(0);
onLoad(()=>{
......@@ -62,9 +65,29 @@ function save() {
loginServer.getCurrUser()
})
}
function onChooseavatar(e){
form.value.avatar = e.detail.avatarUrl
}
function changename(e){
console.log(e)
form.value.nickName = e.detail.value
}
function decryptPhoneNumber(e){
if (e.detail.errMsg == "getPhoneNumber:ok") {
// 可以使用 e.detail.encryptedData 和 e.detail.iv 获取加密的手机号信息
const encryptedData = e.detail.encryptedData;
const iv = e.detail.iv;
api.jiexi({
encryptedData: encryptedData,
iv: iv
}).then(res=>{
console.log(res.data); // 服务器返回的手机号等信息
})
} else {
// 用户拒绝授权
console.log("用户拒绝授权获取手机号");
}
}
</script>
<style scope lang="scss">
......
<template>
<view>
<view class="item" v-for="(n,index) in list" :key="index">
<view>来源:{{n.courseName||n.goodsName||n.activityName}}</view>
<view>
<!-- <text class="text-warning">{{n.userName}}</text> -->
分享给
<text class="text-warning">{{n.shareName}}</text>
</view>
<view class="flex-r">
积分:<text class="text-warning">+{{n.shareScore}}</text>
金币:<text class="text-warning">+{{n.shareGold}}</text>
</view>
</view>
<view class="nodata" v-if="list.length==0">
<image mode="aspectFit" src="/static/nodata.png"/>
</view>
</view>
</template>
<script setup>
import {
onLoad,
onShow
} from '@dcloudio/uni-app';
import config from '@/config.js';
import {
ref,
getCurrentInstance
} from 'vue';
import * as api from '@/common/api.js';
const list = ref([])
onShow(() => {
init()
})
function init() {
getList()
}
function getList(){
api.getShareList().then(res=>{
list.value = res.rows
})
}
</script>
<style scoped lang="scss">
.item{width: 700rpx;margin:30rpx auto 0;float: none;
background: #FFFFFF;box-sizing: border-box;
border-radius: 20rpx;padding: 30rpx;
view{font-size: 25rpx;color: #999;
text{color: #333;}
}
.flex-r{ display: flex;justify-content: flex-end;align-items: baseline;
text{margin-right: 20rpx;font-size: 34rpx;}
}
}
</style>
......@@ -66,9 +66,10 @@
const content = ref('');
const currUser = uni.getStorageSync('currUser');
onLoad(() => {
if(content.value){
popNotice.value.open()
}
})
onShow(() => {
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!