#4 feat: bug修复;

Merged
Fox merged 5 commits from fox into master 1 week ago
  1. +0
    -124
      components/config/loginPopup.vue
  2. +22
    -0
      pages_order/auth/wxLogin.vue
  3. +5
    -8
      pages_order/record/articleSharing.vue
  4. +31
    -11
      pages_order/record/groupSharing.vue
  5. +9
    -13
      pages_order/record/personalSharing.vue
  6. +8
    -9
      pages_order/record/videoSharing.vue
  7. +4
    -4
      pages_order/sharing/article.vue
  8. +4
    -4
      pages_order/sharing/group.vue
  9. +4
    -0
      pages_order/sharing/personal.vue
  10. +7
    -12
      pages_order/sharing/video.vue
  11. BIN
      static/image/home/bg.png
  12. +5
    -5
      store/store.js

+ 0
- 124
components/config/loginPopup.vue View File

@ -1,124 +0,0 @@
<template>
<uv-popup ref="loginPopup"
mode="center"
:round="20"
:closeable="false"
:maskClick="false"
:closeOnClickOverlay="false"
:customStyle="{backgroundColor: '#fff', padding: 0}"
overlayOpacity="0.8">
<view class="login-card">
<view class="login-title">登录后即可查看分享内容</view>
<view class="login-content">
<button class="login-btn" @click="handleLogin">
微信一键登录
</button>
</view>
</view>
</uv-popup>
</template>
<script>
export default {
data(){
return {
}
},
methods: {
open(){
this.$refs.loginPopup.open()
},
close(){
this.$refs.loginPopup.close()
},
//
handleLogin() {
uni.showLoading({
title: '登录中...'
})
uni.login({
success : (res) => {
if (res.errMsg != "login:ok") {
return
}
let data = {
code: res.code,
}
if (uni.getStorageSync('shareId')) {
data.shareId = uni.getStorageSync('shareId')
}
if (uni.getStorageSync('id')) {
data.id = uni.getStorageSync('id')
}
if (uni.getStorageSync('state')) {
data.state = uni.getStorageSync('state')
}
this.$api('wxLogin', data, res => {
uni.hideLoading()
if (res.code != 200) {
this.close()
return
}
uni.setStorageSync('token', res.result.token)
this.$store.commit('getUserInfo')
this.close()
this.$emit('login')
})
}
})
},
}
}
</script>
<style lang="scss" scoped>
.login-card {
width: 600rpx;
padding: 40rpx;
text-align: center;
.login-title {
font-size: 32rpx;
font-weight: bold;
color: #333;
margin-bottom: 40rpx;
}
.login-content {
.login-image {
width: 300rpx;
height: 300rpx;
margin-bottom: 40rpx;
}
.login-btn {
display: flex;
align-items: center;
justify-content: center;
margin: 0 auto;
width: 80%;
height: 88rpx;
background: #07C160;
color: #fff;
border-radius: 44rpx;
font-size: 32rpx;
.wechat-icon {
width: 48rpx;
height: 48rpx;
margin-right: 10rpx;
}
}
}
}
</style>

+ 22
- 0
pages_order/auth/wxLogin.vue View File

@ -20,6 +20,10 @@
微信登录
</button>
<button class="btn btn-cancel" :plain="true" :hairline="false" @click="onCancel">
暂不登录
</button>
<view class="agreement">
<uv-checkbox-group
v-model="checkboxValue"
@ -88,6 +92,16 @@
this.checkboxValue = []
}
},
onCancel() {
uni.navigateBack({
delta: 1,
fail: () => {
uni.reLaunch({
url: '/pages/index/index'
})
}
});
},
}
}
</script>
@ -134,6 +148,13 @@
font-size: 28rpx;
line-height: 1;
margin: 0;
&-cancel {
color: #c7c7c7;
background-color: transparent;
border: 1rpx solid #c7c7c7;
margin-top: 60rpx;
}
}
.agreement {
@ -147,4 +168,5 @@
color: #05D9A2;
}
}
</style>

+ 5
- 8
pages_order/record/articleSharing.vue View File

@ -248,26 +248,26 @@
return
}
callback(new Error('请输入你的文案'))
callback(new Error('请输入文章内容'))
}
return {
'headImage': {
type: 'string',
required: true,
message: '请选择头像',
message: '请选择封面图',
},
'headTitle': {
type: 'string',
required: true,
message: '请输入你的昵称',
message: '请输入你的文章标题',
},
'num': {
type: 'number',
required: true,
message: '请设置转发次数(大于1)',
message: '请设置转发次数(大于0)',
validator: (rule, value, callback) => {
if (value > 1) {
if (value > 0) {
return true
}
@ -354,9 +354,6 @@
}
},
onPublish() {
// todo
},
}
}


