Browse Source

feat: 接口对接;

pull/1/head
Fox-33 4 months ago
parent
commit
f44965db89
33 changed files with 1446 additions and 622 deletions
  1. +1
    -1
      App.vue
  2. +8
    -2
      api/api.js
  3. +20
    -0
      api/fetch.js
  4. +21
    -0
      api/model/center.js
  5. +8
    -0
      api/model/info.js
  6. +4
    -4
      api/model/login.js
  7. +122
    -0
      api/model/sharing.js
  8. +5
    -3
      config.js
  9. +5
    -1
      pages.json
  10. +47
    -76
      pages/index/center.vue
  11. +23
    -2
      pages/index/index.vue
  12. +39
    -92
      pages/index/record.vue
  13. +2
    -3
      pages_order/auth/agreementModal.vue
  14. +8
    -29
      pages_order/auth/wxLogin.vue
  15. +15
    -33
      pages_order/auth/wxUserInfo.vue
  16. +1
    -1
      pages_order/components/formInput.vue
  17. +6
    -2
      pages_order/components/formNumberBox.vue
  18. +1
    -1
      pages_order/components/formTextarea.vue
  19. +10
    -18
      pages_order/components/formUpload.vue
  20. +69
    -0
      pages_order/mine/news.vue
  21. +108
    -9
      pages_order/mine/sharing.vue
  22. +2
    -1
      pages_order/mine/team.vue
  23. +169
    -41
      pages_order/record/articleSharing.vue
  24. +177
    -37
      pages_order/record/groupSharing.vue
  25. +163
    -56
      pages_order/record/personalSharing.vue
  26. +161
    -35
      pages_order/record/videoSharing.vue
  27. +62
    -49
      pages_order/sharing/article.vue
  28. +52
    -30
      pages_order/sharing/group.vue
  29. +59
    -38
      pages_order/sharing/personal.vue
  30. +75
    -55
      pages_order/sharing/video.vue
  31. BIN
      pages_order/static/temp-avatar.png
  32. BIN
      pages_order/static/temp-qrcode.png
  33. +3
    -3
      store/store.js

+ 1
- 1
App.vue View File

@ -3,7 +3,7 @@
onLaunch: function() {
},
onShow: function() {
// this.$store.commit('initConfig')
this.$store.commit('initConfig')
},
onHide: function() {
}


+ 8
- 2
api/api.js View File

