提交代码
This commit is contained in:
parent
7fb1548546
commit
81fc7653c8
839
common/common.js
839
common/common.js
|
|
@ -7,423 +7,504 @@ import Vue from 'vue'
|
|||
|
||||
// 防止处理多次点击
|
||||
function noMultipleClicks(methods, info) {
|
||||
// methods是点击后需要执行的函数, info是函数需要传的参数
|
||||
let that = this
|
||||
if (that.noClick) {
|
||||
// 第一次点击
|
||||
that.noClick = false
|
||||
if ((info && info !== '') || info == 0) {
|
||||
// info是执行函数需要传的参数
|
||||
methods(info)
|
||||
} else {
|
||||
methods()
|
||||
}
|
||||
setTimeout(() => {
|
||||
that.noClick = true
|
||||
}, 2000)
|
||||
} else {
|
||||
// 这里是重复点击的判断
|
||||
}
|
||||
// methods是点击后需要执行的函数, info是函数需要传的参数
|
||||
let that = this
|
||||
if (that.noClick) {
|
||||
// 第一次点击
|
||||
that.noClick = false
|
||||
if ((info && info !== '') || info == 0) {
|
||||
// info是执行函数需要传的参数
|
||||
methods(info)
|
||||
} else {
|
||||
methods()
|
||||
}
|
||||
setTimeout(() => {
|
||||
that.noClick = true
|
||||
}, 2000)
|
||||
} else {
|
||||
// 这里是重复点击的判断
|
||||
}
|
||||
}
|
||||
//导出
|
||||
export default {
|
||||
data: {
|
||||
loading: false,
|
||||
timer: null
|
||||
},
|
||||
data: {
|
||||
loading: false,
|
||||
timer: null
|
||||
},
|
||||
|
||||
noMultipleClicks, // 禁止多次点击
|
||||
noMultipleClicks, // 禁止多次点击
|
||||
|
||||
/* 获取日期 */
|
||||
getDateTime() {
|
||||
const date = new Date()
|
||||
/* 获取日期 */
|
||||
getDateTime() {
|
||||
const date = new Date()
|
||||
|
||||
const year = date.getFullYear().toString()
|
||||
const monty = (date.getMonth() + 1).toString()
|
||||
const day = date.getDate().toString()
|
||||
const year = date.getFullYear().toString()
|
||||
const monty = (date.getMonth() + 1).toString()
|
||||
const day = date.getDate().toString()
|
||||
|
||||
return `${year}-${monty}-${day}`
|
||||
},
|
||||
return `${year}-${monty}-${day}`
|
||||
},
|
||||
|
||||
detailPageTitle(obj) {
|
||||
if (!obj) {
|
||||
return ''
|
||||
}
|
||||
detailPageTitle(obj) {
|
||||
if (!obj) {
|
||||
return ''
|
||||
}
|
||||
|
||||
const types = {
|
||||
1: '一番赏',
|
||||
2: '无限赏',
|
||||
3: '擂台赏',
|
||||
4: '抽卡机',
|
||||
5: '积分赏',
|
||||
6: '全局赏',
|
||||
7: '福利盲盒',
|
||||
8: '领主赏',
|
||||
9: '连击赏'
|
||||
}
|
||||
const types = {
|
||||
1: '一番赏',
|
||||
2: '无限赏',
|
||||
3: '擂台赏',
|
||||
4: '抽卡机',
|
||||
5: '积分赏',
|
||||
6: '全局赏',
|
||||
7: '福利盲盒',
|
||||
8: '领主赏',
|
||||
9: '连击赏'
|
||||
}
|
||||
|
||||
const target = types[obj.type]
|
||||
return target
|
||||
},
|
||||
const target = types[obj.type]
|
||||
return target
|
||||
},
|
||||
|
||||
navTo(item) {
|
||||
/* 领券中心 */
|
||||
if (item.ttype == 1) {
|
||||
this.to({
|
||||
url: '/package/index/coupon-center',
|
||||
query: {
|
||||
coupon_id: item.coupon_id
|
||||
}
|
||||
})
|
||||
}
|
||||
navTo(item) {
|
||||
/* 领券中心 */
|
||||
if (item.ttype == 1) {
|
||||
this.to({
|
||||
url: '/package/index/coupon-center',
|
||||
query: {
|
||||
coupon_id: item.coupon_id
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
if (item.goods_id > 0) {
|
||||
if (item.ttype == 2) {
|
||||
/* 一番赏 */
|
||||
this.to({
|
||||
url: '/pages/shouye/detail',
|
||||
query: {
|
||||
goods_id: item.goods_id
|
||||
}
|
||||
})
|
||||
}
|
||||
if (item.goods_id > 0) {
|
||||
if (item.ttype == 2) {
|
||||
/* 一番赏 */
|
||||
this.to({
|
||||
url: '/pages/shouye/detail',
|
||||
query: {
|
||||
goods_id: item.goods_id
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
/* 无限赏 */
|
||||
if (item.ttype == 3) {
|
||||
this.to({
|
||||
url: '/pages/shouye/detail_wuxian',
|
||||
query: {
|
||||
goods_id: item.goods_id
|
||||
}
|
||||
})
|
||||
}
|
||||
/* 无限赏 */
|
||||
if (item.ttype == 3) {
|
||||
this.to({
|
||||
url: '/pages/shouye/detail_wuxian',
|
||||
query: {
|
||||
goods_id: item.goods_id
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
/* 连击赏 */
|
||||
if (item.ttype == 4) {
|
||||
this.to({
|
||||
url: '/package/index/lian-ji',
|
||||
query: {
|
||||
goods_id: item.goods_id
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
},
|
||||
/* 连击赏 */
|
||||
if (item.ttype == 4) {
|
||||
this.to({
|
||||
url: '/package/index/lian-ji',
|
||||
query: {
|
||||
goods_id: item.goods_id
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* @description: 微信支付(小程序)
|
||||
* @param {*}
|
||||
* @return {*}
|
||||
*/
|
||||
wxMpPay({ provider = 'weixin', data }) {
|
||||
console.log('wxdata', data)
|
||||
// #ifdef H5
|
||||
console.log('进入h5支付', data)
|
||||
return new Promise((resolve, reject) => {
|
||||
WeixinJSBridge.invoke(
|
||||
'getBrandWCPayRequest', data,
|
||||
function (res) {
|
||||
console.log('支付回调', res);
|
||||
if (res.errMsg == 'requestPayment:fail cancel') {
|
||||
uni.showToast({
|
||||
title: '取消支付',
|
||||
icon: 'none',
|
||||
duration: 500,
|
||||
success: () => {
|
||||
/* 取消订单 */
|
||||
}
|
||||
})
|
||||
resolve('cancel')
|
||||
}
|
||||
if (res.err_msg == "get_brand_wcpay_request:ok") {
|
||||
// 使用以上方式判断前端返回,微信团队郑重提示:
|
||||
//res.err_msg将在用户支付成功后返回ok,但并不保证它绝对可靠。
|
||||
uni.showToast({
|
||||
title: '支付成功',
|
||||
icon: 'success',
|
||||
duration: 500,
|
||||
success: () => {
|
||||
resolve('success')
|
||||
}
|
||||
})
|
||||
}
|
||||
/**
|
||||
* @description: 微信支付(小程序)
|
||||
* @param {*}
|
||||
* @return {*}
|
||||
*/
|
||||
wxMpPay({
|
||||
provider = 'weixin',
|
||||
data
|
||||
}) {
|
||||
console.log('wxdata', data)
|
||||
// #ifdef H5
|
||||
console.log('进入h5支付', data)
|
||||
return new Promise((resolve, reject) => {
|
||||
WeixinJSBridge.invoke(
|
||||
'getBrandWCPayRequest', data,
|
||||
function(res) {
|
||||
console.log('支付回调', res);
|
||||
if (res.errMsg == 'requestPayment:fail cancel') {
|
||||
uni.showToast({
|
||||
title: '取消支付',
|
||||
icon: 'none',
|
||||
duration: 500,
|
||||
success: () => {
|
||||
/* 取消订单 */
|
||||
}
|
||||
})
|
||||
resolve('cancel')
|
||||
}
|
||||
if (res.err_msg == "get_brand_wcpay_request:ok") {
|
||||
// 使用以上方式判断前端返回,微信团队郑重提示:
|
||||
//res.err_msg将在用户支付成功后返回ok,但并不保证它绝对可靠。
|
||||
uni.showToast({
|
||||
title: '支付成功',
|
||||
icon: 'success',
|
||||
duration: 500,
|
||||
success: () => {
|
||||
resolve('success')
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
});
|
||||
});
|
||||
|
||||
})
|
||||
})
|
||||
|
||||
// #endif
|
||||
// #ifdef MP-WEIXIN
|
||||
return new Promise((resolve, reject) => {
|
||||
uni.requestPayment({
|
||||
provider,
|
||||
...data,
|
||||
success: res => {
|
||||
// console.log(res)
|
||||
},
|
||||
fail: err => {
|
||||
// console.log('common.wxMpPay-error', err)
|
||||
},
|
||||
complete: res => {
|
||||
console.log('complete (res)', res)
|
||||
if (res.errMsg == 'requestPayment:fail cancel') {
|
||||
this.toast({
|
||||
title: '取消支付',
|
||||
icon: 'none',
|
||||
duration: 500,
|
||||
success: () => {
|
||||
/* 取消订单 */
|
||||
}
|
||||
})
|
||||
// #endif
|
||||
// #ifdef MP-WEIXIN
|
||||
return new Promise((resolve, reject) => {
|
||||
uni.requestPayment({
|
||||
provider,
|
||||
...data,
|
||||
success: res => {
|
||||
// console.log(res)
|
||||
},
|
||||
fail: err => {
|
||||
// console.log('common.wxMpPay-error', err)
|
||||
},
|
||||
complete: res => {
|
||||
console.log('complete (res)', res)
|
||||
if (res.errMsg == 'requestPayment:fail cancel') {
|
||||
this.toast({
|
||||
title: '取消支付',
|
||||
icon: 'none',
|
||||
duration: 500,
|
||||
success: () => {
|
||||
/* 取消订单 */
|
||||
}
|
||||
})
|
||||
|
||||
resolve('cancel')
|
||||
}
|
||||
if (res.errMsg == 'requestPayment:ok') {
|
||||
this.toast({
|
||||
title: '支付成功',
|
||||
icon: 'success',
|
||||
duration: 500,
|
||||
success: () => {
|
||||
resolve('success')
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
})
|
||||
resolve('cancel')
|
||||
}
|
||||
if (res.errMsg == 'requestPayment:ok') {
|
||||
this.toast({
|
||||
title: '支付成功',
|
||||
icon: 'success',
|
||||
duration: 500,
|
||||
success: () => {
|
||||
resolve('success')
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
// #endif
|
||||
},
|
||||
// #endif
|
||||
},
|
||||
|
||||
/**
|
||||
* @description: 规避连点
|
||||
* @param {*}
|
||||
* @return {*}
|
||||
*/
|
||||
noDouble(fun, data, loading = false) {
|
||||
/**
|
||||
* $common.noDouble(fun,data)
|
||||
* fun 需要规避连点的方法
|
||||
* data 该方法需要用到的参数
|
||||
* loading 接口加载中状态
|
||||
* 传入方法不要写括号
|
||||
*/
|
||||
/**
|
||||
* @description: 规避连点
|
||||
* @param {*}
|
||||
* @return {*}
|
||||
*/
|
||||
noDouble(fun, data, loading = false) {
|
||||
/**
|
||||
* $common.noDouble(fun,data)
|
||||
* fun 需要规避连点的方法
|
||||
* data 该方法需要用到的参数
|
||||
* loading 接口加载中状态
|
||||
* 传入方法不要写括号
|
||||
*/
|
||||
|
||||
/* 如果接口加载中,终止任何操作 */
|
||||
if (loading) {
|
||||
setTimeout(() => {
|
||||
uni.showToast({
|
||||
title: '请勿重复点击',
|
||||
icon: 'none',
|
||||
mask: false
|
||||
})
|
||||
}, 100)
|
||||
return
|
||||
}
|
||||
/* 如果接口加载中,终止任何操作 */
|
||||
if (loading) {
|
||||
setTimeout(() => {
|
||||
uni.showToast({
|
||||
title: '请勿重复点击',
|
||||
icon: 'none',
|
||||
mask: false
|
||||
})
|
||||
}, 100)
|
||||
return
|
||||
}
|
||||
|
||||
/* 如果定时器未结束 */
|
||||
if (this.data.timer) {
|
||||
setTimeout(() => {
|
||||
uni.showToast({
|
||||
title: '请勿重复点击',
|
||||
icon: 'none',
|
||||
mask: false
|
||||
})
|
||||
}, 100)
|
||||
/* 如果定时器未结束 */
|
||||
if (this.data.timer) {
|
||||
setTimeout(() => {
|
||||
uni.showToast({
|
||||
title: '请勿重复点击',
|
||||
icon: 'none',
|
||||
mask: false
|
||||
})
|
||||
}, 100)
|
||||
|
||||
/* 清除之前的定时器 */
|
||||
clearTimeout(this.data.timer)
|
||||
/* 重新设置定时器 */
|
||||
this.data.timer = setTimeout(() => {
|
||||
this.data.timer = null
|
||||
}, 200)
|
||||
return
|
||||
}
|
||||
/* 清除之前的定时器 */
|
||||
clearTimeout(this.data.timer)
|
||||
/* 重新设置定时器 */
|
||||
this.data.timer = setTimeout(() => {
|
||||
this.data.timer = null
|
||||
}, 200)
|
||||
return
|
||||
}
|
||||
|
||||
console.log(data && data)
|
||||
console.log(data && data)
|
||||
|
||||
/* 设置第一次点击的定时器 */
|
||||
this.data.timer = setTimeout(() => {
|
||||
this.data.timer = null
|
||||
}, 200)
|
||||
/* 设置第一次点击的定时器 */
|
||||
this.data.timer = setTimeout(() => {
|
||||
this.data.timer = null
|
||||
}, 200)
|
||||
|
||||
/* 如果有回调,使用回调并传入参数 */
|
||||
fun && fun(data && data)
|
||||
},
|
||||
/* 如果有回调,使用回调并传入参数 */
|
||||
fun && fun(data && data)
|
||||
},
|
||||
|
||||
/**
|
||||
* @description: tost提示
|
||||
* @return {*}
|
||||
*/
|
||||
toast(opt) {
|
||||
let title = opt.title || ''
|
||||
let icon = opt.icon || 'none'
|
||||
let mask = opt.mask || false
|
||||
let duration = opt.duration || 1500
|
||||
let position = opt.position || 'center'
|
||||
/**
|
||||
* @description: tost提示
|
||||
* @return {*}
|
||||
*/
|
||||
toast(opt) {
|
||||
let title = opt.title || ''
|
||||
let icon = opt.icon || 'none'
|
||||
let mask = opt.mask || false
|
||||
let duration = opt.duration || 1500
|
||||
let position = opt.position || 'center'
|
||||
|
||||
setTimeout(() => {
|
||||
uni.showToast({
|
||||
title,
|
||||
icon,
|
||||
mask,
|
||||
duration,
|
||||
position,
|
||||
success: () => {
|
||||
if (opt.success) {
|
||||
setTimeout(() => {
|
||||
opt.success()
|
||||
}, duration)
|
||||
}
|
||||
}
|
||||
})
|
||||
}, 100)
|
||||
},
|
||||
setTimeout(() => {
|
||||
uni.showToast({
|
||||
title,
|
||||
icon,
|
||||
mask,
|
||||
duration,
|
||||
position,
|
||||
success: () => {
|
||||
if (opt.success) {
|
||||
setTimeout(() => {
|
||||
opt.success()
|
||||
}, duration)
|
||||
}
|
||||
}
|
||||
})
|
||||
}, 100)
|
||||
},
|
||||
|
||||
/**
|
||||
* @description: 获取规则
|
||||
* @param {*} type
|
||||
* @return {*}
|
||||
*/
|
||||
getRule(id = '', loading = false) {
|
||||
return new Promise((resolve, reject) => {
|
||||
Vue.prototype.req({
|
||||
url: 'danye',
|
||||
Loading: !loading,
|
||||
data: {
|
||||
type: id
|
||||
},
|
||||
success: res => {
|
||||
if (res.status == 1) {
|
||||
if (res.data) {
|
||||
res.data = res.data.replace(
|
||||
/\<img/gi,
|
||||
'<img style="width: 100%;vertical-align: middle;"'
|
||||
)
|
||||
}
|
||||
/**
|
||||
* @description: 获取规则
|
||||
* @param {*} type
|
||||
* @return {*}
|
||||
*/
|
||||
getRule(id = '', loading = false) {
|
||||
return new Promise((resolve, reject) => {
|
||||
Vue.prototype.req({
|
||||
url: 'danye',
|
||||
Loading: !loading,
|
||||
data: {
|
||||
type: id
|
||||
},
|
||||
success: res => {
|
||||
if (res.status == 1) {
|
||||
if (res.data) {
|
||||
res.data = res.data.replace(
|
||||
/\<img/gi,
|
||||
'<img style="width: 100%;vertical-align: middle;"'
|
||||
)
|
||||
}
|
||||
|
||||
resolve(res)
|
||||
} else {
|
||||
reject(res)
|
||||
}
|
||||
}
|
||||
})
|
||||
})
|
||||
},
|
||||
resolve(res)
|
||||
} else {
|
||||
reject(res)
|
||||
}
|
||||
}
|
||||
})
|
||||
})
|
||||
},
|
||||
|
||||
/**
|
||||
* @description: 复制到剪切板
|
||||
* @param {*} e
|
||||
* @return {*}
|
||||
*/
|
||||
copy(e) {
|
||||
uni.setClipboardData({
|
||||
data: `${e}`
|
||||
})
|
||||
},
|
||||
/**
|
||||
* @description: 复制到剪切板
|
||||
* @param {*} e
|
||||
* @return {*}
|
||||
*/
|
||||
copy(e) {
|
||||
uni.setClipboardData({
|
||||
data: `${e}`
|
||||
})
|
||||
},
|
||||
|
||||
/**
|
||||
* @description: obj转为queryString
|
||||
* @param {*} e
|
||||
* @return {*}
|
||||
*/
|
||||
qs(e) {
|
||||
let str = Object.entries(e)
|
||||
.map(([key, value]) => `${key}=${value}`)
|
||||
.join('&')
|
||||
return `?${str}`
|
||||
},
|
||||
/**
|
||||
* @description: obj转为queryString
|
||||
* @param {*} e
|
||||
* @return {*}
|
||||
*/
|
||||
qs(e) {
|
||||
let str = Object.entries(e)
|
||||
.map(([key, value]) => `${key}=${value}`)
|
||||
.join('&')
|
||||
return `?${str}`
|
||||
},
|
||||
|
||||
/**
|
||||
* @description: 跳转页面
|
||||
* @param {*} type 跳转类型 1 navigate,2 redirect,3 switch,4 relaunch
|
||||
* @param {*} url
|
||||
* @param {*} query
|
||||
* @return {*}
|
||||
*/
|
||||
to({ type = 1, url, query = {}, success, fail, complete }) {
|
||||
if (!url) {
|
||||
this.toast({
|
||||
title: '暂未开放'
|
||||
})
|
||||
return
|
||||
}
|
||||
/**
|
||||
* @description: 跳转页面
|
||||
* @param {*} type 跳转类型 1 navigate,2 redirect,3 switch,4 relaunch
|
||||
* @param {*} url
|
||||
* @param {*} query
|
||||
* @return {*}
|
||||
*/
|
||||
to({
|
||||
type = 1,
|
||||
url,
|
||||
query = {},
|
||||
success,
|
||||
fail,
|
||||
complete
|
||||
}) {
|
||||
if (!url) {
|
||||
this.toast({
|
||||
title: '暂未开放'
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
if (Object.keys(query).length > 0) {
|
||||
url += this.qs(query)
|
||||
}
|
||||
if (Object.keys(query).length > 0) {
|
||||
url += this.qs(query)
|
||||
}
|
||||
|
||||
const opt = {
|
||||
url,
|
||||
success,
|
||||
fail,
|
||||
complete
|
||||
}
|
||||
const opt = {
|
||||
url,
|
||||
success,
|
||||
fail,
|
||||
complete
|
||||
}
|
||||
|
||||
const dic = {
|
||||
1: uni.navigateTo,
|
||||
2: uni.redirectTo,
|
||||
3: uni.switchTab,
|
||||
4: uni.reLaunch
|
||||
}
|
||||
const dic = {
|
||||
1: uni.navigateTo,
|
||||
2: uni.redirectTo,
|
||||
3: uni.switchTab,
|
||||
4: uni.reLaunch
|
||||
}
|
||||
|
||||
const action = dic[type]
|
||||
const action = dic[type]
|
||||
|
||||
action(opt)
|
||||
},
|
||||
action(opt)
|
||||
},
|
||||
|
||||
/**
|
||||
* @description: 返回上一页
|
||||
* @param {*} e
|
||||
* @return {*}
|
||||
*/
|
||||
back(e) {
|
||||
/* 判断传入的是否是数字 */
|
||||
let pages = getCurrentPages()
|
||||
console.log('pgaes', pages)
|
||||
if (pages.length >= 2) {
|
||||
if (typeof e === 'number' && !isNaN(e)) {
|
||||
/* 如果要跳转的长度小于页面栈数量 */
|
||||
if (e < pages.length) {
|
||||
uni.navigateBack({ delta: e })
|
||||
/* 否则回首页 */
|
||||
} else {
|
||||
uni.switchTab({ url: '/pages/shouye/index' })
|
||||
}
|
||||
/* 默认返回上一级 */
|
||||
} else {
|
||||
uni.navigateBack({ delta: 1 })
|
||||
}
|
||||
} else {
|
||||
uni.switchTab({ url: '/pages/shouye/index' })
|
||||
}
|
||||
},
|
||||
/**
|
||||
* @description: 返回上一页
|
||||
* @param {*} e
|
||||
* @return {*}
|
||||
*/
|
||||
back(e) {
|
||||
/* 判断传入的是否是数字 */
|
||||
let pages = getCurrentPages()
|
||||
console.log('pgaes', pages)
|
||||
if (pages.length >= 2) {
|
||||
if (typeof e === 'number' && !isNaN(e)) {
|
||||
/* 如果要跳转的长度小于页面栈数量 */
|
||||
if (e < pages.length) {
|
||||
uni.navigateBack({
|
||||
delta: e
|
||||
})
|
||||
/* 否则回首页 */
|
||||
} else {
|
||||
uni.switchTab({
|
||||
url: '/pages/shouye/index'
|
||||
})
|
||||
}
|
||||
/* 默认返回上一级 */
|
||||
} else {
|
||||
uni.navigateBack({
|
||||
delta: 1
|
||||
})
|
||||
}
|
||||
} else {
|
||||
uni.switchTab({
|
||||
url: '/pages/shouye/index'
|
||||
})
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* @description: 提取富文本文字
|
||||
* @param {*} val
|
||||
* @return {*}
|
||||
*/
|
||||
filterText(val) {
|
||||
if (val) {
|
||||
var replaceLbael = val.replace(/<[^>]+>/g, '')
|
||||
return replaceLbael.replace(/ /ig, '')
|
||||
} else {
|
||||
return ''
|
||||
}
|
||||
},
|
||||
// 返回上一页
|
||||
$navBack(num = 1, time = 0) {
|
||||
// 页面返回
|
||||
setTimeout(() => {
|
||||
uni.navigateBack({
|
||||
delta: num,
|
||||
fail: () => {
|
||||
uni.reLaunch({
|
||||
url: '/pages/shouye/index'
|
||||
})
|
||||
}
|
||||
})
|
||||
}, time * 1000)
|
||||
},
|
||||
}
|
||||
/**
|
||||
* @description: 提取富文本文字
|
||||
* @param {*} val
|
||||
* @return {*}
|
||||
*/
|
||||
filterText(val) {
|
||||
if (val) {
|
||||
var replaceLbael = val.replace(/<[^>]+>/g, '')
|
||||
return replaceLbael.replace(/ /ig, '')
|
||||
} else {
|
||||
return ''
|
||||
}
|
||||
},
|
||||
// 返回上一页
|
||||
$navBack(num = 1, time = 0) {
|
||||
// 页面返回
|
||||
setTimeout(() => {
|
||||
uni.navigateBack({
|
||||
delta: num,
|
||||
fail: () => {
|
||||
uni.reLaunch({
|
||||
url: '/pages/shouye/index'
|
||||
})
|
||||
}
|
||||
})
|
||||
}, time * 1000)
|
||||
},
|
||||
/**
|
||||
* 分享
|
||||
* @param {Object} title
|
||||
* @param {Object} desc
|
||||
* @param {Object} link
|
||||
* @param {Object} image
|
||||
*/
|
||||
$fenxiang(title, desc, link, image) {
|
||||
// #ifdef H5
|
||||
Vue.prototype.req({
|
||||
url: 'getAccessTokenOffiaccountSign',
|
||||
data: {
|
||||
url: location.href.split('#')[0]
|
||||
},
|
||||
success: res => {
|
||||
console.log(res);
|
||||
if (res.status == 1) {
|
||||
let _data = res.data;
|
||||
wx.config({
|
||||
debug: false, // 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印。
|
||||
appId: _data.appId,
|
||||
timestamp: _data.timestamp,
|
||||
nonceStr: _data.noncestr,
|
||||
signature: _data.signature,
|
||||
jsApiList: [
|
||||
'checkJsApi',
|
||||
'updateAppMessageShareData',
|
||||
]
|
||||
});
|
||||
wx.ready(function() {
|
||||
wx.checkJsApi({
|
||||
jsApiList: [
|
||||
'openAddress',
|
||||
],
|
||||
success: function(res) {
|
||||
if (link.indexOf('http:') < 0 && link.indexOf(
|
||||
'https:') < 0) {
|
||||
link = location.href.split('#')[0] + link;
|
||||
}
|
||||
|
||||
wx.updateAppMessageShareData({
|
||||
title: title, // 分享标题
|
||||
desc: desc, // 分享描述
|
||||
link: link, // 分享链接,该链接域名或路径必须与当前页面对应的公众号JS安全域名一致
|
||||
imgUrl: image, // 分享图标
|
||||
success: function() {
|
||||
// 设置成功
|
||||
}
|
||||
})
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
});
|
||||
wx.error(function(res) {
|
||||
// config信息验证失败会执行error函数,如签名过期导致验证失败,具体错误信息可以打开config的debug模式查看,也可以在返回的res参数中查看,对于SPA可以在这里更新签名。
|
||||
console.log("出现错误", res);
|
||||
});
|
||||
}
|
||||
}
|
||||
})
|
||||
// #endif
|
||||
}
|
||||
}
|
||||
119
components/coupon-pop/coupon-pop.vue
Normal file
119
components/coupon-pop/coupon-pop.vue
Normal file
|
|
@ -0,0 +1,119 @@
|
|||
<!--
|
||||
* @Date: 2023-07-10 17:16:57
|
||||
* @LastEditTime: 2024-01-29 17:21:42
|
||||
* @Description: content
|
||||
-->
|
||||
<template>
|
||||
<uni-popup ref="_coupon_pop" type="center" maskBackgroundColor="rgba(0,0,0,0.9)">
|
||||
<view class="_coupon_pop common_bg" :style="bj">
|
||||
<view style="height:20rpx;">
|
||||
</view>
|
||||
<view style="height:240rpx;display: flex;">
|
||||
<view style="flex: 1;">
|
||||
|
||||
</view>
|
||||
<view style="flex: 3;display: flex;justify-content: center;align-items: center;">
|
||||
<image v-if="ruleData!=null" :src="ruleData.level_img" style="width:237.5rpx;height:237.5rpx;">
|
||||
</image>
|
||||
</view>
|
||||
<view style="text-align: right;flex: 1;">
|
||||
<image :src="$img1('image/pop/guanbi.png')" @click="close" style="width:50rpx;height:50rpx;">
|
||||
</image>
|
||||
</view>
|
||||
</view>
|
||||
<view
|
||||
style="color: #fff;text-align: center;font-size:40rpx;padding-top:10rpx;padding-bottom: 10rpx;height:64rpx;">
|
||||
恭喜抽中超神赏品!赠送<text style="color: #A664FF;" v-if="ruleData!=null">{{ruleData.level_text}}</text>
|
||||
</view>
|
||||
<view style="height:60rpx;">
|
||||
|
||||
</view>
|
||||
<view style="text-align: center;">
|
||||
<button v-if="!isH5" class="hide" open-type="share" :data-item="item" @click.stop></button>
|
||||
<image @click="fenxiang()" :src="$img1('image/pop/btn.png')" style="width: 528.47rpx;height:101rpx;">
|
||||
</image>
|
||||
</view>
|
||||
</view>
|
||||
</uni-popup>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
props: {
|
||||
noticeCheck: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
}
|
||||
},
|
||||
|
||||
data() {
|
||||
var isH5 = false;
|
||||
// #ifdef H5
|
||||
isH5 = true;
|
||||
// #endif
|
||||
var bj = this.$img1('image/pop/di.png');
|
||||
return {
|
||||
isH5,
|
||||
ruleData: null,
|
||||
todayHide: false,
|
||||
bj: {
|
||||
background: "url('" + bj + "') no-repeat",
|
||||
backgroundSize: "100%"
|
||||
}
|
||||
}
|
||||
},
|
||||
async onShareAppMessage(e) {
|
||||
var item = this.getData();
|
||||
|
||||
return item;
|
||||
},
|
||||
mounted() {
|
||||
console.log(this.noticeCheck)
|
||||
},
|
||||
|
||||
methods: {
|
||||
close() {
|
||||
this.$refs._coupon_pop.close()
|
||||
},
|
||||
getData() {
|
||||
const userInfo = uni.getStorageSync('userinfo')
|
||||
var data = {
|
||||
title: `快来领取${userInfo.nickname}分享的${this.ruleData.num}赏币的${this.ruleData.title}`,
|
||||
imageUrl: this.ruleData.level_img,
|
||||
path: '/pages/user/index' +
|
||||
this.$c.qs({
|
||||
ou_coupon_id: this.ruleData.id
|
||||
})
|
||||
}
|
||||
return data;
|
||||
},
|
||||
fenxiang() {
|
||||
if (!this.isH5) {
|
||||
return;
|
||||
}
|
||||
var data = this.getData();
|
||||
console.log(data);
|
||||
this.$c.$fenxiang(data.title, '', data.path, data.imageUrl);
|
||||
},
|
||||
open(opt) {
|
||||
this.ruleData = opt
|
||||
this.$refs._coupon_pop.open()
|
||||
},
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
._coupon_pop {
|
||||
width: 690.28rpx;
|
||||
height: 587.5rpx;
|
||||
box-sizing: border-box;
|
||||
padding: 0 20rpx 0;
|
||||
background: #3B3941;
|
||||
border-radius: 30rpx;
|
||||
background-size: 100%;
|
||||
|
||||
}
|
||||
</style>
|
||||
|
|
@ -84,7 +84,6 @@ export default {
|
|||
|
||||
async getRule(id, title = '') {
|
||||
let res = await this.$c.getRule(id, true)
|
||||
|
||||
this.open({
|
||||
title: title,
|
||||
content: res.data
|
||||
|
|
|
|||
|
|
@ -446,6 +446,7 @@
|
|||
<buy-notice ref="buyNotice" @confirm="$c.noDouble(confirmSubmit, [1, true])"></buy-notice>
|
||||
|
||||
<rule-pop ref="rulePop"></rule-pop>
|
||||
<coupon-pop ref="couponPop"></coupon-pop>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
|
|
@ -896,6 +897,11 @@
|
|||
|
||||
close(e) {
|
||||
this.$refs[e].close()
|
||||
if (e == "resPop") {
|
||||
if (this.prizeData['user_coupon'] != null) {
|
||||
this.$refs["couponPop"].open(this.prizeData['user_coupon']);
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
open(e) {
|
||||
|
|
|
|||
|
|
@ -5,14 +5,27 @@
|
|||
<view class="title" :style="{marginTop: statusBarHeight + 'rpx' }">
|
||||
商城好物
|
||||
</view>
|
||||
<image src="https://xinglanmh.shequtuangou.vip/static/image/20240711134727.png" style="width: 100%; margin-top: ;" mode=""></image>
|
||||
<image v-if="advert!=null&&advert.length>0" :src="advert[0].imgurl" style="width: 100%; margin-top: ;"
|
||||
mode=""></image>
|
||||
<!-- <view style="background-image: url('https://xinglanmh.shequtuangou.vip/static/image/20240711134727.png');background-size: 100% 100%;height:600rpx;">
|
||||
<view style="height:200rpx;"></view>
|
||||
<view style="width:90%;height:286rpx;margin-left: 5%;">
|
||||
<swiper class="swiper-box" :autoplay="true" :indicator-dots="false" :circular="true" :interval="3000">
|
||||
<swiper-item v-for="(v, i) in advert" :key="i" @click="$c.navTo(v)">
|
||||
<image class="yh_bg" :src="v.imgurl" style="width: 100%;height: 100%;"></image>
|
||||
</swiper-item>
|
||||
</swiper>
|
||||
</view>
|
||||
</view> -->
|
||||
|
||||
|
||||
</view>
|
||||
|
||||
<view class="grid-container">
|
||||
<view v-for="(item,index) in datas" :key="index" class="grid-item" @click="order_money(item)">
|
||||
<image src="https://xinglanmh.shequtuangou.vip/static/image/20240711134549.png" style="height: 430rpx; position: absolute;"
|
||||
mode="heightFix"></image>
|
||||
|
||||
<image src="https://xinglanmh.shequtuangou.vip/static/image/20240711134549.png"
|
||||
style="height: 430rpx; position: absolute;" mode="heightFix"></image>
|
||||
|
||||
<image :src="item.imgurl"
|
||||
style=" width: 326.39rpx; height: 326.39rpx; position: absolute; left: 2rpx;" mode=""></image>
|
||||
|
||||
|
|
@ -142,6 +155,7 @@
|
|||
return {
|
||||
statusBarHeight: 0,
|
||||
datas: [],
|
||||
advert: [],
|
||||
sendRuleData: '',
|
||||
goodsId: "",
|
||||
orderData: null,
|
||||
|
|
@ -161,7 +175,7 @@
|
|||
});
|
||||
|
||||
this.getData();
|
||||
|
||||
this.load();
|
||||
this.$c.getRule(10).then(res => {
|
||||
if (res.status == 1) {
|
||||
this.sendRuleData = res.data
|
||||
|
|
@ -178,6 +192,18 @@
|
|||
}
|
||||
},
|
||||
methods: {
|
||||
load() {
|
||||
let that = this
|
||||
that.req({
|
||||
url: 'getAdvert?type_id=3',
|
||||
success(res) {
|
||||
if (res.status == 1) {
|
||||
that.advert = res.data
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
},
|
||||
getStatusBarHeight() {
|
||||
const systemInfo = uni.getSystemInfoSync();
|
||||
this.statusBarHeight = systemInfo.statusBarHeight;
|
||||
|
|
@ -301,7 +327,7 @@
|
|||
if (type == 1) {
|
||||
that.close('pop')
|
||||
if (res.data.status == 1) {
|
||||
|
||||
|
||||
const status = await that.$c.wxMpPay({
|
||||
data: res.data.res
|
||||
})
|
||||
|
|
@ -309,10 +335,10 @@
|
|||
// that.getPrize(res.data.order_num)
|
||||
that.getData();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
} else {
|
||||
that.$c.toast({
|
||||
title: res.msg,
|
||||
|
|
|
|||
|
|
@ -42,8 +42,10 @@
|
|||
</view>
|
||||
<view class="header-footer relative">
|
||||
<view class="header-footer-one">
|
||||
<image v-if="pageData.goods.type == 5" @click="$refs.rulePop.getRule(13, '购买说明')" :src="$img1('common/gzsm.png')"></image>
|
||||
<image v-else-if="pageData.goods.type == 6" @click="$refs.rulePop.getRule(18, '购买说明')" :src="$img1('common/gzsm.png')"></image>
|
||||
<image v-if="pageData.goods.type == 5" @click="$refs.rulePop.getRule(13, '购买说明')"
|
||||
:src="$img1('common/gzsm.png')"></image>
|
||||
<image v-else-if="pageData.goods.type == 6" @click="$refs.rulePop.getRule(18, '购买说明')"
|
||||
:src="$img1('common/gzsm.png')"></image>
|
||||
<image v-else @click="$refs.rulePop.getRule(7, '购买说明')" :src="$img1('common/gzsm.png')"></image>
|
||||
</view>
|
||||
<view class="header-footer-two" @tap="tabChange(1)">
|
||||
|
|
@ -91,7 +93,9 @@
|
|||
<view class="list-item" v-for="(item, i) in pageData.goodslist" :key="i" @click="previewDetail(item)">
|
||||
<view class="pic center relative">
|
||||
<image class="pic-img" :src="item.imgurl" mode="aspectFit"></image>
|
||||
<view class="type-tag center" :style="{background: item.shang_info?item.shang_info.color:'#FFFFFF'}">{{ item.shang_info?item.shang_info.title:'' }}</view>
|
||||
<view class="type-tag center"
|
||||
:style="{background: item.shang_info?item.shang_info.color:'#FFFFFF'}">
|
||||
{{ item.shang_info?item.shang_info.title:'' }}</view>
|
||||
<view class="num center bgfff">{{ item.surplus_stock }}/{{ item.stock }}</view>
|
||||
<view v-if="item.goods_type == 2" class="yu-tag ziti">预售</view>
|
||||
<view v-if="item.surplus_stock <= 0" class="shadow center">
|
||||
|
|
@ -140,7 +144,8 @@
|
|||
<image class="img100" :src="item.goodslist_imgurl" lazy-load></image>
|
||||
</view>
|
||||
<view class="column align-end">
|
||||
<view :style="{background: item.shang_color}" class="prize-shang center">{{item.shang_title}}</view>
|
||||
<view :style="{background: item.shang_color}" class="prize-shang center">
|
||||
{{item.shang_title}}</view>
|
||||
<view class="flex mt10">
|
||||
<view class="title hang1">
|
||||
{{ item.goodslist_title }}
|
||||
|
|
@ -200,7 +205,8 @@
|
|||
<view v-if="previewData" class="d-pop">
|
||||
<view class="pic center relative">
|
||||
<image :src="previewData.imgurl" lazy-load></image>
|
||||
<view class="justify-center" v-if="previewData.shang_info.title">{{previewData.shang_info.title}}</view>
|
||||
<view class="justify-center" v-if="previewData.shang_info.title">{{previewData.shang_info.title}}
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="title">
|
||||
|
|
@ -297,7 +303,7 @@
|
|||
? `-${couponData.price}`
|
||||
: '未选择'
|
||||
}}
|
||||
|
||||
|
||||
<view class="icon">
|
||||
<image :src="$img1('common/right1.png')" lazy-load></image>
|
||||
</view>
|
||||
|
|
@ -458,6 +464,7 @@
|
|||
</view>
|
||||
|
||||
<rule-pop ref="rulePop"></rule-pop>
|
||||
<coupon-pop ref="couponPop"></coupon-pop>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
|
|
@ -836,7 +843,7 @@
|
|||
num,
|
||||
size
|
||||
}) {
|
||||
if(num>1) return this.mescroll.endByPage(this.logList.length, 1)
|
||||
if (num > 1) return this.mescroll.endByPage(this.logList.length, 1)
|
||||
this.req({
|
||||
url: 'shang_log',
|
||||
data: {
|
||||
|
|
@ -887,6 +894,11 @@
|
|||
|
||||
close(e) {
|
||||
this.$refs[e].close()
|
||||
if (e == "resPop") {
|
||||
if (this.prizeData['user_coupon'] != null) {
|
||||
this.$refs["couponPop"].open(this.prizeData['user_coupon']);
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
open(e) {
|
||||
|
|
@ -944,7 +956,7 @@
|
|||
color: #FFFFFF;
|
||||
background: #3B3941;
|
||||
border-radius: 8rpx 8rpx 8rpx 8rpx;
|
||||
border: 2rpx solid rgba(255,255,255,0.27);
|
||||
border: 2rpx solid rgba(255, 255, 255, 0.27);
|
||||
}
|
||||
|
||||
&:last-child {
|
||||
|
|
@ -1001,7 +1013,8 @@
|
|||
padding-left: 60rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
.prize-shang{
|
||||
|
||||
.prize-shang {
|
||||
height: 40rpx;
|
||||
padding: 0 20rpx;
|
||||
// background: #B07AF3;
|
||||
|
|
@ -1011,6 +1024,7 @@
|
|||
font-size: 24rpx;
|
||||
color: #FFFFFF;
|
||||
}
|
||||
|
||||
.pic {
|
||||
width: 80rpx;
|
||||
height: 80rpx;
|
||||
|
|
@ -1039,11 +1053,12 @@
|
|||
.header {
|
||||
width: 750rpx;
|
||||
height: 722rpx;
|
||||
&-wuzhe{
|
||||
|
||||
&-wuzhe {
|
||||
width: 160rpx;
|
||||
height: 60rpx;
|
||||
position: absolute;
|
||||
top:300rpx;
|
||||
top: 300rpx;
|
||||
left: 0;
|
||||
}
|
||||
|
||||
|
|
@ -1116,8 +1131,8 @@
|
|||
color: #000000;
|
||||
}
|
||||
}
|
||||
|
||||
&-shoucang{
|
||||
|
||||
&-shoucang {
|
||||
width: 120rpx;
|
||||
height: 64rpx;
|
||||
position: absolute;
|
||||
|
|
@ -1125,12 +1140,14 @@
|
|||
bottom: 140rpx;
|
||||
box-sizing: border-box;
|
||||
background: url($imgurl+'/common/shoucang.png') no-repeat 0 0 / 100% 100%;
|
||||
>image{
|
||||
|
||||
>image {
|
||||
width: 28rpx;
|
||||
height: 28rpx;
|
||||
margin-top: 22rpx;
|
||||
}
|
||||
>text{
|
||||
|
||||
>text {
|
||||
font-weight: 400;
|
||||
font-size: 24rpx;
|
||||
color: #FFFFFF;
|
||||
|
|
@ -1320,7 +1337,7 @@
|
|||
.yu-tag {
|
||||
position: absolute;
|
||||
right: 10rpx;
|
||||
top: 10rpx;
|
||||
top: 10rpx;
|
||||
z-index: 1;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
|
|
@ -1457,18 +1474,20 @@
|
|||
position: relative;
|
||||
width: 570rpx;
|
||||
box-sizing: border-box;
|
||||
|
||||
|
||||
.pic {
|
||||
width: 570rpx;
|
||||
height: 598rpx;
|
||||
// background: #8953DC;
|
||||
background: #FFFFFF;
|
||||
border: 2rpx solid #FFFFFF;
|
||||
>image{
|
||||
|
||||
>image {
|
||||
width: 548rpx;
|
||||
height: 549rpx;
|
||||
}
|
||||
>view{
|
||||
|
||||
>view {
|
||||
width: 130rpx;
|
||||
height: 46rpx;
|
||||
position: absolute;
|
||||
|
|
@ -1481,7 +1500,7 @@
|
|||
background: url($imgurl+'common/chouLabel.png') no-repeat 0 0 / 100% 100%;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
.title {
|
||||
margin: 40rpx auto 0;
|
||||
width: 574rpx;
|
||||
|
|
@ -1495,30 +1514,30 @@
|
|||
border: 2rpx solid #894DD3;
|
||||
border-radius: 12rpx;
|
||||
background: #313133;
|
||||
|
||||
|
||||
>text {
|
||||
font-weight: 400;
|
||||
font-size: 32rpx;
|
||||
color: #FFFFFF;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
.d-list {
|
||||
display: flex;
|
||||
flex-flow: row wrap;
|
||||
justify-content: space-between;
|
||||
padding: 20rpx 0 0;
|
||||
|
||||
|
||||
.d-item {
|
||||
margin-top: 14rpx;
|
||||
|
||||
|
||||
font-size: 24rpx;
|
||||
font-family: Source Han Sans CN;
|
||||
font-weight: 400;
|
||||
color: #ffffff;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
.close {
|
||||
width: 48rpx;
|
||||
height: 48rpx;
|
||||
|
|
@ -1732,11 +1751,13 @@
|
|||
justify-content: center;
|
||||
font-weight: 500;
|
||||
color: #7825DE;
|
||||
>text:nth-child(1){
|
||||
|
||||
>text:nth-child(1) {
|
||||
font-size: 28rpx;
|
||||
margin-top: 32rpx;
|
||||
}
|
||||
>text:nth-child(2){
|
||||
|
||||
>text:nth-child(2) {
|
||||
font-size: 36rpx;
|
||||
margin-top: 26rpx;
|
||||
}
|
||||
|
|
@ -1775,7 +1796,8 @@
|
|||
position: relative;
|
||||
background: #8953DC;
|
||||
border: 2rpx solid #FFFFFF;
|
||||
>image{
|
||||
|
||||
>image {
|
||||
width: 202rpx;
|
||||
height: 202rpx;
|
||||
}
|
||||
|
|
@ -1807,6 +1829,7 @@
|
|||
text-shadow: #000 1rpx 0 0, #000 0 1rpx 0, #000 -1rpx 0 0, #000 0 -1rpx 0;
|
||||
}
|
||||
}
|
||||
|
||||
.title {
|
||||
padding: 10rpx 10rpx 0;
|
||||
font-weight: 400;
|
||||
|
|
@ -1834,14 +1857,17 @@
|
|||
height: 116rpx;
|
||||
font-weight: 400;
|
||||
font-size: 28rpx;
|
||||
>text{
|
||||
|
||||
>text {
|
||||
margin-top: 36rpx;
|
||||
}
|
||||
}
|
||||
>view:nth-child(1){
|
||||
|
||||
>view:nth-child(1) {
|
||||
color: #DE6025;
|
||||
}
|
||||
>view:nth-child(2){
|
||||
|
||||
>view:nth-child(2) {
|
||||
color: #7825DE;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -184,8 +184,8 @@
|
|||
</view>
|
||||
</view> -->
|
||||
<view v-if="pageData" class="ft-fixed justify-evenly">
|
||||
<view class="btn common_bg column center" :style="{ backgroundImage: `url(${$img1('common/chouBtn1.png')})`}"
|
||||
@click="confirmSubmit([0, 1])">
|
||||
<view class="btn common_bg column center"
|
||||
:style="{ backgroundImage: `url(${$img1('common/chouBtn1.png')})`}" @click="confirmSubmit([0, 1])">
|
||||
<!-- <view>冲一发</view> -->
|
||||
</view>
|
||||
<view class="btn common_bg column center" :style="{backgroundImage: `url(${$img1('common/chouBtn3.png')})`}"
|
||||
|
|
@ -196,8 +196,8 @@
|
|||
@click="confirmSubmit([0, 5])">
|
||||
<!-- <view>冲五发</view> -->
|
||||
</view>
|
||||
<view class="btn common_bg column center" :style="{backgroundImage: `url(${$img1('common/chouBtn10.png')})`}"
|
||||
@click="confirmSubmit([0, 10])">
|
||||
<view class="btn common_bg column center"
|
||||
:style="{backgroundImage: `url(${$img1('common/chouBtn10.png')})`}" @click="confirmSubmit([0, 10])">
|
||||
<!-- <view>冲十发</view> -->
|
||||
</view>
|
||||
</view>
|
||||
|
|
@ -528,6 +528,7 @@
|
|||
<buy-notice ref="buyNotice" @confirm="$c.noDouble(confirmSubmit, [1, buyNum, true])"></buy-notice>
|
||||
|
||||
<rule-pop ref="rulePop"></rule-pop>
|
||||
<coupon-pop ref="couponPop"></coupon-pop>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
|
|
@ -535,6 +536,7 @@
|
|||
export default {
|
||||
data() {
|
||||
return {
|
||||
userCoupon: null,
|
||||
optData: '',
|
||||
buyNum: 0,
|
||||
useMoney: true,
|
||||
|
|
@ -631,6 +633,7 @@
|
|||
// this.aniSrc = path
|
||||
// }
|
||||
// })
|
||||
//$refs.rulePop.getRule(pageData.danye_id, '购买说明')
|
||||
|
||||
this.$c.getRule(10).then(res => {
|
||||
if (res.status == 1) {
|
||||
|
|
@ -667,7 +670,7 @@
|
|||
this.$refs.bossScroll.mescroll.resetUpScroll()
|
||||
this.$refs.bossScroll.mescroll.scrollTo(0, 0)
|
||||
},
|
||||
|
||||
|
||||
previewDetail(item, a) {
|
||||
const obj = {
|
||||
imgurl: a.imgurl,
|
||||
|
|
@ -932,7 +935,7 @@
|
|||
num,
|
||||
size
|
||||
}) {
|
||||
if(num>1) return this.mescroll.endByPage(this.logList.length, 1)
|
||||
if (num > 1) return this.mescroll.endByPage(this.logList.length, 1)
|
||||
this.req({
|
||||
url: 'infinite_shang_log',
|
||||
data: {
|
||||
|
|
@ -988,6 +991,11 @@
|
|||
|
||||
close(e) {
|
||||
this.$refs[e].close()
|
||||
if (e == "resPop") {
|
||||
if (this.prizeData['user_coupon'] != null) {
|
||||
this.$refs["couponPop"].open(this.prizeData['user_coupon']);
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
open(e) {
|
||||
|
|
@ -1001,6 +1009,14 @@
|
|||
})
|
||||
}
|
||||
|
||||
// if (e == "resPop") {
|
||||
// this.$nextTick(() => {
|
||||
// setTimeout(() => {
|
||||
// this.$refs["couponPop"].open()
|
||||
// }, 200)
|
||||
// })
|
||||
// }
|
||||
|
||||
if (e == 'playPop') {
|
||||
this.$c.getRule(14).then(res => {
|
||||
if (res.status == 1) {
|
||||
|
|
@ -1183,11 +1199,12 @@
|
|||
.header {
|
||||
width: 750rpx;
|
||||
height: 722rpx;
|
||||
&-wuzhe{
|
||||
|
||||
&-wuzhe {
|
||||
width: 160rpx;
|
||||
height: 60rpx;
|
||||
position: absolute;
|
||||
top:300rpx;
|
||||
top: 300rpx;
|
||||
left: 0;
|
||||
}
|
||||
|
||||
|
|
@ -1499,7 +1516,7 @@
|
|||
.goods-list {
|
||||
padding: 30rpx 0rpx 0;
|
||||
display: grid;
|
||||
grid-template-columns: repeat(3,220rpx);
|
||||
grid-template-columns: repeat(3, 220rpx);
|
||||
grid-gap: 20rpx;
|
||||
|
||||
.goods-item {
|
||||
|
|
|
|||
|
|
@ -32,17 +32,20 @@
|
|||
<view class="sw-dot relative">
|
||||
<view class="sw-dot-item" v-for="(item, i) in advert" :key="i" :class="{act: swCur == i}"></view>
|
||||
</view>
|
||||
|
||||
<!-- 推荐上新 -->
|
||||
<view class="flex yqhy" style="margin-top: 60rpx; position: relative;"
|
||||
@tap="$c.to({url:'/pages/user/tui-guang'})">
|
||||
<view class="flex yqhy" v-if="tuijian.length>0" style="margin-top: 60rpx; position: relative;"
|
||||
|
||||
>
|
||||
<image class="img100" style="position: absolute; display: flex; justify-content: center;"
|
||||
:src="$img1('/image/tuijian.png')"></image>
|
||||
:src="$img1('/image/a6548-pw1cx.webp')"></image>
|
||||
<view class=""
|
||||
style="position: absolute; width: 585rpx; height: 230rpx; margin-left: 85rpx; display: flex; flex-direction: row; align-items: center; justify-content: space-between;">
|
||||
<view class="" style="width: 181rpx; height: 181rpx; background-color: aquamarine;"></view>
|
||||
<view class="" style="width: 181rpx; height: 181rpx; background-color: aquamarine;"></view>
|
||||
<view class="" style="width: 181rpx; height: 181rpx; background-color: aquamarine;"></view>
|
||||
style="position: absolute; width: 585rpx; height: 230rpx; margin-left: 85rpx; display: flex; flex-direction: row; align-items: center; justify-content: space-between;overflow: auto;">
|
||||
|
||||
<view v-for="(item,index) in tuijian" class="" style="width: 181rpx; height: 181rpx;flex: 0 0 auto; margin:0px 2px;">
|
||||
<image class="yh_bg" :src="item.imgurl" @click="$c.navTo(item,index)" ></image>
|
||||
</view>
|
||||
<!-- <view class="" style="width: 181rpx; height: 181rpx; background-color: aquamarine;"></view>
|
||||
<view class="" style="width: 181rpx; height: 181rpx; background-color: aquamarine;"></view> -->
|
||||
</view>
|
||||
</view>
|
||||
|
||||
|
|
@ -233,6 +236,7 @@
|
|||
}
|
||||
},
|
||||
advert: [], //轮播图
|
||||
tuijian: [], //推荐上新
|
||||
notice_list: [], // 弹幕
|
||||
erweima: '', // 福利群
|
||||
yushou_rili: '', // 预售日历
|
||||
|
|
@ -408,6 +412,7 @@
|
|||
success(res) {
|
||||
if (res.status == 1) {
|
||||
that.advert = res.data.advert
|
||||
that.tuijian = res.data.tuijian;
|
||||
that.notice_list = res.data.new_bulletcha
|
||||
that.erweima = res.data.other.erweima
|
||||
that.gonggao = res.data.notice.content
|
||||
|
|
|
|||
|
|
@ -4,27 +4,40 @@
|
|||
<uni-icons type="left" style="position: absolute; left: 30rpx;" color="#FFFFFF"></uni-icons>
|
||||
<view class="">排行榜</view>
|
||||
</view>
|
||||
|
||||
<view class="" style="margin-top: 90rpx; width: 683rpx; height: 286rpx; background-color: aquamarine;">
|
||||
55555555
|
||||
<view class="" style="margin-top: 90rpx; width: 683rpx; height: 286rpx;">
|
||||
<swiper class="swiper-box" :autoplay="true" :indicator-dots="false" :circular="true" :interval="3000">
|
||||
<swiper-item v-for="(v, i) in advert" :key="i" @click="$c.navTo(v)">
|
||||
<image class="yh_bg" :src="v.imgurl" style="width: 100%;height: 100%;"></image>
|
||||
</swiper-item>
|
||||
</swiper>
|
||||
</view>
|
||||
|
||||
<view class="" style="width: 683rpx; margin-top: 43rpx;">
|
||||
<view class="" v-for="(index,data) in list" style="display: flex; flex-direction: row; align-items: center; margin-top: 22rpx;">
|
||||
<view class="" style="width: 30rpx; height: 35rpx; background-color: aquamarine;">
|
||||
|
||||
<view class="" v-for="(item,index) in list"
|
||||
style="display: flex; flex-direction: row; align-items: center; margin-top: 22rpx;">
|
||||
<view class="" v-if="index == 0 " style="width: 30rpx; height: 35rpx;color: #B8B8B8;text-align:center;">
|
||||
<image :src="$img1('/image/1.png')" style="width: 30rpx; height: 35rpx;"></image>
|
||||
</view>
|
||||
<view class="" v-if="index == 1 " style="width: 30rpx; height: 35rpx;color: #B8B8B8;text-align:center;">
|
||||
<image :src="$img1('/image/2.png')" style="width: 30rpx; height: 35rpx;"></image>
|
||||
</view>
|
||||
<view class="" v-if="index == 2 " style="width: 30rpx; height: 35rpx;color: #B8B8B8;text-align:center;">
|
||||
<image :src="$img1('/image/3.png')" style="width: 30rpx; height: 35rpx;"></image>
|
||||
</view>
|
||||
<view class="" v-if="index > 2 " style="width: 30rpx; height: 35rpx;color: #B8B8B8;text-align:center;">
|
||||
{{index}}
|
||||
</view>
|
||||
|
||||
<view class="" style="width: 94rpx; height: 94rpx; background-color: azure; margin-left: 30rpx;">
|
||||
|
||||
<image :src="item.headimg" style="width: 94rpx; height: 94rpx;"></image>
|
||||
</view>
|
||||
<view class="" style="display: flex; flex-direction: column; margin-left: 28rpx;">
|
||||
<text style="font-size: 33rpx; color: white;">昵称昵称</text>
|
||||
<text style="font-size: 22rpx; color: #B8B8B8; margin-top: 15rpx;">ID:1234567</text>
|
||||
<text style="font-size: 33rpx; color: white;">{{item.nickname}}</text>
|
||||
<text style="font-size: 22rpx; color: #B8B8B8; margin-top: 15rpx;">ID:{{item.user_id}}</text>
|
||||
</view>
|
||||
|
||||
<view class="" style="position: absolute; right: 33rpx;">
|
||||
<span style="color: white; font-size: 27rpx;">¥<span style="font-size: 41rpx;">99999</span></span>
|
||||
<span style="color: white; font-size: 27rpx;">¥<span
|
||||
style="font-size: 41rpx;">{{item.price}}</span></span>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
|
|
@ -38,11 +51,34 @@
|
|||
data() {
|
||||
var list;
|
||||
return {
|
||||
list: [1, 2, 3, 4, 5],
|
||||
advert: [], //轮播图
|
||||
list: [],
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
this.load();
|
||||
},
|
||||
methods: {
|
||||
|
||||
load() {
|
||||
let that = this
|
||||
that.req({
|
||||
url: 'getAdvert?type_id=4',
|
||||
success(res) {
|
||||
if (res.status == 1) {
|
||||
that.advert = res.data
|
||||
}
|
||||
}
|
||||
})
|
||||
that.req({
|
||||
url: 'record',
|
||||
success(res) {
|
||||
console.log(res);
|
||||
if (res.status == 1) {
|
||||
that.list = res.data.list
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
|
|
|||
|
|
@ -22,7 +22,8 @@
|
|||
</view>
|
||||
|
||||
<scroll-view class="tab" scroll-x>
|
||||
<view class="tab-item common_bg relative" v-for="(item, i) in tabList" :key="i" :class="tabCur==i?'act':'unact'" @click="tabChange(i)">
|
||||
<view class="tab-item common_bg relative" v-for="(item, i) in tabList" :key="i"
|
||||
:class="tabCur==i?'act':'unact'" @click="tabChange(i)">
|
||||
<text>
|
||||
{{ item.title }}
|
||||
</text>
|
||||
|
|
@ -46,8 +47,8 @@
|
|||
<!-- <view class="open-num">{{ item.num }}岚币</view> -->
|
||||
<view class="num">需要{{ item.kl_num2 }}个参与者</view>
|
||||
</view>
|
||||
<view v-if="tabList[tabCur].id == 1" class="share-btn relative">
|
||||
<button class="hide" open-type="share" :data-item="item" @click.stop></button>
|
||||
<view v-if="tabList[tabCur].id == 1" class="share-btn relative" @click="h5share(item)">
|
||||
<button v-if="!isH5" class="hide" open-type="share" :data-item="item" @click.stop></button>
|
||||
立即分享
|
||||
</view>
|
||||
|
||||
|
|
@ -63,8 +64,7 @@
|
|||
|
||||
<view class="progress mt20" v-if="item.yi_ling != item.kl_num2">
|
||||
<cmd-progress :percent="(item.yi_ling / item.kl_num2) * 100" :show-info="false"
|
||||
stroke-color="#D3AFFF"
|
||||
:strokeWidth="5"></cmd-progress>
|
||||
stroke-color="#D3AFFF" :strokeWidth="5"></cmd-progress>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
|
|
@ -107,8 +107,14 @@
|
|||
|
||||
<script>
|
||||
export default {
|
||||
|
||||
data() {
|
||||
var isH5 = false;
|
||||
// #ifdef H5
|
||||
isH5 = true;
|
||||
// #endif
|
||||
return {
|
||||
isH5,
|
||||
// 下拉刷新的配置(可选, 绝大部分情况无需配置)
|
||||
downOption: {
|
||||
auto: false
|
||||
|
|
@ -176,6 +182,21 @@
|
|||
onShow() {},
|
||||
|
||||
methods: {
|
||||
async h5share(item) {
|
||||
|
||||
const userInfo = uni.getStorageSync('userinfo')
|
||||
await this.beforeShare(item.id)
|
||||
var data = {
|
||||
title: `快来领取${userInfo.nickname}分享的${item.num}赏币的${item.title}`,
|
||||
imageUrl: item.level_img,
|
||||
path: '/pages/user/index' +
|
||||
this.$c.qs({
|
||||
ou_coupon_id: item.id
|
||||
})
|
||||
}
|
||||
console.log(data);
|
||||
this.$c.$fenxiang(data.title, '', data.path, data.imageUrl);
|
||||
},
|
||||
beforeShare(coupon_id) {
|
||||
return new Promise((resolve, reject) => {
|
||||
this.req({
|
||||
|
|
@ -400,18 +421,21 @@
|
|||
border: 4rpx solid #FFFFFF;
|
||||
background: #894DD3;
|
||||
border-radius: 40rpx;
|
||||
>view:nth-child(1){
|
||||
>image{
|
||||
|
||||
>view:nth-child(1) {
|
||||
>image {
|
||||
width: 70rpx;
|
||||
height: 70rpx;
|
||||
}
|
||||
>view{
|
||||
>text:nth-child(1){
|
||||
|
||||
>view {
|
||||
>text:nth-child(1) {
|
||||
font-weight: 400;
|
||||
font-size: 24rpx;
|
||||
color: #FFFFFF;
|
||||
}
|
||||
>text:nth-child(2){
|
||||
|
||||
>text:nth-child(2) {
|
||||
font-weight: 700;
|
||||
font-size: 36rpx;
|
||||
color: #FFFFFF;
|
||||
|
|
@ -432,7 +456,8 @@
|
|||
margin-right: 10rpx;
|
||||
}
|
||||
}
|
||||
&-box{
|
||||
|
||||
&-box {
|
||||
position: absolute;
|
||||
width: 140rpx;
|
||||
height: 140rpx;
|
||||
|
|
@ -466,6 +491,7 @@
|
|||
|
||||
&.act {
|
||||
background: url($imgurl+'index/checkTab.png') no-repeat 0 0 / 100% 100%;
|
||||
|
||||
text {
|
||||
font-weight: 400;
|
||||
font-size: 28rpx;
|
||||
|
|
@ -476,6 +502,7 @@
|
|||
|
||||
&.unact {
|
||||
background: url($imgurl+'index/uncheckTab.png') no-repeat 0 0 / 100% 100%;
|
||||
|
||||
text {
|
||||
font-weight: 400;
|
||||
font-size: 28rpx;
|
||||
|
|
|
|||
|
|
@ -111,64 +111,9 @@
|
|||
this.loadData(page.num)
|
||||
},
|
||||
fenxiang() {
|
||||
var that = this;
|
||||
var image=this.$baseUrl+"/storage/topic/20240617/30a73c0d5061f700a66f653deeb60f6d.jpg";
|
||||
console.log(image);
|
||||
// #ifdef H5
|
||||
this.req({
|
||||
url: 'getAccessTokenOffiaccountSign',
|
||||
data: {
|
||||
// recovery_info: JSON.stringify(data)
|
||||
url: location.href.split('#')[0]
|
||||
},
|
||||
success: res => {
|
||||
console.log(res);
|
||||
if (res.status == 1) {
|
||||
var _data = res.data;
|
||||
wx.config({
|
||||
debug: false, // 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印。
|
||||
appId: _data.appId,
|
||||
timestamp: _data.timestamp,
|
||||
nonceStr: _data.noncestr,
|
||||
signature: _data.signature,
|
||||
jsApiList: [
|
||||
'checkJsApi',
|
||||
'updateAppMessageShareData',
|
||||
|
||||
]
|
||||
});
|
||||
wx.ready(function() {
|
||||
wx.checkJsApi({
|
||||
jsApiList: [
|
||||
'openAddress',
|
||||
],
|
||||
success: function(res) {
|
||||
// alert(res);
|
||||
// console.log(res);
|
||||
var urlx = location.href.split('#')[0] +
|
||||
'#/pages/shouye/index?pid=' + uni
|
||||
.getStorageSync('userinfo').ID;
|
||||
wx.updateAppMessageShareData({
|
||||
title: '枫岚一番,正版潮玩手办一番赏', // 分享标题
|
||||
desc: '', // 分享描述
|
||||
link: urlx, // 分享链接,该链接域名或路径必须与当前页面对应的公众号JS安全域名一致
|
||||
imgUrl: image, // 分享图标
|
||||
success: function() {
|
||||
// 设置成功
|
||||
}
|
||||
})
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
});
|
||||
wx.error(function(res) {
|
||||
// config信息验证失败会执行error函数,如签名过期导致验证失败,具体错误信息可以打开config的debug模式查看,也可以在返回的res参数中查看,对于SPA可以在这里更新签名。
|
||||
console.log("出现错误", res);
|
||||
});
|
||||
}
|
||||
}
|
||||
})
|
||||
var image = this.$baseUrl + "/storage/topic/20240617/30a73c0d5061f700a66f653deeb60f6d.jpg";
|
||||
var path = '/pages/shouye/index?pid=' + uni.getStorageSync('userinfo').ID;
|
||||
this.$c.$fenxiang('枫岚一番,正版潮玩手办一番赏', '', path, image);
|
||||
|
||||
},
|
||||
loadData(pageNo) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user