+ 31
- 11
pages_order/record/groupSharing.vue View File

@ -106,6 +106,16 @@
</view>
</uv-form-item>
</view>
<view class="form-item">
<uv-form-item label="文案描述" prop="textDetails" labelPosition="top">
<view style="margin-top: 32rpx;">
<formTextarea
v-model="form.textDetails"
placeholder="请输入你的文案"
></formTextarea>
</view>
</uv-form-item>
</view>
</uv-form>
</view>
@ -147,6 +157,7 @@
memberNum: 50,
num: 0,
wxCodeImage: null,
textDetails: null,
},
rules: {
'headImage': {
@ -172,9 +183,9 @@
'num': {
type: 'number',
required: true,
message: '请设置转发次数(大于1)',
message: '请设置转发次数(大于0)',
validator: (rule, value, callback) => {
if (value > 1) {
if (value > 0) {
return true
}
@ -186,6 +197,11 @@
required: true,
message: '请选择二维码',
},
'textDetails': {
type: 'string',
required: true,
message: '请输入你的文案',
},
},
}
},
@ -212,22 +228,22 @@
},
onShareAppMessage(res) {
const {
headTitle,
textDetails,
indexImage,
} = this.form
let o = {
title : headTitle,
title : textDetails,
imageUrl: indexImage,
path: `/pages_order/sharing/group?id=${this.id}&state=2&shareId=${this.userInfo.id}`
}
//
const params = {
id:this.id,
state:"3",
}
this.$fetch('addLogShareInfo', params)
// todo: get times and check is unlocked
//
const params = {
id:this.id,
state:"3",
}
this.$fetch('addLogShareInfo', params)
this.isLocked = false
@ -246,6 +262,7 @@
memberNum,
num,
wxCodeImage,
textDetails,
status,
} = result || {}
@ -257,6 +274,7 @@
memberNum,
num,
wxCodeImage,
textDetails,
}
this.status = status
} catch (err) {
@ -275,6 +293,7 @@
memberNum,
num,
wxCodeImage,
textDetails,
} = this.form
const params = {
@ -285,6 +304,7 @@
memberNum,
num,
wxCodeImage,
textDetails,
}
if (this.id) {


+ 9
- 13
pages_order/record/personalSharing.vue View File

@ -170,9 +170,9 @@
'num': {
type: 'number',
required: true,
message: '请设置转发次数(大于1)',
message: '请设置转发次数(大于0)',
validator: (rule, value, callback) => {
if (value > 1) {
if (value > 0) {
return true
}
@ -218,9 +218,8 @@
},
onShareAppMessage(res) {
const {
headTitle,
textDetails,
indexImage,
textDetails,
} = this.form
let o = {
@ -229,15 +228,12 @@
path: `/pages_order/sharing/personal?id=${this.id}&state=0&shareId=${this.userInfo.id}`
}
//
const params = {
id:this.id,
state:"0",
}
this.$fetch('addLogShareInfo', params)
//
const params = {
id:this.id,
state:"0",
}
this.$fetch('addLogShareInfo', params)
this.isLocked = false


+ 8
- 9
pages_order/record/videoSharing.vue View File

@ -177,9 +177,9 @@
'num': {
type: 'number',
required: true,
message: '请设置转发次数(大于1)',
message: '请设置转发次数(大于0)',
validator: (rule, value, callback) => {
if (value > 1) {
if (value > 0) {
return true
}
@ -228,13 +228,12 @@
path: `/pages_order/sharing/video?id=${this.id}&state=1&shareId=${this.userInfo.id}`
}
//
const params = {
id:this.id,
state:"0",
}
this.$fetch('addLogShareInfo', params)
// todo: get times and check is unlocked
//
const params = {
id:this.id,
state:"0",
}
this.$fetch('addLogShareInfo', params)
this.isLocked = false


+ 4
- 4
pages_order/sharing/article.vue View File

@ -20,8 +20,6 @@
<popupQrCode ref="popupQrCode" :src="detail.wxCodeImage"></popupQrCode>
<loginPopup ref="loginPopup" @login="initData"/>
</uv-overlay>
</view>
@ -29,7 +27,6 @@
<script>
import { mapState } from 'vuex'
import loginPopup from '@/components/config/loginPopup.vue'
import popupUnlock from '../components/popupUnlock.vue'
import popupQrCode from '../components/popupQrCode.vue'
@ -37,7 +34,6 @@
components: {
popupUnlock,
popupQrCode,
loginPopup,
},
data() {
return {
@ -144,6 +140,8 @@
const result = await this.fetchCheckShare()
const { title, open } = result
console.log('--open', open)
this.$refs.popupUnlock.close();
if (open) {
@ -167,6 +165,8 @@
const result = await this.fetchCheckShare()
const { open, need_num, num } = result
console.log('--open', open)
if (open) { //
this.isLocked = false
this.$refs.popupQrCode.open()


+ 4
- 4
pages_order/sharing/group.vue View File

@ -16,8 +16,6 @@
</view>
</view>
<loginPopup ref="loginPopup" @login="fetchDetails"/>
<popupUnlock ref="popupUnlock" src="../static/sharing/unlock-group.png"></popupUnlock>
</view>
@ -25,12 +23,10 @@
<script>
import { mapState } from 'vuex'
import loginPopup from '@/components/config/loginPopup.vue'
import popupUnlock from '../components/popupUnlock.vue'
export default {
components: {
loginPopup,
popupUnlock,
},
data() {
@ -116,6 +112,8 @@
const result = await this.fetchCheckShare()
const { title, open } = result
console.log('--open', open)
this.$refs.popupUnlock.close();
if (open) {
@ -137,6 +135,8 @@
const result = await this.fetchCheckShare()
const { open, need_num, num } = result
console.log('--open', open)
if (open) { //
this.isLocked = false
return


+ 4
- 0
pages_order/sharing/personal.vue View File

@ -111,6 +111,8 @@
const result = await this.fetchCheckShare()
const { title, open } = result
console.log('--open', open)
this.$refs.popupUnlock.close();
if (open) {
@ -131,6 +133,8 @@
const result = await this.fetchCheckShare()
const { open, need_num, num } = result
console.log('--open', open)
if (open) { //
this.isLocked = false
return


+ 7
- 12
pages_order/sharing/video.vue View File

@ -23,14 +23,12 @@
<uv-overlay :show="timeIsUp" @click="onPlay" zIndex="998">
<popupUnlock ref="popupUnlock" src="../static/sharing/unlock-video.png"></popupUnlock>
<popupQrCode ref="popupQrCode" :src="detail.wxCodeImage"></popupQrCode>
<loginPopup ref="loginPopup" @login="initData"/>
</uv-overlay>
</view>
</template>
<script>
import { mapState } from 'vuex'
import loginPopup from '@/components/config/loginPopup.vue'
import popupUnlock from '../components/popupUnlock.vue'
import popupQrCode from '../components/popupQrCode.vue'
@ -38,7 +36,6 @@
components: {
popupUnlock,
popupQrCode,
loginPopup,
},
data() {
return {
@ -67,6 +64,7 @@
}
},
async onLoad(option) {
console.log('--onLoad', option)
const { id, state, shareId } = option
if (shareId) {
@ -86,7 +84,9 @@
if(uni.getStorageSync('token')){
this.initData()
}else{
this.$refs.loginPopup.open()
uni.navigateTo({
url: '/pages_order/auth/wxLogin'
})
}
},
@ -128,15 +128,12 @@
},
async refreshLockStatus() {
try {
console.log('--refreshLockStatus')
const result = await this.fetchCheckShare()
const { title, open } = result
console.log('--open', open)
this.$refs.popupUnlock.close();
console.log('--close')
if (open) {
this.isLocked = false
@ -149,10 +146,6 @@
icon: 'none'
})
} catch (err) {
console.log('--err', err)
}
},
async onPlay() {
if (!this.isLocked) {
@ -163,6 +156,8 @@
const result = await this.fetchCheckShare()
const { open, need_num, num } = result
console.log('--open', open)
if (open) { //
this.isLocked = false
this.$refs.popupQrCode.open()


BIN
static/image/home/bg.png View File

Before After
Width: 743  |  Height: 1614  |  Size: 189 KiB Width: 1478  |  Height: 3269  |  Size: 468 KiB

+ 5
- 5
store/store.js View File

@ -91,11 +91,11 @@ const store = new Vuex.Store({
uni.navigateBack({
delta: 1,
fail: () => {
uni.reLaunch({
url: '/pages/index/index'
})
}
});
uni.reLaunch({
url: '/pages/index/index'
})
}
});
}
})
}


Loading…
Cancel
Save