Browse Source

feat: 接口对接;

pull/1/head
Fox-33 4 weeks ago
parent
commit
167389a18a
7 changed files with 29 additions and 14 deletions
  1. +4
    -4
      api/model/index.js
  2. +13
    -1
      pages/index/index.vue
  3. +1
    -1
      pages_order/auth/wxLogin.vue
  4. +1
    -0
      pages_order/auth/wxUserInfo.vue
  5. +2
    -0
      pages_order/components/popupQrCode.vue
  6. +6
    -4
      pages_order/mine/setting.vue
  7. +2
    -4
      pages_order/record/articleSharing.vue

+ 4
- 4
api/model/index.js View File

@ -1,11 +1,11 @@
// 首页相关接口 // 首页相关接口
const api = { const api = {
submitPersonalSharing: {
url: '/index_common/updateCartNum',
method: 'POST',
// 获取首页背景图
getBanner: {
url: '/all_login/getBanner',
method: 'GET',
auth: true, auth: true,
debounce: 300,
}, },
} }

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

@ -51,18 +51,30 @@
title: '文章分享', title: '文章分享',
path: '/pages_order/record/articleSharing' path: '/pages_order/record/articleSharing'
}, },
]
],
bgUrl: null,
} }
}, },
computed: { computed: {
...mapState(['userInfo']), ...mapState(['userInfo']),
}, },
onShow() {
this.fetchBg()
},
onLoad() { onLoad() {
if (uni.getStorageSync('token') && !this.userInfo?.id) { if (uni.getStorageSync('token') && !this.userInfo?.id) {
this.$store.commit('getUserInfo') this.$store.commit('getUserInfo')
} }
}, },
methods: { methods: {
async fetchBg() {
try {
// todo: check
this.bgUrl = (await this.$fetch('getBanner'))?.[0]?.image
} catch (err) {
}
},
onClick(url) { onClick(url) {
if (!uni.getStorageSync('token')) { if (!uni.getStorageSync('token')) {
uni.navigateTo({ uni.navigateTo({


+ 1
- 1
pages_order/auth/wxLogin.vue View File

@ -36,7 +36,7 @@
}" }"
></uv-checkbox> ></uv-checkbox>
<text style="vertical-align: super;"> <text style="vertical-align: super;">
我已阅读<text class="highlight" @click="openModal">XXX小程序用户注册协议XXX小程序隐私保护协议</text>
我已阅读<text class="highlight" @click="openModal">裂变星小程序用户注册协议裂变星小程序隐私保护协议</text>
</text> </text>
</view> </view>
</uv-checkbox-group> </uv-checkbox-group>


+ 1
- 0
pages_order/auth/wxUserInfo.vue View File

@ -145,6 +145,7 @@
headImage: '请选择头像', headImage: '请选择头像',
nickName: '请填写昵称', nickName: '请填写昵称',
phone: '请填写手机号', phone: '请填写手机号',
wxCode: '请填写微信号',
})) { })) {
return return
} }


+ 2
- 0
pages_order/components/popupQrCode.vue View File

@ -39,6 +39,8 @@
.qr-popup { .qr-popup {
flex-direction: column; flex-direction: column;
padding-bottom: 104rpx;
.tips { .tips {
margin-top: 75rpx; margin-top: 75rpx;
color: #1B1B1B; color: #1B1B1B;


+ 6
- 4
pages_order/mine/setting.vue View File

@ -3,14 +3,12 @@
<navbar title="设置" leftClick @leftClick="$utils.navigateBack" /> <navbar title="设置" leftClick @leftClick="$utils.navigateBack" />
<view class="content"> <view class="content">
<!-- todo -->
<view class="card flex operate" @click="$refs.popup.open('getPrivacyPolicy')">
<view class="card flex operate" @click="$refs.popup.open('user_ys')">
<text>隐私政策</text> <text>隐私政策</text>
<uv-icon name="arrow-right" color="#000000" size="28rpx"></uv-icon> <uv-icon name="arrow-right" color="#000000" size="28rpx"></uv-icon>
</view> </view>
<!-- todo: check is logined -->
<button plain class="btn-logout" @click="onLogout">退出登录</button>
<button v-if="isLogined" plain class="btn-logout" @click="onLogout">退出登录</button>
</view> </view>
<configPopup ref="popup"></configPopup> <configPopup ref="popup"></configPopup>
@ -21,8 +19,12 @@
export default { export default {
data() { data() {
return { return {
isLogined: false
} }
}, },
onShow() {
this.isLogined = !!uni.getStorageSync('token')
},
methods: { methods: {
onLogout() { onLogout() {
this.$store.commit('logout') this.$store.commit('logout')


+ 2
- 4
pages_order/record/articleSharing.vue View File

@ -167,12 +167,12 @@
onShareAppMessage(res) { onShareAppMessage(res) {
const { const {
headTitle, headTitle,
indexImage,
headImage,
} = this.form } = this.form
let o = { let o = {
title : headTitle, title : headTitle,
imageUrl: indexImage,
imageUrl: headImage,
path: `/pages_order/sharing/article?id=${this.id}` path: `/pages_order/sharing/article?id=${this.id}`
} }
@ -316,7 +316,6 @@
const { const {
headImage, headImage,
headTitle, headTitle,
indexImage,
num, num,
wxCodeImage, wxCodeImage,
} = this.form } = this.form
@ -326,7 +325,6 @@
userId: this.userId, userId: this.userId,
headImage, headImage,
headTitle, headTitle,
indexImage,
num, num,
wxCodeImage, wxCodeImage,
textDetails, textDetails,


Loading…
Cancel
Save