@ -5,7 +5,7 @@ import utils from '../utils/utils.js'
let limit = {}
let debounce = {}
const models = ['login', 'index', 'vip', 'info']
const models = ['login', 'index', 'center', 'sharing', 'vip', 'info']
const config = {
// 示例
@ -14,7 +14,7 @@ const config = {
// limit : 1000
// },
getConfig : {url : '/config_common/getConfig', method : 'GET', limit : 500},
getConfig : {url : '/all_login/getConfig', method : 'GET', limit : 500},
}
@ -81,6 +81,12 @@ export function api(key, data, callback, loadingTitle) {
loadingTitle || req.showLoading, loadingTitle || req.loadingTitle)
}
export const fetch = (key, data = {}, loadingTitle) => {
return new Promise(resolve => {
api(key, data, resolve, loadingTitle)
})
}
function addApiModel(model, key){
for(let k in model){


+ 20
- 0
api/fetch.js View File

@ -0,0 +1,20 @@
import api from './api.js'
const fetch = (key, data = {}, transform = true, loadingTitle) => {
return new Promise(resolve => {
const callback = (res) => {
if (!transform) {
resolve(res)
return
}
if (res.code == 200) {
resolve(res.result)
}
}
api(key, data, callback, loadingTitle)
})
}
export default fetch

+ 21
- 0
api/model/center.js View File

@ -0,0 +1,21 @@
const api = {
/**
* 获取公告信息
*/
getNotice: {
url: '/all_login/getNotice',
method: 'GET',
auth: true,
},
/**
* 获取动态列表
*/
getNews: {
url: '/all_login/getNews',
method: 'GET',
auth: true,
},
}
export default api

+ 8
- 0
api/model/info.js View File

@ -1,6 +1,14 @@
// 个人相关接口
const api = {
/**
* 获取推广二维码
*/
getQrCode: {
url: '/info/getQrCode',
method: 'GET',
auth: true,
},
}
export default api

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

@ -5,20 +5,20 @@
const api = {
// 微信登录接口
wxLogin: {
url: '/login_common/appletLogin',
url: '/all_login/appletLogin',
method: 'GET',
limit : 500,
showLoading : true,
},
// 获取绑定手机号码
bindPhone: {
url: '/login_common/bindPhone',
url: '/all_login/bindPhone',
method: 'GET',
auth: true,
},
// 修改个人信息接口
updateInfo: {
url: '/info_common/updateInfo',
url: '/info/updateUserInfo',
method: 'POST',
auth: true,
limit : 500,
@ -26,7 +26,7 @@ const api = {
},
// 获取个人信息
getInfo: {
url: '/info_common/getInfo',
url: '/info/getUserInfo',
method: 'GET',
auth: true,
},


+ 122
- 0
api/model/sharing.js View File

@ -0,0 +1,122 @@
const api = {
/**
* 获取个人分享记录详情
*/
getShareInfo: {
url: '/fen/getShareInfo',
method: 'GET',
auth: true,
},
/**
* 增加或者修改个人分享
*/
saveOrUpdateShare: {
url: '/fen/saveOrUpdateShare',
method: 'POST',
auth: true,
limit : 500,
showLoading : true,
},
/**
* 获取视频分享记录详情
*/
getVideoShareInfo: {
url: '/fen/getVideoShareInfo',
method: 'GET',
auth: true,
},
/**
* 增加或者修改视频分享
*/
saveOrUpdateVideoShare: {
url: '/fen/saveOrUpdateVideoShare',
method: 'POST',
auth: true,
limit : 500,
showLoading : true,
},
/**
* 获取群分享记录详情
*/
getGroupShareInfo: {
url: '/fen/getGroupShareInfo',
method: 'GET',
auth: true,
},
/**
* 增加或者修改群分享
*/
saveOrUpdateGroupShare: {
url: '/fen/saveOrUpdateGroupShare',
method: 'POST',
auth: true,
limit : 500,
showLoading : true,
},
/**
* 获取文章分享记录详情
*/
getArticleShareInfo: {
url: '/fen/getArticleShareInfo',
method: 'GET',
auth: true,
},
/**
* 增加或者修改文章分享
*/
saveOrUpdateArticleShare: {
url: '/fen/saveOrUpdateArticleShare',
method: 'POST',
auth: true,
limit : 500,
showLoading : true,
},
/**
* 获取分享记录列表带分页
*/
getSharePage: {
url: '/fen/getSharePage',
method: 'GET',
auth: true,
},
/**
* 校验个人转发是否达标
*/
checkShare: {
url: '/fen/checkShare',
method: 'POST',
auth: true,
},
/**
* 校验视频转发是否达标
*/
checkVideoShare: {
url: '/fen/checkVideoShare',
method: 'POST',
auth: true,
limit : 500,
showLoading : true,
},
/**
* 校验群转发是否达标
*/
checkGroupShare: {
url: '/fen/checkGroupShare',
method: 'POST',
auth: true,
limit : 500,
showLoading : true,
},
/**
* 校验文章转发是否达标
*/
checkArticleShare: {
url: '/fen/checkArticleShare',
method: 'POST',
auth: true,
limit : 500,
showLoading : true,
},
}
export default api

+ 5
- 3
config.js View File

@ -1,22 +1,23 @@
import Vue from 'vue'
import api from '@/api/api.js'
import fetch from '@/api/fetch.js'
import utils from './utils/utils.js'
import uvUI from '@/uni_modules/uv-ui-tools'
Vue.use(uvUI);
// 当前环境
const type = 'dev'
const type = 'prod'
// 环境配置
const config = {
dev : {
baseUrl : 'http://www.gcosc.fun:82',
baseUrl : 'http://h5.xzaiyp.top/fission-star-api',
},
prod : {
baseUrl : 'http://xxx.xxx.xxx/xxx',
baseUrl : 'https://fission-star-api.hhlm1688.com/fission-star-api',
}
}
@ -52,5 +53,6 @@ uni.$uv.setConfig({
Vue.prototype.$config = utils.deepMergeObject(defaultConfig, config[type])
Vue.prototype.$api = api
Vue.prototype.$fetch = fetch
export default Vue.prototype.$config

+ 5
- 1
pages.json View File

@ -8,7 +8,8 @@
{
"path": "pages/index/record",
"style": {
"navigationBarTitleText": ""
"navigationBarTitleText": "",
"enablePullDownRefresh": true
}
},
{
@ -54,6 +55,9 @@
{
"path": "mine/setting"
},
{
"path": "mine/news"
},
{
"path": "mine/sharing"
},


+ 47
- 76
pages/index/center.vue View File

@ -5,20 +5,18 @@
<view class="head">
<view class="headImage">
<!-- todo: 换回接口提供的 -->
<image src="https://thumbnail0.baidupcs.com/thumbnail/a4166d65fm1072cc3d763d59df8feb8a?fid=3983569511-250528-247083465710867&time=1742544000&rt=sh&sign=FDTAER-DCb740ccc5511e5e8fedcff06b081203-8%2Bjq3Cl0GcBe8y3JIzmmJnNofiY%3D&expires=8h&chkv=0&chkbd=0&chkpc=&dp-logid=8765802821729992500&dp-callid=0&file_type=0&size=c850_u580&quality=100&vuk=-&ft=video" mode=""></image>
<image :src="userInfo.headImage" mode=""></image>
</view>
<view class="info">
<view class="name">
<!-- todo: 换回接口提供的 -->
裂变星1号
{{ userInfo.nickName }}
</view>
<view class="tags">
<!-- todo: 换回接口提供的 -->
<view class="tag">
<text class="tag-label">ID:</text>
<text>12345678</text>
<text>{{ userInfo.id }}</text>
</view>
<!-- todo -->
<view v-if="isAgent" style="display: inline-block; width: 172rpx; height: 63rpx; vertical-align: top; margin-top: -6rpx;">
<image src="@/pages_order/static/center/agent-icon.png"></image>
</view>
@ -56,24 +54,28 @@
</template>
</view>
<view class="tools flex">
<!-- todo -->
<view class="tool" @click="$utils.navigateTo('/pages_order/mine/sharing')">
<view class="tool-icon">
<image src="@/pages_order/static/center/tool-share.png"></image>
</view>
<text>分享好友</text>
</view>
<!-- todo -->
<view class="tool" @click="onActivate">
<view class="tool-icon">
<image src="@/pages_order/static/center/tool-activate.png"></image>
</view>
<text>激活码</text>
</view>
<!-- todo -->
<view class="tool" @click="$utils.navigateTo('/pages_order/mine/wallet')">
<view class="tool-icon">
<image src="@/pages_order/static/center/tool-wallet.png"></image>
</view>
<text>我的钱包</text>
</view>
<!-- todo -->
<view class="tool" @click="$utils.navigateTo('/pages_order/mine/team')">
<view class="tool-icon">
<image src="@/pages_order/static/center/tool-team.png"></image>
@ -84,7 +86,7 @@
</view>
<view class="content">
<view class="card notice">
<view class="card notice" v-if="notice">
<view class="notice-icon">
<image src="@/pages_order/static/center/notice.png"></image>
</view>
@ -111,16 +113,16 @@
</view>
<view class="updates-content">
<view class="card updates-item"
v-for="item in updateList"
v-for="(item, index) in list"
:key="item.id"
@click="goToSharingDetail(item.id, item.state)"
@click="goToNewsDetail(item.id, index)"
>
<view class="updates-item-img">
<image :src="item.imageUrl"></image>
<image :src="item.image"></image>
</view>
<view class="updates-item-info">
<view class="updates-item-title">{{ item.title }}</view>
<view class="updates-item-desc">{{ item.description }}</view>
<view class="updates-item-title">{{ item.title || '' }}</view>
<view class="updates-item-desc text-ellipsis">{{ getDesc(item.details) }}</view>
</view>
</view>
</view>
@ -139,93 +141,62 @@
</template>
<script>
import tabber from '@/components/base/tabbar.vue'
import {
mapGetters
} from 'vuex'
import { mapState } from 'vuex'
import mixinsList from '@/mixins/list.js'
import popupActivate from '@/components/center/popupActivate.vue'
const URL_MAPPING = { // state -> url
'-1': '/pages_order/sharing/personal',
'0': '/pages_order/sharing/video',
'1': '/pages_order/sharing/group',
'2': '/pages_order/sharing/article',
}
import tabber from '@/components/base/tabbar.vue'
export default {
mixins : [mixinsList],
components: {
tabber,
popupActivate,
},
computed: {
...mapGetters(['userShop']),
...mapState(['userInfo']),
},
data() {
return {
// todo: agent => role
isAgent: false,
agentDeadline: '2025年12月31日',
notice: '如果您在使用中有任何问题或建议,请联系客服',
updateList: [
{
id: '001',
imageUrl: '../../pages_order/static/center/temp.png',
times: 10,
qrCode: null,
title: '裂变星轻松获客',
description: '如此好用的赚钱项目,赶快加入吧!',
auditStatus: 2,
createTime: '2025年2月1日',
state: -1,
},
{
id: '002',
imageUrl: '../../pages_order/static/center/temp.png',
times: 10,
qrCode: null,
title: '裂变星轻松获客',
description: '如此好用的赚钱项目,赶快加入吧!',
auditStatus: 2,
createTime: '2025年2月1日',
state: 0,
},
{
id: '003',
imageUrl: '../../pages_order/static/center/temp.png',
times: 10,
qrCode: null,
title: '裂变星轻松获客',
description: '如此好用的赚钱项目,赶快加入吧!',
auditStatus: 2,
createTime: '2025年2月1日',
state: 1,
},
{
id: '004',
imageUrl: '../../pages_order/static/center/temp.png',
times: 10,
qrCode: null,
title: '裂变星轻松获客',
description: '如此好用的赚钱项目,赶快加入吧!',
auditStatus: 2,
createTime: '2025年2月1日',
state: 2,
},
]
notice: '',
mixinsListApi : 'getNews',
}
},
onShow() {
// todo:
this.fetchNotice()
this.getData()
},
onReachBottom() {
// todo:
onLoad() {
if (uni.getStorageSync('token') && !this.userInfo?.id) {
this.$store.commit('getUserInfo')
}
},
methods: {
async fetchNotice() {
try {
this.notice = await this.$fetch('getNotice', { id })
} catch (err) {
}
},
onActivate() {
this.$refs.popupActivate.open(this.isAgent)
},
goToSharingDetail(id, state) {
getDesc(str) {
if (!str) {
return ''
}
return str.replace(/<.*?>/g, '')
},
goToNewsDetail(id, index) {
// todo: check
uni.navigateTo({
url: `${URL_MAPPING[state]}?id=${id}`
url: `/pages_order/mine/news?id=${id}&index=${index}`
})
},
}


+ 23
- 2
pages/index/index.vue View File

@ -12,7 +12,7 @@
:key="item.title"
class="btn"
plain
@click="$utils.navigateTo(item.path)"
@click="onClick(item.path)"
>
{{ item.title }}
</button>
@ -24,7 +24,8 @@
</view>
</template>
<script>
<script>
import { mapState } from 'vuex'
import tabber from '@/components/base/tabbar.vue'
export default {
@ -53,6 +54,26 @@
]
}
},
computed: {
...mapState(['userInfo']),
},
onLoad() {
if (uni.getStorageSync('token') && !this.userInfo?.id) {
this.$store.commit('getUserInfo')
}
},
methods: {
onClick(url) {
if (!uni.getStorageSync('token')) {
uni.navigateTo({
url: '/pages_order/auth/wxLogin'
})
return
}
this.$utils.navigateTo(url)
}
},
}
</script>


+ 39
- 92
pages/index/record.vue View File

@ -6,7 +6,9 @@
<view class="content">
<view class="card" style="padding-left: 0; padding-right: 10rpx;">
<uv-tabs :list="tabs"
<uv-tabs
:list="tabs"
@click="clickTabs"
:inactiveStyle="{
color: '#999999',
fontSize: '30rpx',
@ -23,11 +25,10 @@
lineWidth="77rpx"
:lineColor="`url(${sliderBgUrl}) 100% 100%`"
:scrollable="false"
@click="clickTabs"
>
<template v-slot:right>
<suspendDropdown
v-model="queryParams.auditStatus"
v-model="queryParams.status"
:options="auditStatusOptions"
@change="onAuditStatusChange"
></suspendDropdown>
@ -35,19 +36,19 @@
</uv-tabs>
</view>
<view v-if="recordList.records.length > 0" class="card list">
<view v-if="list.length" class="card list">
<view class="list-item"
v-for="item in recordList.records"
v-for="item in list"
@click="toSharingDetail(item.id)"
:key="item.id"
>
<!-- todo: video? -->
<image class="left" :src="item.imageUrl"></image>
<image class="left" :src="item.indexImage || item.headImage"></image>
<view class="right">
<view class="title">{{ item.title }}</view>
<view class="desc">{{ item.description }}</view>
<view class="title">{{ item.headTitle || '' }}</view>
<view class="desc">{{ item.textDetails || '' }}</view>
<view class="bottom">
<text class="desc">{{ item.createTime }}</text>
<text class="desc">{{ item.createTime || '' }}</text>
<button plain class="btn-simple btn-delete flex" @click="onDelete(item.id)">
<image src="../../static/image/record/delete.png" style="width: 24rpx; height: 24rpx;"></image>
<text style="margin-left: 10rpx;">删除</text>
@ -56,13 +57,15 @@
<view class="mark">
<image
:src="auditStatusImgMapping[item.auditStatus]"
:src="auditStatusImgMapping[item.status]"
style="width: 100rpx; height: 100rpx;"
></image>
</view>
</view>
</view>
</view>
<!-- todo: empty -->
</view>
<tabber select="record"/>
@ -70,18 +73,21 @@
</template>
<script>
import { mapGetters } from 'vuex'
import mixinsList from '@/mixins/list.js'
import tabber from '@/components/base/tabbar.vue'
import suspendDropdown from '@/components/base/suspendDropdown.vue'
import { mapGetters } from 'vuex'
const URL_MAPPING = { // state -> url
'-1': '/pages_order/record/personalSharing',
'0': '/pages_order/record/videoSharing',
'1': '/pages_order/record/groupSharing',
'2': '/pages_order/record/articleSharing',
'0': '/pages_order/record/personalSharing',
'1': '/pages_order/record/videoSharing',
'2': '/pages_order/record/groupSharing',
'3': '/pages_order/record/articleSharing',
}
export default {
mixins : [mixinsList],
components : {
tabber,
suspendDropdown,
@ -121,100 +127,40 @@
queryParams: {
pageNo: 1,
pageSize: 10,
auditStatus: null,
status: null,
state: 0,
},
recordList: {
records: [
{
id: '001',
imageUrl: '../../static/image/record/temp.png',
times: 10,
qrCode: null,
title: '裂变星轻松获客',
description: '如此好用的赚钱项目,赶快加入吧!',
auditStatus: 0,
createTime: '2025年2月1日',
},
{
id: '002',
imageUrl: '../../static/image/record/temp.png',
times: 10,
qrCode: null,
title: '裂变星轻松获客',
description: '如此好用的赚钱项目,赶快加入吧!',
auditStatus: 1,
createTime: '2025年2月1日',
},
{
id: '003',
imageUrl: '../../static/image/record/temp.png',
times: 10,
qrCode: null,
title: '裂变星轻松获客',
description: '如此好用的赚钱项目,赶快加入吧!',
auditStatus: 2,
createTime: '2025年2月1日',
},
]
recordList : { //
records : [],
total : 0,
},
// recordList : { //
// records : [],
// total : 0,
// },
state : -1,
auditStatusImgMapping: {
0: '../../static/image/record/audit.png', //
1: '../../static/image/record/pass.png', //
2: '../../static/image/record/fail.png', //
},
sliderBgUrl: 'https://thumbnail0.baidupcs.com/thumbnail/5128034cfj9ac619ca072da4706a6c90?fid=3983569511-250528-294545550145327&time=1742536800&rt=sh&sign=FDTAER-DCb740ccc5511e5e8fedcff06b081203-iqtAvQatpPXXyCeN8GEAHhPMHEM%3D&expires=8h&chkv=0&chkbd=0&chkpc=&dp-logid=8764190582084176609&dp-callid=0&file_type=0&size=c850_u580&quality=100&vuk=-&ft=video'
}
},
onShow() {
this.orderPage()
},
//
onReachBottom() {
if(this.queryParams.pageSize < this.recordList.total){
this.queryParams.pageSize += 10
this.orderPage()
sliderBgUrl: 'https://thumbnail0.baidupcs.com/thumbnail/5128034cfj9ac619ca072da4706a6c90?fid=3983569511-250528-294545550145327&time=1742536800&rt=sh&sign=FDTAER-DCb740ccc5511e5e8fedcff06b081203-iqtAvQatpPXXyCeN8GEAHhPMHEM%3D&expires=8h&chkv=0&chkbd=0&chkpc=&dp-logid=8764190582084176609&dp-callid=0&file_type=0&size=c850_u580&quality=100&vuk=-&ft=video',
mixinsListApi : 'getSharePage',
}
},
methods: {
orderPage(){
// todo
return
let queryParams = {
...this.queryParams,
}
if(this.state != -1){
queryParams.state = this.state
}
this.$api('orderPage', queryParams, res => {
if(res.code == 200){
this.recordList = res.result
}
})
},
//tab
clickTabs(index) {
if (index == 0) {
this.state = -1;
} else {
this.state = index - 1;
}
clickTabs(e) {
this.queryParams.state = e.index
this.queryParams.pageNo = 1
this.queryParams.pageSize = 10
this.orderPage()
this.getData()
},
onAuditStatusChange(auditStatus) {
// todo
// fetch list
onAuditStatusChange(status) {
this.status = status
this.queryParams.pageNo = 1
this.queryParams.pageSize = 10
this.getData()
},
//
toSharingDetail(id) {
uni.navigateTo({
url: `${URL_MAPPING[this.state]}?id=${id}`
url: `${URL_MAPPING[this.queryParams.state]}?id=${id}`
})
},
onDelete(id) {
@ -266,6 +212,7 @@
color: #999999;
font-size: 24rpx;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
text-align: left;
}


+ 2
- 3
pages_order/auth/agreementModal.vue View File

@ -9,11 +9,10 @@
</view>
</view>
<view class="content">
<!-- todo: 替换成接口获取 -->
请您务必审慎阅读充分理解用户协议和隐私政策各条款包括但不限于用户注意事项用户行为规范以及为了向你提供服务而收集使用存储你个人信息的情况等你可阅读
<text class="highlight" @click="$refs.popup.open('getUserAgreement')">裂变星小程序用户服务协议</text>
<text class="highlight" @click="$refs.popup.open('user_xy')">裂变星小程序用户服务协议</text>
<text class="highlight" @click="$refs.popup.open('getPrivacyPolicy')">裂变星小程序平台隐私权政策</text>
<text class="highlight" @click="$refs.popup.open('user_ys')">裂变星小程序平台隐私权政策</text>
了解详细信息如你同意请点击下方按钮开始接受我们的服务
</view>
<view class="footer flex">


+ 8
- 29
pages_order/auth/wxLogin.vue View File

@ -4,12 +4,10 @@
<view class="flex flex-column" style="justify-content: flex-start;">
<!-- todo: 换回接口提供的 -->
<image class="logo" src="../static/auth/logo.png" mode=""></image>
<image class="logo" :src="userInfo.headImage" mode=""></image>
<view class="title">
<!-- todo: 换回接口提供的 -->
裂变星小程序
{{ userInfo.nickName }}
</view>
<view class="operation">
@ -17,10 +15,9 @@
<button
:plain="true" :hairline="false"
class="btn"
open-type="getPhoneNumber"
@getphonenumber="getPhoneNumber"
@click="wxLogin"
>
授权手机号登录
微信登录
</button>
<view class="agreement">
@ -55,6 +52,7 @@
</template>
<script>
import { mapState } from 'vuex'
import agreementModal from './agreementModal.vue'
export default {
@ -67,29 +65,10 @@
checkboxValue : []
}
},
computed: {
...mapState(['userInfo']),
},
methods: {
getPhoneNumber(e){
console.log(e, e.detail.code);
// check
// this.$api('bindPhone', {
// phoneCode : e.detail.code
// }, res => {
// if(res.code == 200){
// let phoneObj = JSON.parse(res.result)
// if(phoneObj.errmsg == 'ok'){
// this.userInfoForm.phone = phoneObj.phone_info.phoneNumber
// }else{
// uni.showModal({
// title: phoneObj.errmsg
// })
// }
// console.log(phoneObj);
// }
// })
this.wxLogin(phoneCode)
},
wxLogin(){
if(!this.checkboxValue.length){
return uni.showToast({


+ 15
- 33
pages_order/auth/wxUserInfo.vue View File

@ -1,12 +1,10 @@
<template>
<view class="page flex flex-column">
<!-- todo: 换回接口提供的 -->
<image class="logo" src="../static/auth/logo.png" mode=""></image>
<image class="logo" :src="userInfo.headImage" mode=""></image>
<view class="title">
<!-- todo: 换回接口提供的 -->
裂变星小程序
{{ userInfo.nickName }}
</view>
<view class="desc">
@ -51,39 +49,15 @@
</view>
<view class="content">
<input
id="nickName"
type="nickname"
id="wxCode"
type="wxCode"
placeholder="请输入微信号"
style="text-align: right;"
placeholder-class="auth-placeholder"
v-model="userInfoForm.nickName"
v-model="userInfoForm.wxCode"
/>
</view>
</view>
<!-- <view class="form-item">
<view class="label">
手机号
</view>
<view class="content">
<input v-if="userInfoForm.phone"
placeholder-class="auth-placeholder"
placeholder="请输入手机号"
style="text-align: right;"
disabled
v-model="userInfoForm.phone"
/>
<view v-else>
<button
:plain="true" :hairline="false"
class="btn-phone"
open-type="getPhoneNumber"
@getphonenumber="getPhone"
>
获取电话号码
</button>
</view>
</view>
</view> -->
</view>
@ -107,6 +81,8 @@
</template>
<script>
import { mapState } from 'vuex'
export default {
data() {
return {
@ -114,14 +90,19 @@
headImage: '',
nickName: '',
phone : '',
wxCode : '',
}
};
},
computed: {
...mapState(['userInfo']),
},
onShow() {},
onLoad() {
this.userInfoForm.phone = this.userInfo.phone || ''
this.userInfoForm.nickName = this.userInfo.nickName || ''
this.userInfoForm.headImage = this.userInfo.headImage || ''
this.userInfoForm.wxCode = this.userInfo.wxCode || ''
},
computed: {},
methods: {
@ -133,7 +114,7 @@
},
getPhone(e){
this.$api('bindPhone', {
phoneCode : e.detail.code
code : e.detail.code
}, res => {
if(res.code == 200){
let phoneObj = JSON.parse(res.result)
@ -169,9 +150,10 @@
}
self.$api('updateInfo', {
avatarUrl : self.userInfoForm.headImage,
headImage : self.userInfoForm.headImage,
nickName : self.userInfoForm.nickName,
phone : self.userInfoForm.phone,
wxCode : self.userInfoForm.wxCode,
}, res => {
if (res.code == 200) {
uni.reLaunch({


+ 1
- 1
pages_order/components/formInput.vue View File

@ -1,7 +1,7 @@
<template>
<uv-input
:value="value"
@input="$emit('input', value)"
@input="$emit('input', $event)"
:placeholder="placeholder"
:placeholderStyle="{
color: '#999999',


+ 6
- 2
pages_order/components/formNumberBox.vue View File

@ -2,9 +2,10 @@
<view class="number-box">
<uv-number-box
:value="value"
@input="$emit('input', value)"
@input="$emit('input', $event)"
:min="1"
integer
:inputWidth="inputWidth"
button-size="60rpx"
bgColor="#F3F3F3"
color="#000000"
@ -22,7 +23,10 @@
min: {
type: Number,
default: 1,
}
},
inputWidth: {
default: '50rpx'
},
},
data() {
return {


+ 1
- 1
pages_order/components/formTextarea.vue View File

@ -1,7 +1,7 @@
<template>
<uv-textarea
:value="value"
@input="$emit('input', value)"
@input="$emit('input', $event)"
:placeholder="placeholder"
:count="count"
:maxlength="maxlength"


+ 10
- 18
pages_order/components/formUpload.vue View File

@ -1,11 +1,11 @@
<template>
<view>
<uv-upload
:fileList="fileList"
:multiple="multiple"
:maxCount="maxCount"
:accept="accept"
:maxCount="1"
:width="width"
:height="height"
:previewImage="false"
@afterRead="afterRead"
@delete="deleteFile"
>
@ -21,13 +21,9 @@
value: {
default: null
},
multiple: {
type: Boolean,
default: false,
},
maxCount: {
type: Number,
default: 1,
accept: {
type: String,
default: 'image' // all | media | image | file | video
},
width: {
type: Number | String,
@ -49,14 +45,10 @@
this.$emit('input', null)
},
afterRead(e){
let self = this
e.file.forEach(file => {
self.$Oss.ossUpload(file.url).then(url => {
self.fileList = [url]
self.$emit('input', url)
})
})
this.$Oss.ossUpload(e.file.url).then(url => {
this.fileList = [url]
this.$emit('input', url)
})
},
},
}


+ 69
- 0
pages_order/mine/news.vue View File

@ -0,0 +1,69 @@
<template>
<view>
<navbar title="动态详情" leftClick @leftClick="$utils.navigateBack" />
<view class="content">
<view class="title">{{ detail.title || '' }}</view>
<view class="desc">{{ detail.createTime ? `发布于${detail.createTime}` : '' }}</view>
<uv-parse :content="detail.details"></uv-parse>
</view>
</view>
</template>
<script>
import popupUnlock from '../components/popupUnlock.vue'
import popupQrCode from '../components/popupQrCode.vue'
export default {
components: {
popupUnlock,
popupQrCode,
},
data() {
return {
detail: {
id: null,
title: null,
image: null,
details: null,
createTime: null,
},
isLocked: true,
}
},
async onLoad(option) {
const { id, index } = option
await this.fetchDetails(id, index)
},
methods: {
async fetchDetails(id, index) {
try {
this.detail = (await this.$fetch('getNews'))?.records[index]
} catch (err) {
}
},
}
}
</script>
<style scoped lang="scss">
.content {
padding: 40rpx 20rpx;
}
.title {
color: #474747;
font-size: 36rpx;
font-weight: 700;
}
.desc {
color: #A2A2A2;
font-size: 24rpx;
margin-top: 6rpx;
}
</style>

+ 108
- 9
pages_order/mine/sharing.vue View File

@ -3,33 +3,130 @@
<navbar title="分享好友" leftClick @leftClick="$utils.navigateBack" />
<view class="flex content">
<image class="bg" :src="imgurl"></image>
<view style="width: 598rpx; height: 1063rpx;">
<canvas id="myCanvas" canvasId="qrCanvas" type="2d" style="width: 100%; height: 100%;"></canvas>
</view>
<view class="flex btns">
<button class="btn btn-back" @click="$utils.navigateBack">返回</button>
<button plain class="btn btn-save" @click="saveImg" >保存到相册</button>
<button class="flex btn btn-back" @click="$utils.navigateBack">返回</button>
<button plain class="flex btn btn-save" @click="saveImg" >保存到相册</button>
</view>
</view>
</view>
</template>
<script>
import { mapState } from 'vuex'
export default {
data() {
return {
imgurl: null,
wxCodeImage: null,
imgurl: '',
canvas: {},
}
},
computed : {
...mapState(['configList'])
},
onLoad() {
// todo: fetch imgurl
this.imgurl = 'https://thumbnail0.baidupcs.com/thumbnail/e197d6114s94f565050bdb6183d0f342?fid=3983569511-250528-62736802919901&time=1742544000&rt=sh&sign=FDTAER-DCb740ccc5511e5e8fedcff06b081203-SVTG9Opgq1cgWFL%2Fl97Up9GXZgo%3D&expires=8h&chkv=0&chkbd=0&chkpc=&dp-logid=8765779362428703473&dp-callid=0&file_type=0&size=c850_u580&quality=100&vuk=-&ft=video'
},
onReady() {
this.fetchQrCode()
},
methods: {
async fetchQrCode() {
try {
this.wxCodeImage = await this.$fetch('getQrCode')
this.draw()
} catch (err) {
}
},
draw() {
uni.showLoading({
title: "拼命绘画中..."
})
wx.createSelectorQuery()
.select('#myCanvas') // canvasid
.fields({
node: true,
size: true
})
.exec(async (res) => {
const canvas = res[0].node
//
const ctx = canvas.getContext('2d')
// Canvas
const width = res[0].width
const height = res[0].height
//
const dpr = wx.getWindowInfo().pixelRatio
//dpr
// dpr 2 4
// 3 6
console.log("--dpr", dpr)
canvas.width = width * dpr
canvas.height = height * dpr
let Ratio = canvas.width / 598
this.canvas = canvas
ctx.scale(dpr, dpr)
ctx.clearRect(0, 0, width, height)
//
const bgImage = canvas.createImage()
bgImage.src = this.configList.index_lvxing || 'https://image.hhlm1688.com//upload/组3833x_1742803627396.png'
bgImage.onload = () => {
ctx.drawImage(bgImage, 0, 0, width, height)
//
const coderImage = canvas.createImage()
coderImage.src = this.wxCodeImage
coderImage.onload = () => {
const x = 197 * Ratio / dpr
const y = 562 * Ratio / dpr
const size = 206 * Ratio / dpr
ctx.drawImage(coderImage, x, y, size, size)
uni.hideLoading()
}
}
})
},
saveImg(){
this.$authorize('scope.writePhotosAlbum').then((res) => {
this.imgApi(this.imgurl)
this.imgApi()
})
},
imgApi(image) {
imgApi() {
wx.canvasToTempFilePath({
x: 0,
y: 0,
width: this.canvas.width,
height: this.canvas.height,
canvas: this.canvas,
success: (res) => {
let tempFilePath = res.tempFilePath;
this.saveImgToPhone(tempFilePath)
},
fail: (err) => {
console.log('--canvasToTempFilePath--fail', err)
}
}, this);
},
saveImgToPhone(image) {
/* 获取图片的信息 */
uni.getImageInfo({
src: image,
@ -50,7 +147,7 @@
});
}
});
},
}
},
}
</script>
@ -78,9 +175,11 @@
}
.btn {
display: inline-flex;
width: 280rpx;
height: 90rpx;
font-size: 36rpx;
line-height: 1;
color: #FFFFFF;
border-radius: 45rpx;
margin: 0;


+ 2
- 1
pages_order/mine/team.vue View File

@ -205,7 +205,8 @@
})
},
//tab
clickTabs(index) {
clickTabs(e) {
const { index } = e
if (index == 0) {
this.state = -1;
} else {


+ 169
- 41
pages_order/record/articleSharing.vue View File

@ -6,7 +6,7 @@
<uv-form
ref="form"
:model="form"
:rules="rules"
:rules="getRules()"
labelPosition="left"
labelWidth="300rpx"
:labelStyle="{
@ -14,25 +14,24 @@
fontSize: '32rpx',
fontWeight: 'bold',
}"
>
errorType="toast"
>
<view class="form-item">
<uv-form-item label="用户ID" prop="id">
<uv-form-item label="用户ID" prop="userId">
<view class="form-item-content">
<template v-if="form.id">
<text>{{ form.id }}</text>
<view style="margin-left: 20rpx;">
<button class="btn-simple" plain @click="$utils.copyText(form.id)">
<uv-icon name="file-text" color="#05D9A2" size="28rpx"></uv-icon>
</button>
</view>
</template>
<text>{{ userId }}</text>
<view style="margin-left: 20rpx;">
<button class="btn-simple" plain @click="$utils.copyText(userId)">
<uv-icon name="file-text" color="#05D9A2" size="28rpx"></uv-icon>
</button>
</view>
</view>
</uv-form-item>
</view>
<view class="form-item">
<uv-form-item label="选择封面图" prop="imageUrl">
<uv-form-item label="选择封面图" prop="headImage">
<view class="form-item-content">
<formUpload v-model="form.imageUrl">
<formUpload v-model="form.headImage">
<template v-slot="{ value }">
<view class="flex" style="min-width: 116rpx; height: 45rpx;">
<image
@ -49,23 +48,23 @@
</uv-form-item>
</view>
<view class="form-item">
<uv-form-item label="标题" labelWidth="84rpx" prop="title">
<uv-form-item label="标题" labelWidth="84rpx" prop="headTitle">
<view class="form-item-content">
<formInput v-model="form.title" placeholder="请输入你的文章标题" width="584rpx"></formInput>
<formInput v-model="form.headTitle" placeholder="请输入你的文章标题" width="584rpx"></formInput>
</view>
</uv-form-item>
</view>
<view class="form-item">
<uv-form-item label="设置转发次数(次)" prop="times">
<uv-form-item label="设置转发次数(次)" prop="num">
<view class="form-item-content">
<formNumberBox v-model="form.times" ></formNumberBox>
<formNumberBox v-model="form.num" ></formNumberBox>
</view>
</uv-form-item>
</view>
<view class="form-item">
<uv-form-item label="选择二维码" prop="qrCode">
<uv-form-item label="选择二维码" prop="wxCodeImage">
<view class="form-item-content">
<formUpload v-model="form.qrCode">
<formUpload v-model="form.wxCodeImage">
<template v-slot="{ value }">
<view class="flex" style="min-width: 93rpx; height: 45rpx;">
<image
@ -82,7 +81,7 @@
</uv-form-item>
</view>
<view class="form-item">
<uv-form-item label="文章内容" prop="description" labelPosition="top">
<uv-form-item label="文章内容" prop="textDetails" labelPosition="top">
<view class="editor__view" style="margin-top: 32rpx;">
<editor id="editor" class="editor"
placeholder="请输入你的文章内容"
@ -106,17 +105,19 @@
</view>
<!-- 审核通过 -->
<button v-if="auditStatus === 1" class="button-submit" @click="onPublish">
<button v-if="status === 1" class="button-submit" open-type="share">
发布
</button>
<!-- 不是 审核中 已发布 -> 创建分享 审核不通过 -->
<button v-else-if="![0,2].includes(auditStatus)" class="button-submit" @click="onSubmit">
<button v-else-if="![0,1].includes(status)" class="button-submit" @click="onSubmit">
提交审核
</button>
</view>
</template>
<script>
import { mapState } from 'vuex'
import formInput from '../components/formInput.vue'
import formNumberBox from '../components/formNumberBox.vue'
import formUpload from '../components/formUpload.vue'
@ -132,29 +133,55 @@
data() {
return {
id: null,
auditStatus: null,
status: null,
form: {
id: null,
imageUrl: null,
title: null,
times: 10,
qrCode: null,
description: null,
},
rules: {
// todo
userId: null,
headImage: null,
headTitle: null,
num: 10,
wxCodeImage: null,
textDetails: null,
},
editorCtx: null,
descLen: 0,
descLengthLimit: 1000,
}
},
computed: {
...mapState(['userInfo']),
userId() {
return this.form.userId || this.userInfo?.id
},
},
onLoad(option) {
const { id } = option
if (!id) {
return
}
this.id = id
// todo: init data by id
this.fetchDetails(id)
},
onShareAppMessage(res) {
const {
headTitle,
indexImage,
} = this.form
let o = {
title : headTitle,
imageUrl: indexImage,
path: `/pages_order/sharing/article?id=${this.id}`
}
// todo: get times and check is unlocked
this.isLocked = false
return o
},
methods: {
onEditorReady() {
uni.createSelectorQuery().select('#editor').context((res) => {
@ -185,7 +212,18 @@
}
})
},
getEditroContents() {
setEditorContents(html) {
if (!this.editorCtx) {
setTimeout(() => {
this.setEditorContents(html)
}, 200)
return
}
this.editorCtx.setContents({ html })
},
getEditorContents() {
return new Promise((resolve, reject) => {
this.editorCtx.getContents({
success: (e) => {
@ -198,21 +236,111 @@
})
})
},
getRules() {
const textDetailsValidator = async (rule, value, callback) => {
const textDetails = (await this.getEditorContents())?.html
if (textDetails) {
callback()
return
}
callback(new Error('请输入你的文案'))
}
return {
'headImage': {
type: 'string',
required: true,
message: '请选择头像',
},
'headTitle': {
type: 'string',
required: true,
message: '请输入你的昵称',
},
'num': {
type: 'number',
required: true,
message: '请设置转发次数',
},
'wxCodeImage': {
type: 'string',
required: true,
message: '请选择二维码',
},
'textDetails': {
asyncValidator: textDetailsValidator,
},
}
},
async fetchDetails(id) {
try {
const result = await this.$fetch('getArticleShareInfo', { id })
const {
userId,
headImage,
headTitle,
num,
wxCodeImage,
textDetails,
status,
} = result || {}
this.form = {
userId,
headImage,
headTitle,
num,
wxCodeImage,
textDetails,
}
this.status = status
this.setEditorContents(textDetails)
} catch (err) {
}
},
async onSubmit() {
try {
const description = (await this.getEditroContents())?.html
await this.$refs.form.validate()
const textDetails = (await this.getEditorContents())?.html
// todo: decode?
console.log(description)
console.log(textDetails)
return
const {
headImage,
headTitle,
indexImage,
num,
wxCodeImage,
} = this.form
const params = { ...this.form, description }
// todo
const params = {
id: this.id,
userId: this.userId,
headImage,
headTitle,
indexImage,
num,
wxCodeImage,
textDetails,
}
await this.$fetch('saveOrUpdateArticleShare', params)
this.$api('submitPersonalSharing', params)
uni.showToast({
title: '提交成功',
icon: 'none'
})
setTimeout(uni.navigateBack, 1000, -1)
} catch (err) {
}


+ 177
- 37
pages_order/record/groupSharing.vue View File

@ -14,32 +14,50 @@
fontSize: '32rpx',
fontWeight: 'bold',
}"
>
errorType="toast"
>
<view class="form-item">
<uv-form-item label="用户ID" prop="id">
<uv-form-item label="用户ID" prop="userId">
<view class="form-item-content">
<template v-if="form.id">
<text>{{ form.id }}</text>
<view style="margin-left: 20rpx;">
<button class="btn-simple" plain @click="$utils.copyText(form.id)">
<uv-icon name="file-text" color="#05D9A2" size="28rpx"></uv-icon>
</button>
</view>
</template>
<text>{{ userId }}</text>
<view style="margin-left: 20rpx;">
<button class="btn-simple" plain @click="$utils.copyText(userId)">
<uv-icon name="file-text" color="#05D9A2" size="28rpx"></uv-icon>
</button>
</view>
</view>
</uv-form-item>
</view>
<view class="form-item">
<uv-form-item label="群名称" labelWidth="105rpx" prop="groupName">
<uv-form-item label="选择群头像" prop="headImage">
<view class="form-item-content">
<formInput v-model="form.groupName" placeholder="请输入你的群名称" width="540rpx"></formInput>
<formUpload v-model="form.headImage">
<template v-slot="{ value }">
<view class="flex" style="min-width: 116rpx; height: 45rpx;">
<image
:src="value"
mode="aspectFill"
style="width: 68rpx; height: 68rpx;"
radius="14rpx"
/>
<uv-icon style="margin-left: 20rpx" name="arrow-right" color="#000000" size="28rpx"></uv-icon>
</view>
</template>
</formUpload>
</view>
</uv-form-item>
</view>
<view class="form-item">
<uv-form-item label="选择群封面图" prop="imageUrl">
<uv-form-item label="群名称" labelWidth="105rpx" prop="headTitle">
<view class="form-item-content">
<formUpload v-model="form.imageUrl">
<formInput v-model="form.headTitle" placeholder="请输入你的群名称" width="540rpx"></formInput>
</view>
</uv-form-item>
</view>
<view class="form-item">
<uv-form-item label="选择群封面图" prop="indexImage">
<view class="form-item-content">
<formUpload v-model="form.indexImage">
<template v-slot="{ value }">
<view class="flex" style="min-width: 116rpx; height: 45rpx;">
<image
@ -56,23 +74,23 @@
</uv-form-item>
</view>
<view class="form-item">
<uv-form-item label="群人数(人)" prop="peopleNumber">
<uv-form-item label="群人数(人)" prop="memberNum">
<view class="form-item-content">
<formNumberBox v-model="form.peopleNumber" :min="3" ></formNumberBox>
<formNumberBox v-model="form.memberNum" :min="3"></formNumberBox>
</view>
</uv-form-item>
</view>
<view class="form-item">
<uv-form-item label="设置转发次数(次)" prop="times">
<uv-form-item label="设置转发次数(次)" prop="num">
<view class="form-item-content">
<formNumberBox v-model="form.times" ></formNumberBox>
<formNumberBox v-model="form.num"></formNumberBox>
</view>
</uv-form-item>
</view>
<view class="form-item">
<uv-form-item label="选择二维码" prop="qrCode">
<uv-form-item label="选择二维码" prop="wxCodeImage">
<view class="form-item-content">
<formUpload v-model="form.qrCode">
<formUpload v-model="form.wxCodeImage">
<template v-slot="{ value }">
<view class="flex" style="min-width: 93rpx; height: 45rpx;">
<image
@ -92,17 +110,19 @@
</view>
<!-- 审核通过 -->
<button v-if="auditStatus === 1" class="button-submit" @click="onPublish">
<button v-if="status === 1" class="button-submit" open-type="share">
发布
</button>
<!-- 不是 审核中 已发布 -> 创建分享 审核不通过 -->
<button v-else-if="![0,2].includes(auditStatus)" class="button-submit" @click="onSubmit">
<button v-else-if="![0,1].includes(status)" class="button-submit" @click="onSubmit">
提交审核
</button>
</view>
</template>
<script>
import { mapState } from 'vuex'
import formInput from '../components/formInput.vue'
import formNumberBox from '../components/formNumberBox.vue'
import formUpload from '../components/formUpload.vue'
@ -118,33 +138,153 @@
data() {
return {
id: null,
auditStatus: null,
status: null,
form: {
id: null,
groupName: null,
imageUrl: null,
peopleNumber: 200,
times: 10,
qrCode: null,
userId: null,
headImage: null,
headTitle: null,
indexImage: null,
memberNum: 200,
num: 10,
wxCodeImage: null,
},
rules: {
// todo
},
'headImage': {
type: 'string',
required: true,
message: '请选择群封面图',
},
'headTitle': {
type: 'string',
required: true,
message: '请输入你的群名称',
},
'indexImage': {
type: 'string',
required: true,
message: '请选择群封面图',
},
'memberNum': {
type: 'number',
required: true,
message: '请填写群人数',
},
'num': {
type: 'number',
required: true,
message: '请设置转发次数',
},
'wxCodeImage': {
type: 'string',
required: true,
message: '请选择二维码',
},
},
}
},
computed: {
...mapState(['userInfo']),
userId() {
return this.form.userId || this.userInfo?.id
},
},
onLoad(option) {
const { id } = option
if (!id) {
return
}
this.id = id
// todo: init data by id
this.fetchDetails(id)
},
onShareAppMessage(res) {
const {
headTitle,
indexImage,
} = this.form
let o = {
title : headTitle,
imageUrl: indexImage,
path: `/pages_order/sharing/group?id=${this.id}`
}
// todo: get times and check is unlocked
this.isLocked = false
return o
},
methods: {
onSubmit() {
// todo
async fetchDetails(id) {
try {
const result = await this.$fetch('getGroupShareInfo', { id })
const {
userId,
headImage,
headTitle,
indexImage,
memberNum,
num,
wxCodeImage,
status,
} = result || {}
this.form = {
userId,
headImage,
headTitle,
indexImage,
memberNum,
num,
wxCodeImage,
}
this.status = status
} catch (err) {
}
},
async onSubmit() {
try {
await this.$refs.form.validate()
const {
headImage,
headTitle,
indexImage,
memberNum,
num,
wxCodeImage,
} = this.form
const params = {
id: this.id,
userId: this.userId,
headImage,
headTitle,
indexImage,
memberNum,
num,
wxCodeImage,
}
await this.$fetch('saveOrUpdateGroupShare', params)
uni.showToast({
title: '提交成功',
icon: 'none'
})
setTimeout(uni.navigateBack, 1000, -1)
} catch (err) {
}
const params = { ...this.form }
this.$api('submitPersonalSharing', params)
},
onPublish() {
// todo


+ 163
- 56
pages_order/record/personalSharing.vue View File

@ -14,24 +14,22 @@
fontSize: '32rpx',
fontWeight: 'bold',
}"
errorType="toast"
>
<view class="form-item">
<uv-form-item label="用户ID" prop="id">
<uv-form-item label="用户ID" prop="userId">
<view class="form-item-content">
<template v-if="form.id">
<text>{{ form.id }}</text>
<view style="margin-left: 20rpx;">
<button class="btn-simple" plain @click="$utils.copyText(form.id)">
<uv-icon name="file-text" color="#05D9A2" size="28rpx"></uv-icon>
</button>
</view>
</template>
<text>{{ userId }}</text>
<view style="margin-left: 20rpx;">
<button class="btn-simple" plain @click="$utils.copyText(userId)">
<uv-icon name="file-text" color="#05D9A2" size="28rpx"></uv-icon>
</button>
</view>
</view>
</uv-form-item>
</view>
<!-- todo: 选择头像 -->
<view class="form-item">
<uv-form-item label="选择头像" prop="imageUrl">
<uv-form-item label="选择头像" prop="headImage">
<view class="form-item-content">
<button
class="btn-avatar"
@ -41,38 +39,25 @@
@chooseavatar="onChooseAvatar"
>
<image
:src="form.avatarUrl || '../static/auth/avatar.png'"
:src="form.headImage || '../static/auth/avatar.png'"
style="width: 68rpx; height: 68rpx;"
mode=""
></image>
</button>
<!-- <formUpload v-model="form.avatarUrl">
<template v-slot="{ value }">
<view class="flex" style="min-width: 116rpx; height: 45rpx;">
<image
:src="value"
mode="aspectFill"
style="width: 68rpx; height: 68rpx;"
radius="14rpx"
/>
<uv-icon style="margin-left: 20rpx" name="arrow-right" color="#000000" size="28rpx"></uv-icon>
</view>
</template>
</formUpload> -->
</view>
</uv-form-item>
</view>
<view class="form-item">
<uv-form-item label="昵称" labelWidth="105rpx" prop="nickName">
<uv-form-item label="昵称" labelWidth="105rpx" prop="headTitle">
<view class="form-item-content">
<formInput v-model="form.nickName" placeholder="请输入你的群名称" width="540rpx"></formInput>
<formInput v-model="form.headTitle" placeholder="请输入你的昵称" width="540rpx"></formInput>
</view>
</uv-form-item>
</view>
<view class="form-item">
<uv-form-item label="选择封面图" prop="imageUrl">
<uv-form-item label="选择封面图" prop="indexImage">
<view class="form-item-content">
<formUpload v-model="form.imageUrl">
<formUpload v-model="form.indexImage">
<template v-slot="{ value }">
<view class="flex" style="min-width: 116rpx; height: 45rpx;">
<image
@ -89,16 +74,16 @@
</uv-form-item>
</view>
<view class="form-item">
<uv-form-item label="设置转发次数(次)" prop="times">
<uv-form-item label="设置转发次数(次)" prop="num">
<view class="form-item-content">
<formNumberBox v-model="form.times" ></formNumberBox>
<formNumberBox v-model="form.num" ></formNumberBox>
</view>
</uv-form-item>
</view>
<view class="form-item">
<uv-form-item label="选择二维码" prop="qrCode">
<uv-form-item label="选择二维码" prop="wxCodeImage">
<view class="form-item-content">
<formUpload v-model="form.qrCode">
<formUpload v-model="form.wxCodeImage">
<template v-slot="{ value }">
<view class="flex" style="min-width: 93rpx; height: 45rpx;">
<image
@ -115,10 +100,10 @@
</uv-form-item>
</view>
<view class="form-item">
<uv-form-item label="文案描述" prop="description" labelPosition="top">
<uv-form-item label="文案描述" prop="textDetails" labelPosition="top">
<view style="margin-top: 32rpx;">
<formTextarea
v-model="form.description"
v-model="form.textDetails"
placeholder="请输入你的文案"
></formTextarea>
</view>
@ -128,17 +113,19 @@
</view>
<!-- 审核通过 -->
<button v-if="auditStatus === 1" class="button-submit" @click="onPublish">
<button v-if="status === 1" class="button-submit" open-type="share">
发布
</button>
<!-- 不是 审核中 已发布 -> 创建分享 审核不通过 -->
<button v-else-if="![0,2].includes(auditStatus)" class="button-submit" @click="onSubmit">
<button v-else-if="![0,1].includes(status)" class="button-submit" @click="onSubmit">
提交审核
</button>
</view>
</template>
<script>
import { mapState } from 'vuex'
import formInput from '../components/formInput.vue'
import formNumberBox from '../components/formNumberBox.vue'
import formUpload from '../components/formUpload.vue'
@ -154,43 +141,163 @@
data() {
return {
id: null,
auditStatus: null,
status: null,
form: {
id: null,
avatarUrl: null,
nickName: null,
imageUrl: null,
times: 10,
qrCode: null,
description: null,
userId: null,
headImage: null,
headTitle: null,
indexImage: null,
num: 10,
wxCodeImage: null,
textDetails: null,
},
rules: {
// todo
},
'headImage': {
type: 'string',
required: true,
message: '请选择头像',
},
'headTitle': {
type: 'string',
required: true,
message: '请输入你的昵称',
},
'indexImage': {
type: 'string',
required: true,
message: '请选择封面图',
},
'num': {
type: 'number',
required: true,
message: '请设置转发次数',
},
'wxCodeImage': {
type: 'string',
required: true,
message: '请选择二维码',
},
'textDetails': {
type: 'string',
required: true,
message: '请输入你的文案',
},
},
}
},
computed: {
...mapState(['userInfo']),
userId() {
return this.form.userId || this.userInfo?.id
},
disabled() {
// todo
return ![0, 1].includes(this.status)
}
},
onLoad(option) {
const { id } = option
if (!id) {
return
}
this.id = id
// todo: init data by id
this.fetchDetails(id)
},
onShareAppMessage(res) {
const {
headTitle,
indexImage,
} = this.form
let o = {
title : headTitle,
imageUrl: indexImage,
path: `/pages_order/sharing/personal?id=${this.id}`
}
// todo: get times and check is unlocked
this.isLocked = false
return o
},
methods: {
onChooseAvatar(res) {
this.$Oss.ossUpload(res.target.avatarUrl)
.then(url => {
this.form.avatarUrl = url
this.form.headImage = url
})
},
onSubmit() {
// todo
async fetchDetails(id) {
try {
const result = await this.$fetch('getShareInfo', { id })
const {
userId,
headImage,
headTitle,
indexImage,
num,
wxCodeImage,
textDetails,
status,
} = result || {}
const params = { ...this.form }
this.$api('submitPersonalSharing', params)
this.form = {
userId,
headImage,
headTitle,
indexImage,
num,
wxCodeImage,
textDetails,
}
this.status = status
} catch (err) {
}
},
onPublish() {
// todo
async onSubmit() {
try {
await this.$refs.form.validate()
const {
headImage,
headTitle,
indexImage,
num,
wxCodeImage,
textDetails,
} = this.form
const params = {
id: this.id,
userId: this.userId,
headImage,
headTitle,
indexImage,
num,
wxCodeImage,
textDetails,
}
await this.$fetch('saveOrUpdateShare', params)
uni.showToast({
title: '提交成功',
icon: 'none'
})
setTimeout(uni.navigateBack, 1000, -1)
} catch (err) {
}
},
}
}


+ 161
- 35
pages_order/record/videoSharing.vue View File

@ -14,11 +14,12 @@
fontSize: '32rpx',
fontWeight: 'bold',
}"
>
errorType="toast"
>
<view class="flex upload__view">
<view class="upload upload-cover">
<uv-form-item labelWidth="0" prop="coverImageUrl">
<formUpload v-model="form.coverImageUrl">
<uv-form-item labelWidth="0" prop="indexImage">
<formUpload v-model="form.indexImage">
<template v-slot="{ value }">
<!-- todo: 默认 -->
<image
@ -33,15 +34,17 @@
</uv-form-item>
</view>
<view class="upload upload-video">
<uv-form-item labelWidth="0" prop="videoUrl">
<formUpload v-model="form.videoUrl">
<uv-form-item labelWidth="0" prop="vio">
<formUpload v-model="form.vio" accept="video">
<template v-slot="{ value }">
<image v-if="value"
:src="form.videoUrl"
mode="aspectFill"
<video v-if="value"
:src="form.vio"
style="width: 344rpx; height: 344rpx;"
radius="14rpx"
/>
:controls="false"
:autoplay="false"
:show-center-play-btn="false"
></video>
<view v-else class="flex flex-column" style="width: 344rpx; height: 344rpx;">
<uv-icon name="camera" color="#000000" size="129rpx"></uv-icon>
<text class="upload-video-text">上传视频</text>
@ -52,9 +55,9 @@
</view>
</view>
<view class="form-item">
<uv-form-item label="标题" labelWidth="84rpx" prop="title">
<uv-form-item label="标题" labelWidth="84rpx" prop="headTitle">
<view class="form-item-content">
<formInput v-model="form.title" placeholder="请输入你的视频名称" width="584rpx"></formInput>
<formInput v-model="form.headTitle" placeholder="请输入你的视频名称" width="584rpx"></formInput>
</view>
</uv-form-item>
</view>
@ -66,16 +69,16 @@
</uv-form-item>
</view>
<view class="form-item">
<uv-form-item label="设置转发次数(次)" prop="times">
<uv-form-item label="设置转发次数(次)" prop="num">
<view class="form-item-content">
<formNumberBox v-model="form.times" ></formNumberBox>
<formNumberBox v-model="form.num" ></formNumberBox>
</view>
</uv-form-item>
</view>
<view class="form-item">
<uv-form-item label="选择二维码" prop="qrCode">
<uv-form-item label="选择二维码" prop="wxCodeImage">
<view class="form-item-content">
<formUpload v-model="form.qrCode">
<formUpload v-model="form.wxCodeImage">
<template v-slot="{ value }">
<view class="flex" style="min-width: 93rpx; height: 45rpx;">
<image
@ -92,10 +95,10 @@
</uv-form-item>
</view>
<view class="form-item">
<uv-form-item label="视频描述" prop="description" labelPosition="top">
<uv-form-item label="视频描述" prop="textDetails" labelPosition="top">
<view style="margin-top: 32rpx;">
<formTextarea
v-model="form.description"
v-model="form.textDetails"
placeholder="请描述你的视频"
></formTextarea>
</view>
@ -106,11 +109,11 @@
</view>
<!-- 审核通过 -->
<button v-if="auditStatus === 1" class="button-submit" @click="onPublish">
<button v-if="status === 1" class="button-submit" open-type="share">
发布
</button>
<!-- 不是 审核中 已发布 -> 创建分享 审核不通过 -->
<button v-else-if="![0,2].includes(auditStatus)" class="button-submit" @click="onSubmit">
<button v-else-if="![0,1].includes(status)" class="button-submit" @click="onSubmit">
提交审核
</button>
</view>
@ -132,34 +135,153 @@
data() {
return {
id: null,
auditStatus: null,
status: null,
form: {
title: null,
coverImageUrl: null,
videoUrl: null,
mins: 2,
times: 10,
qrCode: null,
description: null,
headTitle: null,
indexImage: null,
vio: null,
mins: 10,
num: 10,
wxCodeImage: null,
textDetails: null,
},
rules: {
// todo
},
'indexImage': {
type: 'string',
required: true,
message: '请设置封面',
},
'vio': {
type: 'string',
required: true,
message: '请上传视频',
},
'headTitle': {
type: 'string',
required: true,
message: '请输入你的视频名称',
},
'mins': {
type: 'number',
required: true,
message: '请设置广告弹出时间',
},
'num': {
type: 'number',
required: true,
message: '请设置转发次数',
},
'wxCodeImage': {
type: 'string',
required: true,
message: '请选择二维码',
},
'textDetails': {
type: 'string',
required: true,
message: '请描述你的视频',
},
},
}
},
onLoad(option) {
const { id } = option
if (!id) {
return
}
this.id = id
// todo: init data by id
this.fetchDetails(id)
},
onShareAppMessage(res) {
const {
headTitle,
indexImage,
} = this.form
let o = {
title : headTitle,
imageUrl: indexImage,
path: `/pages_order/sharing/video?id=${this.id}`
}
// todo: get times and check is unlocked
this.isLocked = false
return o
},
methods: {
onSubmit() {
// todo
async fetchDetails(id) {
try {
const result = await this.$fetch('getVideoShareInfo', { id })
const {
headTitle,
indexImage,
vio,
mins,
num,
wxCodeImage,
textDetails,
status,
} = result || {}
this.form = {
headTitle,
indexImage,
vio,
mins,
num,
wxCodeImage,
textDetails,
}
this.status = status
} catch (err) {
}
},
async onSubmit() {
try {
await this.$refs.form.validate()
const {
headTitle,
indexImage,
vio,
mins,
num,
wxCodeImage,
textDetails,
} = this.form
const params = {
id: this.id,
headTitle,
indexImage,
vio,
mins,
num,
wxCodeImage,
textDetails,
}
await this.$fetch('saveOrUpdateVideoShare', params)
uni.showToast({
title: '提交成功',
icon: 'none'
})
setTimeout(uni.navigateBack, 1000, -1)
} catch (err) {
}
const params = { ...this.form }
this.$api('submitPersonalSharing', params)
},
onPublish() {
// todo
@ -181,6 +303,10 @@
background-color: $uni-fg-color;
border-radius: 12rpx;
overflow: hidden;
/deep/ .uv-form-item__body {
padding: 0 !important;
}
}
.upload-video {


+ 62
- 49
pages_order/sharing/article.vue View File

@ -1,9 +1,9 @@
<template>
<view>
<view class="content">
<view class="title">{{ detail.title || '' }}</view>
<view class="title">{{ detail.headTitle || '' }}</view>
<view class="desc">{{ detail.publishTime ? `发布于${detail.publishTime}` : '' }}</view>
<view class="desc">{{ detail.createTime ? `发布于${detail.createTime}` : '' }}</view>
<editor id="editor" class="editor"
:read-only="true"
@ -11,14 +11,14 @@
></editor>
</view>
<uv-overlay :show="true" :opacity="0">
<uv-overlay :show="true" :opacity="0" zIndex="998">
<navbar leftClick @leftClick="$utils.navigateBack" />
<button class="btn" type="success" @click="openPopup">查看更多</button>
<button class="btn" type="success" @click="onJoin">查看更多</button>
<popupUnlock ref="popupUnlock" src="../static/sharing/unlock-article.png"></popupUnlock>
<popupQrCode ref="popupQrCode" :src="detail.qrCode"></popupQrCode>
<popupQrCode ref="popupQrCode" :src="detail.wxCodeImage"></popupQrCode>
</uv-overlay>
@ -38,16 +38,12 @@
return {
detail: {
id: null,
groupName: null,
imageUrl: null,
times: null,
qrCode: null,
title: null,
description: null,
auditStatus: null,
createTime: null,
publishTime: null,
state: null,
userId: null,
headImage: null,
headTitle: null,
num: 10,
wxCodeImage: null,
textDetails: null,
},
isLocked: true,
}
@ -55,30 +51,24 @@
async onLoad(option) {
const { id } = option
await this.fetchSharingDetail(id)
await this.fetchDetails(id)
this.initEditor(this.detail.description)
this.initEditor(this.detail.textDetails)
},
onShareAppMessage(res) {
const {
title,
imageUrl,
headTitle,
headImage,
} = this.detail
// todo: check
let o = {
title : title,
imageUrl: imageUrl,
query: `id=${this.detail.id}`,
title : headTitle,
imageUrl: headImage,
query: `id=${this.id}`,
}
// todo: check callback? settimeout?
// todo: get times and check is unlocked
this.isLocked = false
this.$refs.popupQrCode.open()
this.refreshLockStatus()
return o
},
@ -99,30 +89,53 @@
this.editorCtx.setContents({ html })
},
async fetchSharingDetail(id) {
// todo: init data by id
this.detail = {
id: '001',
groupName: '裂变星创业服务交流群',
imageUrl: 'http://gips3.baidu.com/it/u=70459541,3412285454&fm=3028&app=3028&f=JPEG&fmt=auto?w=960&h=1280',
times: 10,
qrCode: '../static/temp-qrcode.png',
title: '裂变星轻松获客',
description: '<p>文本内容文本内容文本内容文本内容文本内容文本内容文本内容文本内容文本内容文本内容文本内容文本内容文本内容文本内容文本</p><p><br></p><p>aaaaaaaaa</p><p><br></p><p><br></p><p>bbbbbbb</p><p>文本内容文本内容文本内容文本内容文本内容文本内容文本内容文本内容文本内容文本内容文本内容文本内容文本内容文本内容文本</p><p>文本内容文本内容文本内容文本内容文本内容文本内容文本内容文本内容文本内容文本内容文本内容文本内容文本内容文本内容文本</p><p>文本内容文本内容文本内容文本内容文本内容文本内容文本内容文本内容文本内容文本内容文本内容文本内容文本内容文本内容文本</p><p>文本内容文本内容文本内容文本内容文本内容文本内容文本内容文本内容文本内容文本内容文本内容文本内容文本内容文本内容文本</p><p><br></p><p>aaaaaaaaa</p><p><br></p><p><br></p><p>bbbbbbb</p><p>文本内容文本内容文本内容文本内容文本内容文本内容文本内容文本内容文本内容文本内容文本内容文本内容文本内容文本内容文本</p><p>文本内容文本内容文本内容文本内容文本内容文本内容文本内容文本内容文本内容文本内容文本内容文本内容文本内容文本内容文本</p><p>文本内容文本内容文本内容文本内容文本内容文本内容文本内容文本内容文本内容文本内容文本内容文本内容文本内容文本内容文本</p>',
auditStatus: 2,
createTime: '2025年2月1日',
publishTime: '2024年11月13日 11:29',
state: 2,
async fetchDetails(id) {
try {
this.detail = await this.$fetch('getArticleShareInfo', { id })
} catch (err) {
}
},
openPopup() {
if (this.isLocked) {
this.$refs.popupUnlock.open();
} else {
async fetchCheckShare(id) {
try {
return await this.$fetch('checkArticleShare', { id }, false)
} catch (err) {
return {}
}
},
async refreshLockStatus() {
const res = await this.fetchCheckShare()
const { result, message } = res
if (result) {
this.isLocked = false
this.$refs.popupUnlock.close();
this.$refs.popupQrCode.open()
return
}
}
message && uni.showToast({
title: message,
icon: 'none'
})
},
async onJoin() {
if (!this.isLocked) {
this.$refs.popupQrCode.open()
return
}
const res = await this.fetchCheckShare()
const { result, message } = res
if (result) { //
this.isLocked = false
this.$refs.popupQrCode.open()
} else {
this.$refs.popupUnlock.open();
}
},
}
}
</script>


+ 52
- 30
pages_order/sharing/group.vue View File

@ -3,15 +3,15 @@
<navbar leftClick @leftClick="$utils.navigateBack" />
<view class="content">
<image class="avatar" :src="detail.imageUrl"></image>
<text class="nick-name">{{ detail.groupName }}</text>
<image class="avatar" :src="detail.headImage"></image>
<text class="nick-name">{{ detail.headTitle }}</text>
<template v-if="isLocked">
<button class="btn" type="success" @click="openPopup">加入</button>
<button class="btn" type="success" @click="onAdd">加入</button>
</template>
<view v-else class="group-info flex">
<text>扫一扫加群主审核进群</text>
<image class="qr" :src="detail.qrCode" :show-menu-by-longpress="true"></image>
<image class="qr" :src="detail.wxCodeImage" :show-menu-by-longpress="true"></image>
</view>
</view>
@ -44,50 +44,72 @@
onLoad(option) {
const { id } = option
this.fetchSharingDetail(id)
this.fetchDetails(id)
},
onShareAppMessage(res) {
const {
description,
imageUrl,
headTitle,
indexImage,
} = this.detail
// todo: check
let o = {
title : description,
imageUrl: imageUrl,
// path: `/pages_order/sharing/personal?id=${this.detail.id}`
query: `id=${this.detail.id}`,
title : headTitle,
imageUrl: indexImage,
query: `id=${this.id}`,
}
// todo: check callback? settimeout?
// todo: get times and check is unlocked
this.isLocked = false
this.refreshLockStatus()
return o
},
methods: {
async fetchSharingDetail(id) {
// todo: init data by id
this.detail = {
id: '001',
groupName: '裂变星创业服务交流群',
imageUrl: 'http://gips3.baidu.com/it/u=70459541,3412285454&fm=3028&app=3028&f=JPEG&fmt=auto?w=960&h=1280',
times: 10,
qrCode: '../static/temp-qrcode.png',
// title: '',
description: '如此好用的赚钱项目,赶快加入吧!',
auditStatus: 2,
createTime: '2025年2月1日',
state: 2,
async fetchDetails(id) {
try {
this.detail = await this.$fetch('getGroupShareInfo', { id })
} catch (err) {
}
},
async fetchCheckShare(id) {
try {
return await this.$fetch('checkGroupShare', { id }, false)
} catch (err) {
return {}
}
},
async refreshLockStatus() {
const res = await this.fetchCheckShare()
const { result, message } = res
if (result) {
this.isLocked = false
this.$refs.popupUnlock.close();
return
}
message && uni.showToast({
title: message,
icon: 'none'
})
},
openPopup() {
this.$refs.popupUnlock.open();
},
async onAdd() {
const res = await this.fetchCheckShare()
console.log('--res', res)
const { result, message } = res
// todo: check
if (result) { //
this.isLocked = false
return
}
this.openPopup()
}
},
}
</script>


+ 59
- 38
pages_order/sharing/personal.vue View File

@ -3,14 +3,14 @@
<navbar leftClick @leftClick="$utils.navigateBack" />
<view class="content">
<image class="avatar" :src="detail.avatarUrl"></image>
<text class="nick-name">{{ detail.nickName }}</text>
<image class="avatar" :src="detail.headImage"></image>
<text class="nick-name">{{ detail.headTitle }}</text>
<template v-if="isLocked">
<button class="btn" type="success" @click="openPopup">添加</button>
<button class="btn" type="success" @click="onAdd">添加</button>
</template>
<template v-else>
<image class="qr" :src="detail.qrCode" :show-menu-by-longpress="true"></image>
<image class="qr" :src="detail.wxCodeImage" :show-menu-by-longpress="true"></image>
</template>
</view>
@ -30,65 +30,86 @@
return {
detail: {
id: null,
avatarUrl: null,
nickName: null,
imageUrl: null,
times: 10,
qrCode: null,
description: null,
userId: null,
headImage: null,
headTitle: null,
indexImage: null,
num: 10,
wxCodeImage: null,
textDetails: null,
},
isLocked: true,
}
},
onLoad(option) {
console.log('--option', option)
const { id } = option
this.fetchSharingDetail(id)
this.fetchDetails(id)
},
onShareAppMessage(res) {
const {
description,
imageUrl,
headTitle,
indexImage,
} = this.detail
// todo: check
let o = {
title : description,
imageUrl: imageUrl,
// path: `/pages_order/sharing/personal?id=${this.detail.id}`
query: `id=${this.detail.id}`,
title : headTitle,
imageUrl: indexImage,
query: `id=${this.id}`,
}
// todo: check callback? settimeout?
// todo: get times and check is unlocked
this.isLocked = false
this.refreshLockStatus()
return o
},
methods: {
async fetchSharingDetail(id) {
// todo: init data by id
this.detail = {
id: '001',
avatarUrl: 'https://thumbnail0.baidupcs.com/thumbnail/a4166d65fm1072cc3d763d59df8feb8a?fid=3983569511-250528-247083465710867&time=1742544000&rt=sh&sign=FDTAER-DCb740ccc5511e5e8fedcff06b081203-8%2Bjq3Cl0GcBe8y3JIzmmJnNofiY%3D&expires=8h&chkv=0&chkbd=0&chkpc=&dp-logid=8765802821729992500&dp-callid=0&file_type=0&size=c850_u580&quality=100&vuk=-&ft=video',
nickName: '裂变星官方指导客服',
imageUrl: 'http://gips3.baidu.com/it/u=70459541,3412285454&fm=3028&app=3028&f=JPEG&fmt=auto?w=960&h=1280',
times: 10,
qrCode: '../static/temp-qrcode.png',
// title: '',
description: '如此好用的赚钱项目,赶快加入吧!',
auditStatus: 2,
createTime: '2025年2月1日',
state: -1,
async fetchDetails(id) {
try {
this.detail = await this.$fetch('getShareInfo', { id })
} catch (err) {
}
},
async fetchCheckShare(id) {
try {
return await this.$fetch('checkShare', { id }, false)
} catch (err) {
return {}
}
},
async refreshLockStatus() {
const res = await this.fetchCheckShare()
const { result, message } = res
if (result) {
this.isLocked = false
this.$refs.popupUnlock.close();
return
}
message && uni.showToast({
title: message,
icon: 'none'
})
},
openPopup() {
this.$refs.popupUnlock.open();
},
async onAdd() {
const res = await this.fetchCheckShare()
console.log('--res', res)
const { result, message } = res
// todo: check
if (result) { //
this.isLocked = false
return
}
this.openPopup()
}
},
}
</script>


+ 75
- 55
pages_order/sharing/video.vue View File

@ -5,22 +5,25 @@
<view class="content">
<video class="video"
id="video"
:src="detail.videoUrl"
:src="detail.vio"
autoplay
play-btn-position="center"
:controls="!timeIsUp"
:show-fullscreen-btn="false"
:show-center-play-btn="true"
@timeupdate="onTimeupdate"
></video>
<view class="info">
<view class="author">{{ detail.author }}</view>
<view class="title">{{ detail.title }}</view>
<view class="desc">{{ detail.description }}</view>
<view class="title">{{ detail.headTitle }}</view>
<view class="desc">{{ detail.textDetails }}</view>
</view>
</view>
<popupUnlock ref="popupUnlock" src="../static/sharing/unlock-video.png"></popupUnlock>
<popupQrCode ref="popupQrCode" :src="detail.qrCode"></popupQrCode>
<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>
</uv-overlay>
</view>
</template>
@ -37,82 +40,99 @@
return {
detail: {
id: null,
title: null,
videoUrl: null,
times: 10,
qrCode: null,
description: null,
headTitle: null,
indexImage: null,
vio: null,
mins: 10,
num: 10,
wxCodeImage: null,
textDetails: null,
},
timeIsUp: false,
isLocked: true,
videoContext: null
}
},
async onLoad(option) {
console.log('--option', option)
const { id } = option
await this.fetchSharingDetail(id)
await this.fetchDetails(id)
this.videoContext = uni.createVideoContext('video');
console.log('--videoContext', this.videoContext)
// this.videoContext.requestFullScreen()
},
onShareAppMessage(res) {
const {
title,
coverImageUrl,
headTitle,
indexImage,
} = this.detail
// todo: check
let o = {
title : title,
imageUrl: coverImageUrl,
query: `id=${this.detail.id}`,
title : headTitle,
imageUrl: indexImage,
query: `id=${this.id}`,
}
// todo: check callback? settimeout?
// todo: get times and check is unlocked
this.isLocked = false
this.$refs.popupQrCode.open()
this.refreshLockStatus()
return o
},
methods: {
async fetchSharingDetail(id) {
// todo: init data by id
this.detail = {
id: '001',
author: '@裂变星',
coverImageUrl: 'http://gips3.baidu.com/it/u=70459541,3412285454&fm=3028&app=3028&f=JPEG&fmt=auto?w=960&h=1280',
videoUrl: 'http://wxsnsdy.tc.qq.com/105/20210/snsdyvideodownload?filekey=30280201010421301f0201690402534804102ca905ce620b1241b726bc41dcff44e00204012882540400&bizid=1023&hy=SH&fileparam=302c020101042530230204136ffd93020457e3c4ff02024ef202031e8d7f02030f42400204045a320a0201000400',
mins: 10,
times: 10,
qrCode: '../static/temp-qrcode.png',
title: '20秒学会日赚1000+,全自动获客',
description: '裂变获客,轻松引流!',
auditStatus: 2,
createTime: '2025年2月1日',
state: 1,
async fetchDetails(id) {
try {
this.detail = await this.$fetch('getVideoShareInfo', { id })
} catch (err) {
}
},
onTimeupdate(e) {
async fetchCheckShare(id) {
try {
return await this.$fetch('checkVideoShare', { id }, false)
} catch (err) {
return {}
}
},
async refreshLockStatus() {
const res = await this.fetchCheckShare()
const { result, message } = res
if (result) {
this.isLocked = false
this.$refs.popupUnlock.close();
this.$refs.popupQrCode.open()
return
}
message && uni.showToast({
title: message,
icon: 'none'
})
},
async onPlay() {
if (!this.isLocked) {
this.$refs.popupQrCode.open()
return
}
const res = await this.fetchCheckShare()
const { result, message } = res
if (result) { //
this.isLocked = false
this.$refs.popupQrCode.open()
} else {
this.$refs.popupUnlock.open();
}
},
async onTimeupdate(e) {
const { currentTime } = e.target
if (currentTime >= this.detail.mins) {
// todo: check
if (currentTime >= (this.detail.mins || 5)) {
this.videoContext.pause()
if (this.isLocked) {
this.$refs.popupUnlock.open();
} else {
this.$refs.popupQrCode.open()
}
this.timeIsUp = true
this.onPlay()
}
},
},


BIN
pages_order/static/temp-avatar.png View File

Before After
Width: 180  |  Height: 180  |  Size: 55 KiB

BIN
pages_order/static/temp-qrcode.png View File

Before After
Width: 350  |  Height: 350  |  Size: 9.8 KiB

+ 3
- 3
store/store.js View File

@ -65,7 +65,7 @@ const store = new Vuex.Store({
return
}
state.userInfo = res.result.userInfo
Vue.set(state, 'userInfo', res.result.userInfo)
uni.setStorageSync('token', res.result.token)
if(!state.userInfo.nickName || !state.userInfo.headImage){
@ -83,7 +83,7 @@ const store = new Vuex.Store({
getUserInfo(state){
api('getInfo', res => {
if(res.code == 200){
state.userInfo = res.result
Vue.set(state, 'userInfo', res.result)
}
})
},
@ -93,7 +93,7 @@ const store = new Vuex.Store({
title: '确认退出登录吗',
success(r) {
if(r.confirm){
state.userInfo = {}
Vue.set(state, 'userInfo', {})
state.role = false
uni.removeStorageSync('token')
uni.reLaunch({


Loading…
Cancel
Save