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 = {
submitPersonalSharing: {
url: '/index_common/updateCartNum',
method: 'POST',
// 获取首页背景图
getBanner: {
url: '/all_login/getBanner',
method: 'GET',
auth: true,
debounce: 300,
},
}

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

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


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

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


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

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


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

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


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

@ -3,14 +3,12 @@
<navbar title="设置" leftClick @leftClick="$utils.navigateBack" />
<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>
<uv-icon name="arrow-right" color="#000000" size="28rpx"></uv-icon>
</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>
<configPopup ref="popup"></configPopup>
@ -21,8 +19,12 @@
export default {
data() {
return {
isLogined: false
}
},
onShow() {
this.isLogined = !!uni.getStorageSync('token')
},
methods: {
onLogout() {
this.$store.commit('logout')


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

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


Loading…
Cancel
Save