Browse Source

feat: 接口对接;

pull/1/head
Fox-33 3 weeks ago
parent
commit
a942282eb0
12 changed files with 100 additions and 76 deletions
  1. +8
    -0
      api/model/center.js
  2. +10
    -0
      api/model/sharing.js
  3. +1
    -1
      config.js
  4. +4
    -5
      pages/index/center.vue
  5. +19
    -4
      pages/index/record.vue
  6. +4
    -4
      pages_order/mine/news.vue
  7. +1
    -7
      pages_order/mine/sharing.vue
  8. +8
    -8
      pages_order/record/videoSharing.vue
  9. +11
    -11
      pages_order/sharing/article.vue
  10. +12
    -12
      pages_order/sharing/group.vue
  11. +11
    -12
      pages_order/sharing/personal.vue
  12. +11
    -12
      pages_order/sharing/video.vue

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

@ -16,6 +16,14 @@ const api = {
method: 'GET',
auth: true,
},
/**
* 获取新闻动态详情的接口
*/
getNewsById: {
url: '/all_login/getNewsById',
method: 'GET',
auth: true,
},
}
export default api

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

@ -7,6 +7,16 @@ const api = {
method: 'GET',
auth: true,
},
/**
* 删除分享记录
*/
deleteLog: {
url: '/fen/deleteLog',
method: 'POST',
auth: true,
limit : 500,
showLoading : true,
},
/**
* 增加或者修改个人分享
*/


+ 1
- 1
config.js View File

@ -8,7 +8,7 @@ import uvUI from '@/uni_modules/uv-ui-tools'
Vue.use(uvUI);
// 当前环境
const type = 'prod'
const type = 'dev'
// 环境配置


+ 4
- 5
pages/index/center.vue View File

@ -113,9 +113,9 @@
</view>
<view class="updates-content">
<view class="card updates-item"
v-for="(item, index) in list"
v-for="item in list"
:key="item.id"
@click="goToNewsDetail(item.id, index)"
@click="goToNewsDetail(item.id)"
>
<view class="updates-item-img">
<image :src="item.image"></image>
@ -193,10 +193,9 @@
return str.replace(/<.*?>/g, '')
},
goToNewsDetail(id, index) {
// todo: check
goToNewsDetail(id) {
uni.navigateTo({
url: `/pages_order/mine/news?id=${id}&index=${index}`
url: `/pages_order/mine/news?id=${id}`
})
},
}


+ 19
- 4
pages/index/record.vue View File

@ -28,7 +28,7 @@
>
<template v-slot:right>
<suspendDropdown
v-model="queryParams.status"
v-model="status"
:options="auditStatusOptions"
@change="onAuditStatusChange"
></suspendDropdown>
@ -49,7 +49,7 @@
<view class="desc">{{ item.textDetails || '' }}</view>
<view class="bottom">
<text class="desc">{{ item.createTime || '' }}</text>
<button plain class="btn-simple btn-delete flex" @click="onDelete(item.id)">
<button plain class="btn-simple btn-delete flex" @click.stop="onDelete(item.id)">
<image src="../../static/image/record/delete.png" style="width: 24rpx; height: 24rpx;"></image>
<text style="margin-left: 10rpx;">删除</text>
</button>
@ -127,9 +127,9 @@
queryParams: {
pageNo: 1,
pageSize: 10,
status: null,
state: 0,
},
status: null,
recordList : { //
records : [],
total : 0,
@ -155,6 +155,13 @@
this.status = status
this.queryParams.pageNo = 1
this.queryParams.pageSize = 10
if (status === null) {
delete this.queryParams.status
} else {
this.queryParams.status = status
}
this.getData()
},
//
@ -164,7 +171,15 @@
})
},
onDelete(id) {
// todo
uni.showModal({
title: '确认删除该分享吗',
success: async (r) => {
if(r.confirm){
await this.$fetch('deleteLog', { id, state: this.queryParams.state })
this.getData()
}
}
})
},
}
}


+ 4
- 4
pages_order/mine/news.vue View File

@ -34,14 +34,14 @@
}
},
async onLoad(option) {
const { id, index } = option
const { id } = option
await this.fetchDetails(id, index)
await this.fetchDetails(id)
},
methods: {
async fetchDetails(id, index) {
async fetchDetails(id) {
try {
this.detail = (await this.$fetch('getNews'))?.records[index]
this.detail = await this.$fetch('getNewsById', { id })
} catch (err) {
}


+ 1
- 7
pages_order/mine/sharing.vue View File

@ -5,7 +5,7 @@
<view class="flex content">
<view style="width: 598rpx; height: 1063rpx;">
<canvas id="myCanvas" canvasId="qrCanvas" type="2d" style="width: 100%; height: 100%;"></canvas>
<canvas id="myCanvas" canvas-id="firstCanvas1" type="2d" style="width: 100%; height: 100%;"></canvas>
</view>
<view class="flex btns">
@ -23,7 +23,6 @@
data() {
return {
wxCodeImage: null,
imgurl: '',
canvas: {},
}
},
@ -163,11 +162,6 @@
flex-direction: column;
}
.bg {
width: 598rpx;
height: 1063rpx;
}
.btns {
justify-content: space-between;
margin-top: 53rpx;


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

@ -62,9 +62,9 @@
</uv-form-item>
</view>
<view class="form-item">
<uv-form-item label="设置广告弹出时间(s)" prop="mins">
<uv-form-item label="设置广告弹出时间(s)" prop="timeNum">
<view class="form-item-content">
<formNumberBox v-model="form.mins" ></formNumberBox>
<formNumberBox v-model="form.timeNum" ></formNumberBox>
</view>
</uv-form-item>
</view>
@ -140,7 +140,7 @@
headTitle: null,
indexImage: null,
vio: null,
mins: 10,
timeNum: 10,
num: 10,
wxCodeImage: null,
textDetails: null,
@ -161,7 +161,7 @@
required: true,
message: '请输入你的视频名称',
},
'mins': {
'timeNum': {
type: 'number',
required: true,
message: '请设置广告弹出时间',
@ -222,7 +222,7 @@
headTitle,
indexImage,
vio,
mins,
timeNum,
num,
wxCodeImage,
textDetails,
@ -233,7 +233,7 @@
headTitle,
indexImage,
vio,
mins,
timeNum,
num,
wxCodeImage,
textDetails,
@ -252,7 +252,7 @@
headTitle,
indexImage,
vio,
mins,
timeNum,
num,
wxCodeImage,
textDetails,
@ -263,7 +263,7 @@
headTitle,
indexImage,
vio,
mins,
timeNum,
num,
wxCodeImage,
textDetails,


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

@ -98,25 +98,26 @@
},
async fetchCheckShare(id) {
try {
return await this.$fetch('checkArticleShare', { id }, false)
return await this.$fetch('checkArticleShare', { id })
} catch (err) {
return {}
}
},
async refreshLockStatus() {
const res = await this.fetchCheckShare()
const { result, message } = res
const result = await this.fetchCheckShare()
const { title, open } = result
if (result) {
if (open) {
this.isLocked = false
this.$refs.popupUnlock.close();
this.$refs.popupQrCode.open()
return
}
message && uni.showToast({
title: message,
icon: 'none'
title && uni.showToast({
title,
icon: 'none',
duration: 3000
})
},
async onJoin() {
@ -125,11 +126,10 @@
return
}
const res = await this.fetchCheckShare()
const result = await this.fetchCheckShare()
const { open } = result
const { result, message } = res
if (result) { //
if (open) { //
this.isLocked = false
this.$refs.popupQrCode.open()
} else {


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

@ -73,37 +73,37 @@
},
async fetchCheckShare(id) {
try {
return await this.$fetch('checkGroupShare', { id }, false)
return await this.$fetch('checkGroupShare', { id })
} catch (err) {
return {}
}
},
async refreshLockStatus() {
const res = await this.fetchCheckShare()
const { result, message } = res
const result = await this.fetchCheckShare()
const { title, open } = result
if (result) {
if (open) {
this.isLocked = false
this.$refs.popupUnlock.close();
return
}
message && uni.showToast({
title: message,
icon: 'none'
title && uni.showToast({
title,
icon: 'none',
duration: 3000
})
},
openPopup() {
this.$refs.popupUnlock.open();
},
async onAdd() {
const res = await this.fetchCheckShare()
console.log('--res', res)
const { result, message } = res
const result = await this.fetchCheckShare()
const { open } = result
// todo: check
if (result) { //
if (open) { //
this.isLocked = false
return
}


+ 11
- 12
pages_order/sharing/personal.vue View File

@ -73,37 +73,36 @@
},
async fetchCheckShare(id) {
try {
return await this.$fetch('checkShare', { id }, false)
return await this.$fetch('checkShare', { id })
} catch (err) {
return {}
}
},
async refreshLockStatus() {
const res = await this.fetchCheckShare()
const { result, message } = res
const result = await this.fetchCheckShare()
const { title, open } = result
if (result) {
if (open) {
this.isLocked = false
this.$refs.popupUnlock.close();
return
}
message && uni.showToast({
title: message,
icon: 'none'
title && uni.showToast({
title,
icon: 'none',
duration: 3000
})
},
openPopup() {
this.$refs.popupUnlock.open();
},
async onAdd() {
const res = await this.fetchCheckShare()
console.log('--res', res)
const { result, message } = res
const result = await this.fetchCheckShare()
const { open } = result
// todo: check
if (result) { //
if (open) { //
this.isLocked = false
return
}


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

@ -43,7 +43,7 @@
headTitle: null,
indexImage: null,
vio: null,
mins: 10,
timeNum: 10,
num: 10,
wxCodeImage: null,
textDetails: null,
@ -87,24 +87,24 @@
},
async fetchCheckShare(id) {
try {
return await this.$fetch('checkVideoShare', { id }, false)
return await this.$fetch('checkVideoShare', { id })
} catch (err) {
return {}
}
},
async refreshLockStatus() {
const res = await this.fetchCheckShare()
const { result, message } = res
const result = await this.fetchCheckShare()
const { title, open } = result
if (result) {
if (open) {
this.isLocked = false
this.$refs.popupUnlock.close();
this.$refs.popupQrCode.open()
return
}
message && uni.showToast({
title: message,
title && uni.showToast({
title,
icon: 'none'
})
},
@ -114,11 +114,10 @@
return
}
const res = await this.fetchCheckShare()
const result = await this.fetchCheckShare()
const { open } = result
const { result, message } = res
if (result) { //
if (open) { //
this.isLocked = false
this.$refs.popupQrCode.open()
} else {
@ -129,7 +128,7 @@
const { currentTime } = e.target
// todo: check
if (currentTime >= (this.detail.mins || 5)) {
if (currentTime >= this.detail.timeNum) {
this.videoContext.pause()
this.timeIsUp = true
this.onPlay()


Loading…
Cancel
Save