Compare commits

...

93 Commits

Author SHA1 Message Date
e748fddd5c ... 2022-12-30 11:27:25 +08:00
3da1772433 ... 2022-11-24 09:18:33 +08:00
2695f8ea9e merge 2022-10-13 14:37:43 +08:00
d9d9516984 多规格选择购买页面数量赋值问题处理 2022-10-13 14:36:32 +08:00
唐明明
52f37adbde merge 2022-10-12 17:15:59 +08:00
唐明明
7f3b00e1db 删除 'uni_modules/.DS_Store' 2022-10-12 16:52:27 +08:00
唐明明
587defc1b5 删除 'pages/.DS_Store' 2022-10-12 16:52:09 +08:00
唐明明
466c4e707a merge 2022-10-12 16:51:17 +08:00
60c2738592 修改弹窗提示问题 2022-10-12 15:13:43 +08:00
510a6e15a9 ... 2022-10-12 10:08:17 +08:00
c8159718c4 登录新增图文验证 2022-10-12 10:01:32 +08:00
1619e53ad1 merge 2022-10-11 16:51:51 +08:00
83fe74d948 登录页面图片验证处理 2022-10-11 16:48:16 +08:00
唐明明
867ed59737 merge 2022-09-23 17:10:22 +08:00
唐明明
7ac84c1c66 删除 'uni_modules/.DS_Store' 2022-09-23 17:05:03 +08:00
唐明明
7d82e4a03c 删除 'pages/.DS_Store' 2022-09-23 17:04:47 +08:00
唐明明
812d0f0298 删除 'components/.DS_Store' 2022-09-23 17:04:33 +08:00
唐明明
1191e30f21 调整会员开通,DT充值流程 2022-09-23 17:03:17 +08:00
唐明明
9002c868c4 河马支付 2022-09-23 17:02:55 +08:00
c20f6cd005 视频广告顶部关闭声音页面处理,处理拼别人团再看看跳转等细节 2022-09-23 12:45:36 +08:00
6c21c2193c 隐藏拼团和任务入口正式环境 2022-09-23 09:24:21 +08:00
a740c90582 忽略冲突的unpackage打包文件 2022-09-22 14:32:15 +08:00
8bf4442eed 同步数据 2022-09-22 14:29:39 +08:00
唐明明
872a125fc1 merge 2022-09-21 15:05:24 +08:00
唐明明
30881978bd merge 2022-09-21 15:05:04 +08:00
唐明明
bdcc6c3614 merge 2022-09-21 15:03:23 +08:00
dbe1bb26a4 Merge branch 'master' of https://git.yuzhankeji.cn/TmOct5/dtx_store 2022-08-31 17:07:30 +08:00
d34745adc2 已领商品及已领dt积分同步 2022-08-31 17:07:26 +08:00
唐明明
4266eaad98 新增分公司带票记录 2022-08-31 15:19:35 +08:00
a6ec9a8d45 ... 2022-08-31 10:55:46 +08:00
07e6a5d5bb 动态兼容个人中心我的拼单列表 2022-08-31 10:54:32 +08:00
d5f5b596ea 任务关闭入口 2022-08-31 10:42:00 +08:00
68df0a014f 排行榜新增本月排行及上月排行筛选 2022-08-31 10:33:36 +08:00
347e9a05e0 颜色调整已领商品及已领dt积分 2022-08-31 09:38:19 +08:00
94f10ce4af 已领dt积分列表页面搭建 2022-08-31 09:36:06 +08:00
7f240feac7 merge 2022-08-31 09:07:18 +08:00
3410132c97 任务首页搭建 2022-08-31 09:07:00 +08:00
唐明明
315a034aed 修复多规格显示错误 2022-08-30 14:15:51 +08:00
唐明明
d5cba55ee9 merge 2022-08-30 11:31:44 +08:00
唐明明
1b28b58214 版本更新 2022-08-30 11:31:30 +08:00
5d72deb94f 处理merge 2022-08-30 08:38:06 +08:00
695587c1a2 同步最新数据 2022-08-30 08:36:37 +08:00
唐明明
d401416db2 暂时屏蔽个人中心我的拼单入口 2022-08-29 13:38:54 +08:00
唐明明
907a127a7d 删除冗余代码 2022-08-29 11:08:37 +08:00
唐明明
8c72ce32fd 删除 'pages/.DS_Store' 2022-08-29 11:03:12 +08:00
唐明明
067d601d32 删除 '.DS_Store' 2022-08-29 11:03:02 +08:00
唐明明
608fb452b3 优化店铺开通会员 2022-08-29 11:02:26 +08:00
1ed81d4edc merge 2022-08-24 16:50:27 +08:00
bb04fd3439 拼团模块新增完善对接接口等 2022-08-24 16:47:25 +08:00
唐明明
4b2f08c5bd merge 2022-08-18 10:23:49 +08:00
唐明明
6827224b45 删除 'static/.DS_Store' 2022-08-18 10:23:30 +08:00
唐明明
3a4b0a2f72 ... 2022-08-18 10:22:18 +08:00
aa5c4a2c61 切换环境 2022-08-18 10:21:33 +08:00
61f3dd8755 vip换购列表更改及部分拼团功能融合 2022-08-18 10:00:28 +08:00
96ae56192c 优化处理出具 2022-08-15 13:16:05 +08:00
056be42456 修复展示问题等问题 2022-08-12 14:49:06 +08:00
f2cb612887 「我的卡券加会员卡类型」 2022-08-12 09:47:56 +08:00
c0fc64054d vip列表原价展示 2022-08-11 17:22:58 +08:00
d6e3ebef1a merge 2022-08-11 16:27:13 +08:00
4b3d83007b 店铺会员制Vip功能增加 2022-08-11 15:48:33 +08:00
唐明明
e56aa382a9 调整商品详情 2022-08-05 16:54:42 +08:00
唐明明
2d93d2c1e2 调整排行榜,增加banner图链接,增加公告信息分享功能 2022-08-05 14:41:35 +08:00
唐明明
afa7361e2c 改造排行榜 2022-08-05 12:04:11 +08:00
唐明明
09c8217309 merge 2022-08-05 10:48:52 +08:00
7e8ed7115d 商品详情页面+可参与拼单列表 2022-08-04 16:26:59 +08:00
454ccb91c8 拼团列表接口 2022-08-04 13:52:46 +08:00
574994dafd 推荐换成邀请 2022-08-01 15:17:44 +08:00
5618d4e2d7 用户推荐帮 2022-08-01 13:12:06 +08:00
263c896ff9 去掉文版通相关 2022-08-01 11:49:53 +08:00
946e9e44ff 隐藏个人中心文版通 2022-08-01 11:09:40 +08:00
992e4639fc 会员推荐榜 2022-08-01 10:01:33 +08:00
66ebcc6e7a 规格处理== 2022-08-01 09:00:17 +08:00
b84af1859e 同步数据 2022-08-01 08:50:13 +08:00
唐明明
d95db14088 新增平台公告,新增平台人数统计,新增退货状态与商家联系电话 2022-07-26 15:16:17 +08:00
唐明明
a49995f20b 分享二维码 2022-07-19 23:52:12 +08:00
唐明明
1afb7b1f8e 调整客服二维码 2022-07-19 12:04:34 +08:00
唐明明
04376d0e8c 个人中心新增绑定关系 2022-07-19 11:57:20 +08:00
唐明明
ebcfea2855 merge 2022-07-19 10:13:41 +08:00
2416756a27 个人中心文版通账号可复制功能实现 2022-07-14 17:08:41 +08:00
6f2087abec 绑定文版通账号及处理设置支付密码展示位置 2022-07-14 16:38:47 +08:00
47aa866d86 意见反馈消息列表模式 2022-07-13 15:52:58 +08:00
b9e5946f91 tongbu 2022-07-13 11:31:37 +08:00
cb5da6ad12 多规格 2022-07-11 15:47:26 +08:00
e056efa485 tongbu 2022-07-11 15:46:59 +08:00
f03e2c78c4 ... 2022-07-08 17:29:23 +08:00
f164377cc1 处理多规格。 2022-07-08 16:25:47 +08:00
49cf009ec7 多规格增加 2022-07-08 16:16:13 +08:00
唐明明
8b5d275fa5 移出激励视频广告 2022-07-08 14:10:12 +08:00
唐明明
3c5926fbef 增加版本强制更新功能 2022-07-08 14:06:04 +08:00
d3185b6e26 ... 2022-07-08 10:42:27 +08:00
6bd30919e8 更改规格字段 2022-07-08 10:41:53 +08:00
唐明明
0dd0f0f37c merge 2022-07-07 17:19:03 +08:00
唐明明
b144de3c32 merge 2022-07-07 16:35:48 +08:00
151 changed files with 73547 additions and 38780 deletions

BIN
.DS_Store vendored Normal file

Binary file not shown.

1
.gitignore vendored
View File

@@ -1,3 +1,4 @@
/unpackage
/node_modules
/.hbuilderx
/unpackage/dist

View File

@@ -10,6 +10,10 @@
{
"launchtype" : "local"
},
"h5" :
{
"launchtype" : "remote"
},
"type" : "uniCloud"
}
]

161
App.vue
View File

@@ -1,70 +1,103 @@
<script>
import { getVersions } from './apis/interfaces/versions'
import {
getVersions
} from './apis/interfaces/versions'
export default {
onLaunch: function() {
//#ifdef APP-PLUS
// 获取系统版本号
getVersions({
platform: plus.os.name,
version : plus.runtime.version
}).then(res => {
if (res.update) {
uni.showModal({
title : "更新提示",
content : res.note || '版本更新信息',
confirmText : "更新",
showCancel : false,
success : modalRes => {
if (modalRes.confirm) {
if (plus.os.name == "Android") {
uni.showToast({
title: '新版本下载中,将在下载完成后自动为您安装更新包',
icon: 'none'
})
uni.downloadFile({
url: res.info.download,
success: apkPick => {
plus.runtime.install(apkPick
.tempFilePath, '',
installRES => {
// 安装完成用于提示新版本引导,暂时无用
}, installERR => {
// 安装失败
})
},
fail(err) {
uni.showToast({
title: '安装包下载失败,请检查您的网络或稍后重试',
icon: 'none'
})
}
})
// plus.runtime.openURL(res.info.download, err => {
// console.log(err)
// }, 'com.android.browser');
} else {
uni.showToast({
title: 'IOS应用暂未上架请打开测试(TestFlight)工具点击更新',
icon: 'none'
})
}
}
}
})
}
}).catch(err => {
uni.showToast({
title: err.message,
icon: 'none'
})
})
//#endif
}
}
export default {
onShow() {
// 已经登录过且携带了参数 有弹窗且
setTimeout(() => {
if (uni.getStorageSync('token')) {
if (plus.runtime.arguments.split('?')[1]) {
let shareId = plus.runtime.arguments.split('?')[1].split('invitation')[0]
if (shareId != '' && shareId != undefined) {
uni.showModal({
title: ' 温馨提示',
content: '有人邀请您一起拼团',
cancelColor: '#999',
cancelText: '再想想',
confirmColor: '#34ce98',
confirmText: '立即拼团',
success: (res) => {
uni.hideLoading()
if (res.confirm) {
plus.runtime.arguments = null;
plus.runtime.arguments = '';
uni.navigateTo({
url: '/pages/group-book/success/success?access=1&id=' +
shareId
})
}
}
})
}
}
}
}, 100);
},
onLaunch: function() {
//#ifdef APP-PLUS
// 获取系统版本号
getVersions({
platform: plus.os.name,
version: plus.runtime.version
}).then(res => {
if (res.update) {
uni.showModal({
title : "更新提示",
content : res.note || '版本更新信息',
confirmText : "更新",
showCancel : !res.info.must,
success: modalRes => {
if (modalRes.confirm) {
if (plus.os.name == "Android") {
uni.showToast({
title: '新版本下载中,将在下载完成后自动为您安装更新包',
icon: 'none'
})
uni.downloadFile({
url: res.info.download,
success: apkPick => {
plus.runtime.install(apkPick
.tempFilePath, '',
installRES => {
// 安装完成用于提示新版本引导,暂时无用
}, installERR => {
// 安装失败
})
},
fail(err) {
uni.showToast({
title: '安装包下载失败,请检查您的网络或稍后重试',
icon: 'none'
})
}
})
// plus.runtime.openURL(res.info.download, err => {
// console.log(err)
// }, 'com.android.browser');
} else {
uni.showToast({
title: 'IOS应用暂未上架请打开测试(TestFlight)工具点击更新',
icon: 'none'
})
}
}
}
})
}
}).catch(err => {
uni.showToast({
title: err.message,
icon: 'none'
})
})
//#endif
},
}
</script>
<style lang="scss">
@import "uview-ui/index.scss";
@import "@/static/iconfont.css";
@import "uview-ui/index.scss";
@import "@/static/iconfont.css";
</style>

View File

@@ -1,169 +1,168 @@
/**
* Web唐明明
* 匆匆数载恍如梦,岁月迢迢华发增
* 碌碌无为枉半生,一朝惊醒万事空。
*/
import store from '@/store'
import router from '../router'
// 基础配置
const config = {
// apiUrl : 'https://api.gongli.vip/api/', // 正式环境
apiUrl : 'http://api.gl.shangkelian.cn/api/', // 测试
timeout : 60000
}
let loginHintState = false
// 网络请求
const request = (parameter, hideLoding = true) => {
// 检查url配置
if(parameter.url === 'undefined' || parameter.url === ''){
uni.showToast({
title: '请求地址不能为空',
icon : 'none'
})
return
}
// 注入header
config.header = {
'Accept': 'application/json',
'Authorization': store.getters.getToken || uni.getStorageSync('token')
}
// 加载提示
if(!hideLoding) uni.showLoading({
title: '加载中',
mask : true
});
// 请求实例
return new Promise((resolve, reject) => {
uni.request({
url : config.apiUrl + parameter.url,
timeout : config.timeout,
header : config.header || {},
data : parameter.data || {},
method : parameter.method || 'GET',
success : res => {
if (res.header.Authorization){
updateToken('token', res.header.Authorization)
}
if(res.statusCode === 200){
uni.hideLoading()
const resolveData = res.data
if(resolveData.status_code === 200) {
resolve(resolveData.data)
return
}
if(resolveData.status_code === 401) {
loginHint()
return
}
reject(resolveData)
return
}
errToast(res.statusCode)
},
fail(err) {
uni.showToast({
title: '网络错误,请检查您设备网络状态',
icon : 'none'
})
}
})
})
}
// 文件上传
const uploading = (paths) => {
uni.showLoading({
title: '上传中',
mask : true
});
// 注入header
config.header = {
'Accept': 'application/json',
'Authorization': store.getters.getToken || ''
}
// 上传图片
return new Promise((resolve, reject) => {
uni.uploadFile({
url : config.apiUrl + 'storage/uploads',
files : paths,
header : config.header || {},
success : res=>{
if(res.statusCode === 200){
uni.hideLoading()
let updData = JSON.parse(res.data)
if(updData.status_code === 200){
resolve(updData.data)
return
}
reject(updData)
return
}
errToast(res.statusCode)
}
})
})
}
// 处理一些http请求错误提示
const errToast = (code) => {
switch (code){
case 404:
uni.showToast({
title: code + '接口不存在,请联系系统管理员',
icon : 'none'
})
break;
case 405:
uni.showToast({
title: code + '请检查接口请求方式错误',
icon : 'none'
})
break;
case 500:
uni.showToast({
title: code + '服务端错误,请检查服务器信息',
icon : 'none'
})
break;
}
}
// 更新token
const updateToken = (token) => {
store.commit('setToken', token)
// 清除退出登录标识
uni.removeStorageSync('isnew')
}
// 处理登录提示
const loginHint = () => {
if( loginHintState ) return
if(!loginHintState) loginHintState = true
updateToken('')
uni.showModal({
title: '登录提示',
content: '您的登录信息已过期,请重新登录',
confirmColor: '#8b64fd',
showCancel:false,
success: res=> {
loginHintState = false
if (res.confirm) {
uni.reLaunch({
url:'/pages/auth/auth'
})
}
}
})
}
export {
request,
uploading,
config
/**
* Web唐明明
* 匆匆数载恍如梦,岁月迢迢华发增。
* 碌碌无为枉半生,一朝惊醒万事空
*/
import store from '@/store'
import router from '../router'
// 基础配置
const config = {
apiUrl : 'https://api.gongli.vip/api/', // 正式环境
// apiUrl: 'http://api.gl.shangkelian.cn/api/', // 测试
timeout: 60000
}
let loginHintState = false
// 网络请求
const request = (parameter, hideLoding = true) => {
// 检查url配置
if (parameter.url === 'undefined' || parameter.url === '') {
uni.showToast({
title: '请求地址不能为空',
icon: 'none'
})
return
}
// 注入header
config.header = {
'Accept': 'application/json',
'Authorization': store.getters.getToken || uni.getStorageSync('token')
}
// 加载提示
if (!hideLoding) uni.showLoading({
title: '加载中',
mask: true
});
// 请求实例
return new Promise((resolve, reject) => {
uni.request({
url: config.apiUrl + parameter.url,
timeout: config.timeout,
header: config.header || {},
data: parameter.data || {},
method: parameter.method || 'GET',
success: res => {
if (res.header.Authorization) {
updateToken('token', res.header.Authorization)
}
if (res.statusCode === 200) {
uni.hideLoading()
const resolveData = res.data
if (resolveData.status_code === 200) {
resolve(resolveData.data)
return
}
if (resolveData.status_code === 401) {
loginHint()
return
}
reject(resolveData)
return
}
errToast(res.statusCode)
},
fail(err) {
uni.showToast({
title: '网络错误,请检查您设备网络状态',
icon: 'none'
})
}
})
})
}
// 文件上传
const uploading = (paths) => {
uni.showLoading({
title: '上传中',
mask: true
});
// 注入header
config.header = {
'Accept': 'application/json',
'Authorization': store.getters.getToken || ''
}
// 上传图片
return new Promise((resolve, reject) => {
uni.uploadFile({
url: config.apiUrl + 'storage/uploads',
files: paths,
header: config.header || {},
success: res => {
if (res.statusCode === 200) {
uni.hideLoading()
let updData = JSON.parse(res.data)
if (updData.status_code === 200) {
resolve(updData.data)
return
}
reject(updData)
return
}
errToast(res.statusCode)
}
})
})
}
// 处理一些http请求错误提示
const errToast = (code) => {
switch (code) {
case 404:
uni.showToast({
title: code + '接口不存在,请联系系统管理员',
icon: 'none'
})
break;
case 405:
uni.showToast({
title: code + '请检查接口请求方式错误',
icon: 'none'
})
break;
case 500:
uni.showToast({
title: code + '服务端错误,请检查服务器信息',
icon: 'none'
})
break;
}
}
// 更新token
const updateToken = (token) => {
store.commit('setToken', token)
// 清除退出登录标识
uni.removeStorageSync('isnew')
}
// 处理登录提示
const loginHint = () => {
if (loginHintState) return
if (!loginHintState) loginHintState = true
updateToken('')
uni.showModal({
title: '登录提示',
content: '您的登录信息已过期,请重新登录',
confirmColor: '#8b64fd',
showCancel: false,
success: res => {
loginHintState = false
if (res.confirm) {
uni.reLaunch({
url: '/pages/auth/auth'
})
}
}
})
}
export {
request,
uploading,
config
}

View File

@@ -95,6 +95,29 @@ const paymentpre = () => {
})
}
// 我的版通账户信息
const wbtInfo = () => {
return request({
url: 'wallet/wbt/info'
})
}
// 是否绑定了文版通账户
const wbtCheck = () => {
return request({
url: 'wallet/wbt/check'
})
}
// 绑定账户版通账户
const wbtBind = (data) => {
return request({
url: 'wallet/wbt/bind',
data:data,
method:'POST',
})
}
export {
dt,
recharge,
@@ -106,6 +129,9 @@ export {
getSms,
submitTransfer,
integral,
paymentpre
paymentpre,
wbtInfo,
wbtCheck,
wbtBind
}

View File

@@ -1,78 +1,90 @@
/**
* Web唐明明
* 匆匆数载恍如梦,岁月迢迢华发增
* 碌碌无为枉半生,一朝惊醒万事空。
* moduleName: 鉴权
*/
import { request } from '../index'
// 验证码登录
const smsAuth = (data) =>{
return request({
url: "user/auth/sms",
method: 'POST',
data: data
})
}
// 获取带有邀请码可填写的邀请码接口
const getInvitationSms = (data) =>{
return request({
url: "user/auth/new_verify",
method: 'POST',
data: data
})
}
// 获取验证码
const getSms = (data) =>{
return request({
url: "user/auth/verify",
method: 'POST',
data: data
})
}
// 获取角色标签信息
const userFigure = () => {
return request({
url: "cms/storages/tags?tags=figure",
})
}
// 创建角色
const createUser = (data) => {
return request({
url: "user/fill_all",
method: 'POST',
data: data
})
}
// 用户隐私,用户服务协议
const secretService = (name) =>{
return request({
url: "articles/agreement/"+name
})
}
// 一键登录
const keyAuth = (data) => {
return request({
url: 'user/socialite/login/unicloud/app',
method: 'POST',
data: data
}, true)
}
export {
smsAuth,
getInvitationSms,
getSms,
userFigure,
createUser,
secretService,
keyAuth
/**
* Web唐明明
* 匆匆数载恍如梦,岁月迢迢华发增。
* 碌碌无为枉半生,一朝惊醒万事空
* moduleName: 鉴权
*/
import {
request
} from '../index'
// 验证码登录
const smsAuth = (data) => {
return request({
url: "user/auth/sms",
method: 'POST',
data: data
})
}
// 获取图形验证码
const captcha = () => {
return request({
url: "user/auth/captcha",
method: 'POST',
data:{}
})
}
// 获取带有邀请码可填写的邀请码接口
const getInvitationSms = (data) => {
return request({
url: "user/auth/new_verify",
method: 'POST',
data: data
})
}
// 获取验证码
const getSms = (data) => {
return request({
url: "user/auth/verify",
method: 'POST',
data: data
})
}
// 获取角色标签信息
const userFigure = () => {
return request({
url: "cms/storages/tags?tags=figure",
})
}
// 创建角色
const createUser = (data) => {
return request({
url: "user/fill_all",
method: 'POST',
data: data
})
}
// 用户隐私,用户服务协议
const secretService = (name) => {
return request({
url: "articles/agreement/" + name
})
}
// 一键登录
const keyAuth = (data) => {
return request({
url: 'user/socialite/login/unicloud/app',
method: 'POST',
data: data
}, true)
}
export {
smsAuth,
getInvitationSms,
getSms,
userFigure,
createUser,
secretService,
keyAuth,
captcha
}

View File

@@ -34,3 +34,4 @@ export {
glz,
sign
}

View File

@@ -0,0 +1,49 @@
/**
* Web-zdx
* moduleName: 任务模块接口
*/
import {
request
} from '../index'
// 获取当前 token 用户的任务领取情况
const user = () => {
return request({
url: 'mall/shops/tasks/user',
})
}
// 意见反馈通知列表
const list = (data) => {
return request({
url: 'mall/shops/tasks',
data:data,
})
}
// 根据活动 id 获取视频的链接
const getVideoUrl = (id) => {
return request({
url: 'mall/shops/tasks/'+id+'/url',
})
}
// 完成任务
const execute = (id) => {
return request({
url: 'mall/shops/tasks/'+id+'/execute',
method:'POST',
})
}
export {
user,
list,
getVideoUrl,
execute,
}

40
apis/interfaces/news.js Normal file
View File

@@ -0,0 +1,40 @@
/**
* Web-zdx
* moduleName: 消息中心
*/
import {
request
} from '../index'
// 意见反馈通知列表
const list = (type,data) => {
return request({
url: 'notifications/'+type+'/list',
data:data,
})
}
// 意见反馈 详情
const detail = (notification_id) => {
return request({
url: 'notifications/'+notification_id,
})
}
// 全部已读
const readAll = (type) => {
return request({
url: 'notifications/'+type,
method:'PUT',
})
}
export {
list,
detail,
readAll,
}

27
apis/interfaces/notice.js Normal file
View File

@@ -0,0 +1,27 @@
/**
* Web唐明明
* 匆匆数载恍如梦,岁月迢迢华发增。
* 碌碌无为枉半生,一朝惊醒万事空。
* moduleName: 通知公告
*/
import { request } from '../index'
// 列表
const list = () =>{
return request({
url: "cms/articles/notice"
})
}
// 详情
const info = (id) =>{
return request({
url: "cms/articles/" + id
})
}
export {
list,
info
}

View File

@@ -44,9 +44,46 @@ const dtPAY = (orderNo,password) => {
}
const collagePAY = (orderNo,password) => {
return request({
url: 'mall/pay/' + orderNo + '/collage/account',
method:'post',
data: {
type: 'app',
transfer_password:password
}
})
}
// 河马支付
const hmPay = (orderID) => {
return request({
url : 'user/transaction/recharge/payment/hema',
data : {
order_id: orderID
},
method : 'POST'
})
}
// 河马付支付结果查询
const hmState = (type, id) => {
return request({
url : 'hema/affirm',
method : 'POST',
data : {
type,
id
}
})
}
export {
wxPAY,
alPAY,
dtPAY,
payIndex,
collagePAY,
hmPay,
hmState
}

40
apis/interfaces/pin.js Normal file
View File

@@ -0,0 +1,40 @@
/**
* Web-zdx
* moduleName: 拼团相关接口
*/
import {
request
} from '../index'
// 拼团列表
const pinList = (data) => {
return request({
url: 'mall/goods/collages',
data:data
})
}
// 我的拼团列表
const myPinList = (data) => {
return request({
url: 'mall/collages',
data:data
})
}
// 根据拼团 id 获取拼团详情
const myPinDetail = (id) => {
return request({
url: 'mall/collages/'+id,
})
}
export {
pinList,
myPinList,
myPinDetail
}

View File

@@ -24,8 +24,40 @@ const week = () => {
})
}
// 会员推荐帮
const total = () => {
return request({
url: 'user/rank/total'
})
}
// 用户推荐榜
const totaluser = () => {
return request({
url: 'user/rank/totaluser'
})
}
// 月度推荐会员排行榜
const monthVip = () => {
return request({
url: 'user/rank/month_vip'
})
}
// 月度推荐用户排行榜
const monthUser = () => {
return request({
url: 'user/rank/month_user'
})
}
export {
week_mul,
week,
total,
totaluser,
monthVip,
monthUser
}

View File

@@ -40,14 +40,10 @@ const shopsDetail = (shopId) => {
}
// 店铺商品
const shopsGoods = (shopId, categoryId,page) => {
const shopsGoods = (data) => {
return request({
url: 'mall/goods',
data: {
shop_id:shopId,
category_id:categoryId,
page:page,
}
data: data
})
}
@@ -66,6 +62,21 @@ const buy = data => {
data
})
}
// 拼团商品确认页面
const buyPin = data => {
return request({
url: 'mall/buy/collages',
data
})
}
// 拼团商品确认下单
const collages = data => {
return request({
url: 'mall/buy/collages',
method: 'POST',
data
})
}
// 商品下单
const verify = data => {
@@ -83,6 +94,21 @@ const classify = id => {
})
}
// 拼团成功后展示页面
const repages = id => {
return request({
url: 'mall/collages/' + id + '/repages'
})
}
// 商城所有分类
const categories = id => {
return request({
url: 'mall/categories/lists'
})
}
export {
mall,
goods,
@@ -91,6 +117,10 @@ export {
shopsGoods,
lists,
buy,
buyPin,
verify,
classify
collages,
repages,
classify,
categories
}

View File

@@ -30,8 +30,42 @@ const invitationCode = () => {
})
}
// 绑定分享关系
const relationsBind = (invite) => {
return request({
url: 'user/relations/bind',
data: {
invite
},
method: 'POST'
})
}
// 确认绑定关系
const relationsVerify = (invite) => {
return request({
url: 'user/relations/verify',
data: {
invite
}
})
}
// 我的卡券
const myCard = (data) => {
data.receive = 'desc'
return request({
url: 'mall/shops/users',
data:data
})
}
export {
info,
chainSeed,
invitationCode
invitationCode,
relationsBind,
relationsVerify,
myCard
}

View File

@@ -22,7 +22,7 @@ const vipPay = () => {
})
}
// 获取支付信息
// 获取支付信息
const payInfo = (orderId) => {
return request({
url: 'user/identities/pay/' + orderId + '/wechat'
@@ -36,11 +36,43 @@ const agreement = (id) => {
})
}
// 店铺会员
const shopVipInfo = (id) => {
return request({
url: 'mall/shops/'+id+'/identities'
})
}
//开通店铺会员
const shopVipCreate = (id,identity) => {
return request({
url: 'mall/shops/'+id+'/identities/'+identity,
method:'POST'
})
}
// 开通店铺会员微信支付
const shopVipWeChat = (id) => {
return request({
url: 'mall/shops/identities/wechat/'+id,
method:'POST'
})
}
// 河马付
const vipHmPay = (orderId) => {
return request({
url: 'user/identities/pay/' + orderId + '/hema'
})
}
export {
vip,
vipPay,
payInfo,
agreement,
shopVipInfo,
shopVipCreate,
shopVipWeChat,
vipHmPay
}

View File

@@ -0,0 +1,146 @@
<template>
<view class="goods-item">
<image src="/static/background/supplier_back.png" mode="aspectFill" class="goods-cover" />
<view class="goods-info">
<view class="_title">京东直营电脑类商品 mac 笔记本 鼠标键盘</view>
<view class="_des">店铺名称 </view>
<view class="_pin">
<view class="_has" > <image src="/static/book/fire.png" mode="widthFix" class="fire" /> 已免费领取 12 </view>
<!-- <view class="tuan">11人参与活动</view> -->
</view>
<view class="price">
<view class="money">110 <span>DT积分</span> </view>
<view class="now-pin" @click="goPin('11')">查看详情</view>
</view>
<view class="pin"> 奖励 </view>
</view>
</view>
</template>
<script>
export default {
data() {
return {};
},
props: {
item: {
type: Object,
default: {},
}
},
methods: {
goPin(id) {
this.$emit('goPin',id)
}
},
};
</script>
<style lang="scss" scoped>
.goods-item {
display: flex;
flex-direction: row;
align-items: center;
justify-content: flex-start;
box-sizing: border-box;
background-color: white;
border-radius: 10rpx;
padding: $padding;
margin-bottom: 20rpx;
position: relative;
.pin{
position: absolute;
background-color: #e74a45;
border-radius:0 0 30rpx 0 ;
padding: 2rpx 30rpx 2rpx 30rpx;
color: #fff;
left: 0;
top: 0;
font-size: 28rpx;
font-weight: bold;
}
.goods-cover {
width: 160rpx;
height: 160rpx;
border-radius: 10rpx;
}
.goods-info {
width: calc(100% - 160rpx - 30rpx);
padding-left: $padding;
._title {
overflow: hidden;
font-size: 30rpx;
font-weight: 600;
white-space: nowrap;
text-overflow: ellipsis;
}
._des {
font-size: 28rpx;
padding: 6rpx 0;
color: #4f300a;
}
._pin {
font-size: 26rpx;
display: flex;
flex-direction: row;
align-items: center;
justify-content: flex-start;
box-sizing: border-box;
color: $text-gray;
._has {
display: flex;
flex-direction: row;
align-items: center;
justify-content: flex-start;
box-sizing: border-box;
color: #e74a45;
background-color: rgba($color: $text-price, $alpha: 0.1);
padding: 4rpx 10rpx;
border-radius: 30rpx;
margin-right: $margin;
image {
width: 24rpx;
height: 24rpx;
margin-right: 10rpx;
}
}
}
.price {
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
box-sizing: border-box;
padding-top: 20rpx;
.money {
font-size: 34rpx;
font-weight: 600;
color: #e74a45;
span{
font-size: 24rpx;
margin-left: 10rpx;
font-weight: normal;
}
}
.now-pin {
border: solid #cacaca 1rpx;
font-size: 26rpx;
font-weight: bold;
padding: 6rpx 20rpx;
border-radius: 20rpx;
color: #999;
}
}
}
}
</style>

View File

@@ -0,0 +1,327 @@
<template>
<view>
<view class="order--content" :class="[pattern ? 'chunk': 'broad']">
<view class="order--group--header" @click="$emit('onBtn', {type: 'shopsDetail', order: orderInfo})">
<image class="logo" v-if="orderInfo.shop.cover != ''" :src="orderInfo.shop.cover" mode="aspectFill">
</image>
<view class="store">
{{orderInfo.shop.name}}
<uni-icons type="right" size="16" color="#666" />
</view>
<view class="stateText" :style="{color: stateColor}">
{{orderInfo.collage.status_text}}
</view>
</view>
<view class="order--header">
<view class="order--no">
订单号{{orderInfo.no}}
</view>
</view>
<view class="order--flex" @click="$emit('onBtn', {type: 'goodsDetail', order: orderInfo})">
<image class="order--cover" :src="orderInfo.cover" mode="aspectFill"></image>
<view class="order--title">
{{orderInfo.name}}
<view class="unit"> {{orderInfo.unit}} </view>
</view>
<view class="order--count">
<view class="order--price">{{orderInfo.price}}<text>DT积分</text></view>
<view class="order--sum">{{orderInfo.sum}} </view>
</view>
</view>
<slot name="btns">
<view class="flexrow">
<view class="">
<u-avatar-group :random-bg-color="true" :urls="orderInfo.users" size="26" gap="0.4"
class="avatar-group" />
</view>
<view class="order--btns">
<view v-if="orderInfo.collage.status =='3'" class="item item--sign"
@click="$emit('onBtn', {type: 'share', order: orderInfo})">
分享拼团
</view>
<view class="item item--cancel" @click="$emit('onBtn', {type: 'goInfo', order: orderInfo})">
查看详情
</view>
</view>
</view>
</slot>
</view>
</view>
</template>
<script>
export default {
props: {
// 订单样式否为块
pattern: {
type: Boolean,
default: true
},
// 店铺模式
stores: {
type: Boolean,
default: false
},
// 订单信息
orderInfo: {
type: Object,
default: () => {
return {
cover: "",
name: "",
price: "",
sum: 1,
collage: {},
users: [],
invite: '',
order: {},
}
}
},
// 状态标签颜色
stateColor: {
type: String,
default: "#FF6160"
},
// 可操作按钮组
orderBtns: {
type: Array,
default: () => {
return [{
text: "订单详情",
type: "info"
}, {
text: "删除订单",
type: "delete",
style: {
color: "#FF6160"
}
}]
}
}
}
}
</script>
<style scoped lang="scss">
$margin: 30rpx;
$radius: 10rpx;
.text-nowrap {
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
.text-ellipsis {
display: -webkit-box;
overflow: hidden;
text-overflow: ellipsis;
-webkit-box-orient: vertical;
-webkit-line-clamp: 2;
}
.order--content {
background: white;
&.chunk {
margin: $margin $margin;
border-radius: $radius;
padding: $margin;
}
&.broad {
padding: $margin;
border-bottom: solid 1rpx #ddd;
}
.order--header {
display: flex;
justify-content: space-between;
padding-bottom: $margin;
border-top: solid 1rpx #f9f9f9;
align-items: center;
&>.order--no {
flex: 1;
margin-right: $margin;
font-size: 26rpx;
line-height: 40rpx;
color: #555;
@extend .text-nowrap;
padding-top: 10rpx;
}
&>.stateText {
font-size: 26rpx;
color: $text-price;
}
}
.order--flex {
display: flex;
align-items: center;
.order--cover {
vertical-align: top;
width: 128rpx;
height: 128rpx;
}
.order--title {
@extend .text-ellipsis;
text-align: left;
flex: 1;
padding-left: $margin;
font-size: 28rpx;
line-height: 40rpx;
display: flex;
flex-direction: column;
align-items: flex-start;
justify-content: center;
box-sizing: border-box;
.unit {
color: #999;
font-size: 26rpx;
padding-top: 10rpx;
}
}
.order--count {
text-align: right;
padding-left: $margin;
line-height: 40rpx;
// color: $text-price;
.order--price {
font-size: 30rpx;
font-weight: bold;
&>text {
font-size: 24rpx;
font-weight: normal;
padding-left: 10rpx;
}
}
.order--sum {
font-size: 26rpx;
color: #777;
}
}
}
.order--group {
.order--group--header {
padding-bottom: $margin;
display: flex;
justify-content: space-between;
align-items: center;
&>.logo {
width: 38rpx;
height: 38rpx;
vertical-align: middle;
margin-right: $margin/2;
}
&>.store {
@extend .text-nowrap;
flex: 1;
margin-right: $margin;
font-size: 28rpx;
line-height: 40rpx;
color: #555;
}
&>.stateText {
font-size: 26rpx;
}
}
.order--group--flex {
@extend .order--flex;
margin-bottom: $margin - 10;
&:last-child {
margin: 0;
}
}
}
.order--group--header {
padding-bottom: $margin;
display: flex;
justify-content: space-between;
align-items: center;
&>.logo {
width: 38rpx;
height: 38rpx;
vertical-align: middle;
margin-right: $margin/2;
}
&>.store {
@extend .text-nowrap;
flex: 1;
margin-right: $margin;
font-size: 28rpx;
line-height: 40rpx;
color: #555;
}
&>.stateText {
font-size: 26rpx;
}
}
.order--group--flex {
@extend .order--flex;
margin-bottom: $margin - 10;
&:last-child {
margin: 0;
}
}
.flexrow {
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
box-sizing: border-box;
padding-top: $margin - 10;
border-top: solid 1rpx #f9f9f9;
margin-top: $margin - 10;
}
.order--btns {
display: flex;
justify-content: flex-end;
// padding-top: $margin - 10;
&>.item {
font-size: 26rpx;
margin-left: $margin/2;
color: #333;
line-height: 56rpx;
border: solid 1rpx #ddd;
padding: 0 ($margin - 10);
border-radius: 28rpx;
&--cancel,
&--delete,
&--logistic {
color: #666;
}
&--pay,
&--sign {
color: #34CE98;
border-color: #34CE98;
}
}
}
}
</style>

View File

@@ -0,0 +1,148 @@
<template>
<view class="goods-item">
<image :src="item.cover" mode="aspectFill" class="goods-cover" />
<view class="goods-info">
<view class="_title">{{item.name}}</view>
<view class="_des">{{item.shop.name}} </view>
<view class="_pin">
<view class="_has" v-if="item.sales>0"> <image src="/static/book/fire.png" mode="widthFix" class="fire" /> 已拼 {{item.sales}} </view>
<view class="tuan">{{item.active.number}}人团</view>
</view>
<view class="price">
<view class="money">{{item.active.price}} <span>DT积分</span> </view>
<view class="now-pin" @click="goPin(item.goods_id)">马上拼团</view>
</view>
<view class="pin">
</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {};
},
props: {
item: {
type: Object,
default: {},
}
},
methods: {
goPin(id) {
this.$emit('goPin',id)
}
},
};
</script>
<style lang="scss" scoped>
.goods-item {
display: flex;
flex-direction: row;
align-items: center;
justify-content: flex-start;
box-sizing: border-box;
background-color: white;
border-radius: 10rpx;
padding: $padding;
margin-bottom: 20rpx;
position: relative;
.pin{
position: absolute;
background-color: #22aa98;
border-radius:0 0 30rpx 0;
padding: 2rpx 30rpx 2rpx 30rpx;
color: #fff;
left: 0;
top: 0;
font-size: 28rpx;
font-weight: bold;
}
.goods-cover {
width: 160rpx;
height: 160rpx;
border-radius: 10rpx;
}
.goods-info {
width: calc(100% - 160rpx - 30rpx);
padding-left: $padding;
._title {
overflow: hidden;
font-size: 30rpx;
font-weight: 600;
white-space: nowrap;
text-overflow: ellipsis;
}
._des {
font-size: 28rpx;
padding: 6rpx 0;
color: #4f300a;
}
._pin {
font-size: 26rpx;
display: flex;
flex-direction: row;
align-items: center;
justify-content: flex-start;
box-sizing: border-box;
color: $text-gray;
._has {
display: flex;
flex-direction: row;
align-items: center;
justify-content: flex-start;
box-sizing: border-box;
color: #d81e06;
background-color: rgba($color: $text-price, $alpha: 0.1);
padding: 4rpx 10rpx;
border-radius: 30rpx;
margin-right: $margin;
image {
width: 24rpx;
height: 24rpx;
margin-right: 10rpx;
}
}
}
.price {
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
box-sizing: border-box;
padding-top: 20rpx;
.money {
font-size: 34rpx;
font-weight: 600;
color: #d81e06;
span{
font-size: 24rpx;
margin-left: 10rpx;
font-weight: normal;
}
}
.now-pin {
background-color: $main-color;
font-size: 28rpx;
font-weight: bold;
padding: 6rpx 20rpx;
border-radius: 20rpx;
color: #fff;
}
}
}
}
</style>

View File

@@ -1,75 +0,0 @@
# 使用方法
```
<x-pay-pwd
ref="xPayPwd"
:type="1"
:maskClick="true"
top="unset"
bottom="0rpx"
:showClose="false"
@change="change"
:showHead="true"
headText="请输入支付密码"
>
<template #center>
<button @click="clear">插槽</button>
</template>
</x-pay-pwd>
```
```
export default {
methods: {
// 监听输入框内容变化
change({password}){
console.log(password)
},
// 清空输入框内容,一般用于密码输错手动清空
clear(){
this.$refs.xPayPwd._clearKey();
}
}
}
```
# 属性
| 字段 | 类型 | 默认 | 描述 |
| --------- | ------- | -------------- | ---------------------------------------- |
| type | Number | 1 | 0原生键盘 1自定义键盘 |
| maskClick | Boolean | true | 是否允许点击蒙版 |
| top | String | 20vh | 中间内容的top值为absolute的top值 |
| bottom | String | 0rpx | 中间内容的bottom值为absolute的bottom值 |
| showClose | Boolean | true | 是否显示关闭按钮 |
| showHead | Boolean | true | 是否显示标题 |
| headText | String | 请输入支付密码 | 标题文本 |
# 事件
| 事件名 | 默认参数 | 描述 |
| ------ | ---------- | -------------------------------- |
| change | {password} | 监听内容输入,参数返回输入的内容 |
# 组件方法
| 方法名 | 描述 |
| ------ | -------------------------------- |
| _open | 打开弹窗 |
| _close | 关闭弹窗 |
| _clearnKey | 请空输入内容 |
# 注意
```
ios下输入框不会自动获取焦点需要手动点击输入区域
```
# 参与贡献
+ xueshuai(xueshuai_12@163.com)
+ Emailxueshuai_12@163.com
+ GitHubGitHub地址
+ QQ交流群1063233592
+ 个人博客:(薛小帅)[http://blog.xueshuai.top]
+ 个人公众号叮当Ding
![叮当Ding](https://img-blog.csdnimg.cn/20210202143040150.png)

View File

@@ -0,0 +1,184 @@
<template>
<view class="goods-item">
<view class="bg"> {{item.shop_vip.message}} </view>
<image :src="item.cover" mode="aspectFill" class="goods-cover" />
<view class="tags"> VIP </view>
<view class="goods-info">
<view class="_title">{{item.name}}</view>
<view class="_des"> {{item.shop.name}} </view>
<view class="_pin" v-if="item.sales>0">
<view class="_has">
<image src="/static/book/fire.png" mode="widthFix" class="fire" /> 已换购 {{item.sales}}
</view>
</view>
<view class="price">
<view class="money">
{{item.price.price_min}} <span>DT积分</span>
<span class='del'>{{item.original_price}} DT积分</span>
</view>
<view class="now-pin" @click="goPin(item.goods_id)">立即领取</view>
</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {};
},
props: {
item: {
type: Object,
default: {},
}
},
methods: {
goPin(id) {
this.$emit('goPin', id)
}
},
};
</script>
<style lang="scss" scoped>
.goods-item {
display: flex;
flex-direction: row;
align-items: center;
justify-content: flex-start;
box-sizing: border-box;
background-color: white;
border-radius: 10rpx;
padding: $padding;
margin-bottom: 20rpx;
position: relative;
z-index: 0;
overflow: hidden;
.bg {
position: absolute;
top: -40rpx;
right: -10rpx;
opacity: 0.05;
font-size: 130rpx;
color: #999;
z-index: 1;
font-weight: bold;
}
.tags {
position: absolute;
top: 6rpx;
left: -54rpx;
background: #d81e06;
color: #fff;
width: 150rpx;
font-size: 24rpx;
padding: 4rpx 0;
text-align: center;
transform: rotate(-45deg);
font-weight: bold;
letter-spacing: 2rpx;
}
.goods-cover {
width: 160rpx;
height: 160rpx;
border-radius: 10rpx;
}
.goods-info {
width: calc(100% - 160rpx - 30rpx);
padding-left: $padding;
._title {
overflow: hidden;
font-size: 30rpx;
font-weight: 600;
white-space: nowrap;
text-overflow: ellipsis;
}
._des {
font-size: 26rpx;
padding: 10rpx 0;
margin-bottom: 4rpx;
color: #4f300a;
display: flex;
flex-direction: row;
align-items: center;
justify-content: flex-start;
box-sizing: border-box;
}
._pin {
font-size: 26rpx;
display: flex;
flex-direction: row;
align-items: center;
justify-content: flex-start;
box-sizing: border-box;
color: $text-gray;
._has {
display: flex;
flex-direction: row;
align-items: center;
justify-content: flex-start;
box-sizing: border-box;
color: #d81e06;
background-color: rgba($color: $text-price, $alpha: 0.1);
padding: 4rpx 10rpx;
border-radius: 30rpx;
image {
width: 24rpx;
height: 24rpx;
margin-right: 10rpx;
}
}
.tuan {
margin-left: $margin;
}
}
.price {
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
box-sizing: border-box;
padding-top: 20rpx;
.money {
font-size: 34rpx;
font-weight: 600;
color: #d81e06;
span {
font-size: 24rpx;
margin-left: 10rpx;
font-weight: normal;
}
.del {
text-decoration: line-through;
margin-left: 10rpx;
font-size: 24rpx;
color: #999;
font-weight: normal;
}
}
.now-pin {
background-color: #d81e06;
font-size: 28rpx;
font-weight: bold;
padding: 6rpx 20rpx;
border-radius: 20rpx;
color: #fff;
}
}
}
}
</style>

View File

@@ -2,7 +2,7 @@
"name" : "共力生态",
"appid" : "__UNI__DE7B0E6",
"description" : "共力生态",
"versionName" : "1.0.35",
"versionName" : "1.0.51",
"versionCode" : 100,
"transformPx" : false,
/* 5+App */
@@ -47,6 +47,9 @@
"<uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\"/>",
"<uses-permission android:name=\"android.permission.ACCESS_WIFI_STATE\"/>",
"<uses-permission android:name=\"android.permission.CAMERA\"/>",
"<uses-permission android:name=\"android.permission.CALL_PHONE\"/>",
"<uses-permission android:name=\"android.permission.READ_CONTACTS\"/>",
"<uses-permission android:name=\"android.permission.WRITE_CONTACTS\"/>",
"<uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\"/>",
"<uses-permission android:name=\"android.permission.CHANGE_WIFI_STATE\"/>",
"<uses-permission android:name=\"android.permission.FLASHLIGHT\"/>",
@@ -64,7 +67,8 @@
"<uses-permission android:name=\"android.permission.WRITE_EXTERNAL_STORAGE\"/>",
"<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>"
],
"autoSdkPermissions" : true
"autoSdkPermissions" : true,
"schemes" : "glst,gonglishengtai,gldao"
},
/* ios */
"ios" : {
@@ -74,7 +78,8 @@
"NSPhotoLibraryUsageDescription" : "发送图文消息",
"NSPhotoLibraryAddUsageDescription" : "保存图片消息",
"NSLocationWhenInUseUsageDescription" : "发送当前位置信息"
}
},
"dSYMs" : false
},
/* SDK */
"sdkConfigs" : {
@@ -84,7 +89,7 @@
"payment" : {
"weixin" : {
"__platform__" : [ "android" ],
"appid" : "wx466a4663da346e09",
"appid" : "wx10517aabd260b79e",
"UniversalLinks" : ""
},
"alipay" : {
@@ -93,13 +98,11 @@
},
"share" : {
"weixin" : {
"appid" : "wx466a4663da346e09",
"appid" : "wx10517aabd260b79e",
"UniversalLinks" : ""
}
},
"ad" : {
"sigmob" : {}
},
"ad" : {},
"push" : {},
"geolocation" : {
"system" : {
@@ -149,7 +152,25 @@
"androidStyle" : "common"
}
},
"nativePlugins" : {}
"nativePlugins" : {
"TestModule" : {
"__plugin_info__" : {
"name" : "河马支付",
"description" : "河马支付",
"platforms" : "Android",
"url" : "",
"android_package_name" : "",
"ios_bundle_id" : "",
"isCloud" : false,
"bought" : -1,
"pid" : "",
"parameters" : {}
}
}
},
"uniStatistics" : {
"enable" : true
}
},
/* */
"quickapp" : {},
@@ -159,19 +180,53 @@
"setting" : {
"urlCheck" : false
},
"usingComponents" : true
"usingComponents" : true,
"uniStatistics" : {
"enable" : true
}
},
"mp-alipay" : {
"usingComponents" : true
"usingComponents" : true,
"uniStatistics" : {
"enable" : true
}
},
"mp-baidu" : {
"usingComponents" : true
"usingComponents" : true,
"uniStatistics" : {
"enable" : true
}
},
"mp-toutiao" : {
"usingComponents" : true
"usingComponents" : true,
"uniStatistics" : {
"enable" : true
}
},
"uniStatistics" : {
"enable" : false
"enable" : true
},
"vueVersion" : "2"
"vueVersion" : "2",
"h5" : {
"uniStatistics" : {
"enable" : true
}
},
"mp-kuaishou" : {
"uniStatistics" : {
"enable" : true
}
},
"mp-lark" : {
"uniStatistics" : {
"enable" : true
}
},
"mp-qq" : {
"uniStatistics" : {
"enable" : true
}
},
"fallbackLocale" : "zh-Hans",
"locale" : "auto"
}

View File

@@ -0,0 +1,20 @@
{
"name": "河马支付",
"id": "TestModule",
"version": "1.0.0",
"description": "河马支付",
"_dp_type":"nativeplugin",
"_dp_nativeplugin":{
"android": {
"plugins": [
{
"type": "module",
"name": "TestModule",
"class": "io.dcloud.uniplugin.AppModule"
}
],
"integrateType": "aar"
}
}
}

View File

@@ -3,7 +3,7 @@ const version = '2.0.31'
// 开发环境才提示,生产环境不会提示
if (process.env.NODE_ENV === 'development') {
console.log(`\n %c uView V${version} %c https://www.uviewui.com/ \n\n`, 'color: #ffffff; background: #3c9cff; padding:5px 0;', 'color: #3c9cff;background: #ffffff; padding:5px 0;');
// console.log(`\n %c uView V${version} %c https://www.uviewui.com/ \n\n`, 'color: #ffffff; background: #3c9cff; padding:5px 0;', 'color: #3c9cff;background: #ffffff; padding:5px 0;');
}
export default {

1164
pages.json

File diff suppressed because it is too large Load Diff

View File

@@ -13,17 +13,17 @@
DT积分冻结
<image src="/static/rank/help.png" style="width: 30rpx;" mode="widthFix" />
</view>
<view class="num">{{frozenScore}}</view>
<view class="num">{{frozenScore || '0.0000'}}</view>
</view>
<button class="transfer" size="mini" @click="onTransfer('AccountRecharge')">充值</button>
<button class="transfer" size="mini" @click="dtSelect">充值</button>
<button class="transfer" size="mini" @click="onTransfer('AccountTransfer')">转账</button>
</view>
<block v-if="logs.length > 0">
<view class="logs-title">账户记录</view>
<view class="logs-item" v-for="(item,index) in logs" :key="index" @click="frozenInfo(item.description)">
<view class="logs-item-title">
{{item.remark}}
<image v-if ="item.description!== ''" src="/static/rank/help3.png" mode="widthFix" />
<view class="logs-item-title">
{{item.remark}}
<image v-if="item.description!== ''" src="/static/rank/help3.png" mode="widthFix" />
</view>
<view class="logs-item-time">{{item.created_at}}</view>
<view class="logs-item-price" :class="item.amount > 0 ? 'add': 'remove'">
@@ -38,12 +38,25 @@
</u-empty>
</view>
</block>
<u-popup :show="dtShow" mode="bottom" @close="dtShow = false " :round="10">
<view class="dt-type">
<!-- <view class="dt-item" @click="dtSelect('wbt')">
<image src="/static/icon/pay_wbt.png" mode="widthFix" />
文版通充值
</view> -->
<view class="dt-item" @click="dtSelect('wchat')">
<image src="/static/icon/pay_wechat.png" mode="widthFix" />
微信充值
</view>
</view>
</u-popup>
</view>
</template>
<script>
import {
dt
dt,wbtCheck
} from '@/apis/interfaces/account.js'
export default {
data() {
@@ -52,8 +65,9 @@
frozenScore: '0.00',
logs: [],
page: 1,
has_more: true,
description:'',
has_more: true,
description: '',
dtShow: false, // 是否显示重置弹窗
};
},
onShow() {
@@ -69,7 +83,39 @@
this.page = 1;
this.getDt();
},
methods: {
methods: {
dtSelect(type){
this.onTransfer('AccountRecharge');
return
// 充值选项
switch(type){
case 'wchat':
this.onTransfer('AccountRecharge');
this.dtShow = false;
break;
case 'wbt':
wbtCheck().then(res=>{
if(res){
uni.showToast({
title:' 跳转文版通APP, 努力开发中~',
icon:"none",
mask:true,
duration:3000
})
}else{
this.$Router.push({name:'WbtBind'})
}
this.dtShow = false;
}).catch(err=>{
uni.showToast({
title:err.message,
icon:"none",
mask:true
})
})
break;
}
},
getDt() {
dt({
page: this.page
@@ -79,7 +125,7 @@
}
this.score = res.score;
this.frozenScore = res.frozenScore;
this.logs = this.logs.concat(res.lists.data);
this.logs = this.logs.concat(res.lists.data);
this.description = res.description;
this.has_more = res.lists.page.has_more;
uni.stopPullDownRefresh();
@@ -95,19 +141,19 @@
this.$Router.push({
name
})
},
frozenInfo(description){
if(description!== ''){
uni.showModal({
title:'温馨提示',
content:description,
showCancel:false,
confirmColor:"#34ce98",
confirmText:' 知道了'
})
}
},
},
frozenInfo(description) {
if (description !== '') {
uni.showModal({
title: '温馨提示',
content: description,
showCancel: false,
confirmColor: "#34ce98",
confirmText: ' 知道了'
})
}
},
},
onNavigationBarButtonTap() {
this.$Router.push({
@@ -188,9 +234,10 @@
flex-direction: row;
align-items: center;
justify-content: flex-start;
box-sizing: border-box;
image{
padding-left: 4rpx;
box-sizing: border-box;
image {
padding-left: 4rpx;
}
}
@@ -203,14 +250,14 @@
}
.transfer[size="mini"] {
width: 160rpx;
height: 70rpx;
width: 150rpx;
height: 66rpx;
border-radius: 40rpx;
line-height: 70rpx;
line-height: 66rpx;
background: white;
font-size: 30rpx;
color: $main-color;
margin: 0;
margin: 4rpx;
font-weight: bold;
&::after {
@@ -240,15 +287,16 @@
.logs-item-title {
font-weight: bold;
font-size: 30rpx;
line-height: 50rpx;
display: flex;
flex-direction: row;
align-items: center;
justify-content: flex-start;
box-sizing: border-box;
image{
width: 30rpx;
padding-left: 4rpx;
line-height: 50rpx;
display: flex;
flex-direction: row;
align-items: center;
justify-content: flex-start;
box-sizing: border-box;
image {
width: 30rpx;
padding-left: 4rpx;
}
}
@@ -288,4 +336,27 @@
}
}
}
.dt-type {
display: flex;
flex-direction: row;
align-items: center;
justify-content: center;
box-sizing: border-box;
padding: $padding *2 $padding;
.dt-item{
flex: 1;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
box-sizing: border-box;
font-size: 28rpx;
color:grey;
image{
width: 80rpx;
margin-bottom: $margin;
}
}
}
</style>

145
pages/account/hmState.vue Normal file
View File

@@ -0,0 +1,145 @@
<template>
<view>
<view class="vertical results">
<block v-if="loding">
<u-loading-icon mode="circle" size="58" color="#34CE98"></u-loading-icon>
<view class="circle-toast">
<view class="sub-title">已等待{{time}}</view>
<view class="sub-title">查询支付结果中请耐心等待...</view>
</view>
</block>
<block v-else>
<view v-if="success">
<uni-icons type="checkbox-filled" size="88" color="#34CE98"></uni-icons>
<view class="title">支付成功</view>
<view class="sub-title">{{remove}}</view>
<button class="results-button" type="default" size="default" @click="navBack">返回</button>
</view>
<view v-else>
<uni-icons type="info-circle-fill" size="88" color="#34CE98"></uni-icons>
<view class="title">{{code === 0 ? '查询失败' : '订单不存在'}}</view>
<view class="sub-title">{{code === 0 ? '暂未查询到您的支付信息,如支付成功未到账请联系管理员': '暂未查询到您的订单信息'}}</view>
<button class="results-button" type="default" size="default" @click="navBack">返回</button>
</view>
</block>
</view>
</view>
</template>
<script>
import { hmState } from '@/apis/interfaces/pay.js'
var outTime;
export default {
data() {
return {
type : 'recharge',
hash : '',
time : 0,
loding : false,
success : false,
code : 0,
remove : '充值成功预计10秒内到账可在账户交易记录中查询以实际到账时间为准如充值失败金额将原路退还'
};
},
created() {
this.type = this.$Route.query.type
if(this.type === 'vip') this.remove = '恭喜您成功开通共力生态会员'
if(this.type === 'buy') this.remove = '订单支出成功,可在个人中心中订单中查询您购物的订单'
this.queryState()
},
methods:{
queryState(){
this.loding = true
let outTimeN = 0
outTime = setInterval(() => {
hmState(this.type, this.$Route.query.orderId).then(res => {
outTimeN += 1
this.time = outTimeN
if(res.code === 1){
clearInterval(outTime)
this.success = true
this.loding = false
}
if(res.code === 0 && outTimeN >= 10){
clearInterval(outTime)
this.code = 0
this.loding = false
}
if(res.code === 2){
clearInterval(outTime)
this.code = 2
this.loding = false
}
}).catch(err => {
uni.showToast({
title: err.message,
icon : 'none'
})
})
}, 1000)
},
navBack(){
uni.navigateBack()
}
},
onUnload() {
clearInterval(outTime)
}
}
</script>
<style lang="scss" scoped>
.results{
height: 100vh;
box-sizing: border-box;
text-align: center;
padding-left: $padding * 3;
padding-right: $padding * 3;
padding-bottom: 20vh;
.title{
font-size: $title-size + 8;
color: $text-color;
font-weight: bold;
line-height: 80rpx;
padding: $padding 0;
}
.sub-title{
color: $text-gray;
line-height: 40rpx;
}
.hash{
background-color: white;
padding: $padding * 2;
border-radius: $radius-lg;
margin-top: $margin * 2;
font-size: $title-size;
color: $text-color;
.hash-title{
padding-bottom: $padding;
}
.hash-text{
word-break:break-all;
}
}
.results-button{
width: 100%;
margin-top: $margin * 3;
height: 90rpx;
line-height: 90rpx;
border-radius: 45rpx;
background-color: $main-color;
color: white;
font-size: $title-size;
font-weight: bold;
&::after{
display: none;
}
}
.circle-toast{
padding-top: 60rpx;
.sub-title{
line-height: 60rpx;
}
}
}
</style>

View File

@@ -24,20 +24,36 @@
</view>
<view class="recharge-btn">
<button :disabled="this.priceValue === ''" @click="onRecharge">充值</button>
<view class="recharge-text">提示暂时仅支持使用微信支付充值</view>
<view class="recharge-text">提示暂时仅支持使用支付宝支付充值</view>
</view>
</view>
</template>
<script>
var hmAppPay = uni.requireNativePlugin('TestModule');
import { hmPay } from '@/apis/interfaces/pay.js';
import { recharge, payment, paymentpre } from "@/apis/interfaces/account"
export default {
data() {
return {
priceValue: '',
paymentpre: []
orderId : '',
paymentpre: [],
hmPayState: false
};
},
onShow() {
if(this.hmPayState){
this.$Router.replace({
name : 'hmState',
params : {
type : 'recharge',
orderId : this.orderId
}
})
return
}
},
created() {
paymentpre().then(res => {
this.paymentpre = res
@@ -81,6 +97,21 @@
},
// 获取充值信息
getPayInfo(order_id){
if(plus.runtime.isApplicationExist({
pname : 'com.eg.android.AlipayGphone',
action : 'alipay://'
})){
uni.showLoading({
title: '获取支付信息'
})
this.getHmPayInfo(order_id)
}else{
uni.showToast({
title: '支付失败,请安装支付宝',
icon : 'none'
})
}
return
payment({order_id}).then(res => {
uni.requestPayment({
provider: 'wxpay',
@@ -107,8 +138,28 @@
icon : 'none'
})
})
},
// 河马支付
getHmPayInfo(order_id){
this.orderId = order_id
hmPay(order_id).then(res => {
try{
hmAppPay.gotoNativePage(JSON.stringify(res.params))
this.hmPayState = true
}catch(e){
uni.showToast({
title: e
})
}
}).catch(err => {
uni.showToast({
title: err.message,
icon : 'none'
})
})
}
},
// 充值记录
onNavigationBarButtonTap() {
this.$Router.push({name: 'AccountLog'})
}

View File

@@ -3,7 +3,7 @@
<!-- 设置支付密码 -->
<view class="password">
<view class="prompt">
<view class="prompt-code">验证码发送至{{phone}}
<view class="prompt-code">验证码发送至{{phone}}
<!-- <button size="mini" :disabled="getCodeState" @click="getCode">{{sendCode}}</button> -->
</view>
<view>请设置6位数字密码建议不要使用连续的数字</view>
@@ -227,6 +227,7 @@
width: 100%;
.time{
padding:20rpx 30rpx 20rpx 20rpx;
font-size: 30rpx;
}
}
</style>

200
pages/account/wbtBind.vue Normal file
View File

@@ -0,0 +1,200 @@
<template>
<view class="wbtBind">
<view class="input">
<view class="title">文版通编号</view>
<input type="number" maxlength="13" v-model="account" placeholder-class="placeholderClass" placeholder="请输入13位数字的文版通账号" />
</view>
<view class="input">
<view class="title">文版通姓名</view>
<input type="text" v-model="name" placeholder-class="placeholderClass" placeholder="请输入您的文版通姓名" />
</view>
<view class="group">
<u-radio-group>
<u-radio :checked='true' activeColor="#34ce98" labelColor="#999" labelSize="13" label="我有文版通账号" />
</u-radio-group>
<view class="created" >创建账号</view>
</view>
<view class="sure" @click="wbtBind"> 确认绑定文版通 </view>
<navigator hover-class="none" url="/pages/vip/agreement?id=9">
<view class="agree"> 同意
<span>文版通使用协议</span>
</view>
</navigator>
<view class="help">
<view class="title"> 温馨提示 </view>
<view class="help_1" v-for="item in 4" :key='item'>
{{item}}.文版通使用注意事项文版通使用注意事项文版通使用注意事项文版通使用注意事项文版通使用注意事项文版通使用注意事项
</view>
</view>
</view>
</template>
<script>
import { wbtBind } from '@/apis/interfaces/account'
export default {
data() {
return {
account: '',
name: ''
};
},
methods:{
wbtBind(){
let data = {
account: this.account,
name: this.name
}
if(data.account === '' && data.account.length !== 13){
uni.showToast({
title:'请核对账号',
icon:"none",
mask:true
})
return ;
}
if(data.name === ''){
uni.showToast({
title:'请核对姓名',
icon:"none",
mask:true
})
return ;
}
uni.showModal({
title:'温馨提示',
content:'确认绑定该文版通账号,绑定后无法撤回!',
success:(res)=> {
if(res.confirm){
wbtBind(data).then(res=>{
uni.showToast({
title:'文版通账号绑定成功',
icon:"none",
mask:true,
duration:1500
})
setTimeout(()=>{
uni.navigateBack({})
},2000)
}).catch(err=>{
uni.showToast({
title:err.message,
icon:"none",
mask:true
})
})
}
}
})
}
}
}
</script>
<style lang="scss">
.wbtBind {
min-height: 100vh;
background-color: #f9f9f9;
width: 100%;
box-sizing: border-box;
padding-top: 20rpx;
.input {
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
box-sizing: border-box;
padding: $padding + 20 $padding;
background-color: #fff;
border-bottom: solid 1rpx #f9f9f9;
input {
flex: 1;
text-align: left;
font-size: 30rpx;
}
.title {
font-size: 32rpx;
color: #333;
width: 200rpx;
margin-right: $margin;
font-weight: 600;
}
.placeholderClass {
color: #cacaca;
font-size: 30rpx;
}
}
.group {
font-size: 28rpx;
padding: $padding;
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
box-sizing: border-box;
margin-top: 10rpx;
.created {
color: #34CE98;
}
}
.sure {
background-color: $main-color;
color: #FFFFFF;
font-size: 34rpx;
font-weight: bold;
margin: 0 $margin $margin $margin;
border-radius: 10rpx;
text-align: center;
padding: $padding;
font-weight: bold;
}
.agree {
display: flex;
flex-direction: row;
align-items: center;
justify-content: flex-start;
box-sizing: border-box;
padding-left: $padding;
font-size: 28rpx;
color: #999;
span {
color: #1482D1;
margin-left: 10rpx;
}
}
.help {
padding: $padding;
color: #666;
font-size: 30rpx;
margin-top: $margin;
.title {
font-size: 34rpx;
font-weight: bold;
padding-bottom: 20rpx;
padding-top: 20rpx;
color: #333;
}
.help_1 {
padding-top: 10rpx;
line-height: 1.5;
}
}
}
</style>

View File

@@ -1,56 +1,74 @@
<template>
<view class="content">
<oct-address
:lists="addressList"
:pattern="true"
:isEdit="edit"
editColor="#34CE98"
:btnStyle="{'backgroundColor': '#34CE98'}"
@onAddress="onInfo"
@onAdd="$Router.push({name: 'AddressEdit'})"
/>
<!-- -->
</view>
</template>
<script>
import { list } from '@/apis/interfaces/address'
export default {
data() {
return {
edit : true,
addressList: []
};
},
onShow(){
this.edit = this.$Route.query.type === 'edit'
list().then(res => {
this.addressList = res
})
},
methods: {
onInfo(val){
if(this.edit){
this.$Router.push({
name : 'AddressEdit',
params : {
id : val.address_id
}
})
}else{
this.$store.commit('setAddress', val)
this.$Router.back()
}
}
}
};
</script>
<style lang="scss">
.content{
background: #F3F6FB;
overflow: hidden;
min-height: 100vh;
}
<template>
<view class="content">
<oct-address :lists="addressList" :pattern="true" :isEdit="edit" editColor="#34CE98"
:btnStyle="{'backgroundColor': '#34CE98'}" @onAddress="onInfo"
@onAdd="$Router.push({name: 'AddressEdit'})" />
<!-- -->
</view>
</template>
<script>
import {
list
} from '@/apis/interfaces/address'
export default {
data() {
return {
edit: true,
addressList: [],
task_id: '',
};
},
onShow() {
this.edit = this.$Route.query.type === 'edit'
this.task_id = this.$Route.query.task_id
list().then(res => {
this.addressList = res
})
},
methods: {
onInfo(val) {
if (this.edit) {
this.$Router.push({
name: 'AddressEdit',
params: {
id: val.address_id
}
})
} else {
console.log('back........', this.task_id)
if (this.task_id && this.task_id != '') {
uni.showModal({
title: '温馨提示',
content: '是否确认将该商品发货到这个位置',
confirmColor: '#34ce98',
confirmText: '我确定',
cancelColor: '#999',
cancelText: '再想想',
success: (res) => {
if (res.confirm) {
uni.navigateBack();
}
if (res.cancel) {
uni.navigateBack();
}
}
})
return;
}
this.$store.commit('setAddress', val)
this.$Router.back()
}
}
}
};
</script>
<style lang="scss">
.content {
background: #F3F6FB;
overflow: hidden;
min-height: 100vh;
}
</style>

View File

@@ -6,183 +6,291 @@
<view>共力生态</view>
<view>即可开始共力人生</view>
</view>
<view class="auth-input">
<input v-model="phone" type="number" maxlength="11" placeholder="输入手机号码">
</view>
<view class="auth-input"> <input v-model="phone" type="number" maxlength="11" placeholder="输入手机号码"> </view>
<view class="auth-input auth-code">
<input v-model="code" type="number" maxlength="4" placeholder="输入验证码">
<button :disabled="getSms" size="mini" @click="getPhoneCode()">{{sendCode}}</button>
</view>
<view class="auth-input" v-if="isShowParent">
<input v-model="parentId" placeholder="输入邀请码,选填">
</view>
<view class="auth-button">
<button @click="login('code')">登录</button>
<button :disabled="getSms" size="mini" @click="getCaptcha">{{sendCode}}</button>
</view>
<view class="auth-input" v-if="isShowParent"> <input v-model="parentId" placeholder="输入邀请码"> </view>
<view class="auth-button"> <button @click="login('code')">登录</button> </view>
<view class="auth-agreement">
登录即表示同意<navigator hover-class="none" url="/pages/vip/agreement?id=3">用户协议</navigator><navigator
hover-class="none" url="/pages/vip/agreement?id=4">隐私政策</navigator>
</view>
<view class="auth-other" v-if="isKeyAuth">
<button @click="login('Akey')">使用本机号码一键登录</button>
</view>
<view class="auth-other" v-if="isKeyAuth"> <button @click="login('Akey')">使用本机号码一键登录</button> </view>
</view>
<u-popup :show="showCaptchaCode" :round='10' mode='center' @close='close' @open="open">
<view class="showImgCode">
<view class="title"> 图片验证码 </view>
<image class="cover" @click="getCaptcha()" :src="captchaImg" mode="widthFix" />
<input class="input" v-model="captchaCode" maxlength="6" placeholder="请输入验证码" />
<view class="btn" @click="sureImgCode"> 确认验证码 </view>
</view>
</u-popup>
</view>
</template>
<script>
import {
smsAuth,
getInvitationSms,
keyAuth
} from '@/apis/interfaces/auth.js'
export default {
data() {
return {
phone : '',
code : '',
parentId : '',
getSms : false,
sendCode : '获取验证码',
isShowParent: false,
isKeyAuth : false
};
},
onShow () {
uni.showLoading({
title: '加载中...',
mask : true
})
// 预登录
uni.preLogin({
provider: 'univerify',
success: res => {
this.isKeyAuth = true
},
complete() {
uni.hideLoading()
}
})
},
methods: {
// 获取验证码
getPhoneCode() {
uni.showLoading({
title : '加载中...',
mask :true
})
let outTime;
let smsTime = 60;
getInvitationSms({
mobileNo: this.phone,
}).then(res => {
uni.showToast({
title: res.message,
icon: "none",
});
this.isShowParent = res.is_show_parent
this.getSms = true;
this.sendCode = smsTime + 's后重新获取';
outTime = setInterval(() => {
if (smsTime <= 1) {
this.getSms = false;
this.sendCode = '重新获取';
clearInterval(outTime);
return
}
this.sendCode = smsTime + 's后重新获取';
smsTime -= 1;
}, 1000);
}).catch((err) => {
uni.showToast({
title: err.message,
icon: "none",
});
});
},
// 登录
login(type) {
if (type === 'code') {
uni.showLoading({
title: '登录中'
})
smsAuth({
mobileNo : this.phone,
code : this.code,
parent_id : this.parentId
}).then((res) => {
this.setAuthToken(res.token_type + ' ' + res.access_token, res.is_new)
uni.hideLoading()
}).catch((err) => {
uni.showToast({
title: err.message,
icon: "none",
});
});
return
}
if (type === 'Akey') {
this.onKeyLogin()
}
},
// 一键登录
onKeyLogin(){
uni.login({
provider:'univerify',
univerifyStyle:{
icon: {
path: require('@/static/logo.png')
},
authButton: {
normalColor: '#34CE98',
highlightColor: '#25b381',
disabledColor: '#25b381'
},
otherLoginButton: {
visible: false
},
privacyTerms: {
termsColor: '#34CE98',
uncheckedImage: require('@/static/icon/unchecked-icon.png'),
checkedImage: require('@/static/icon/checked-icon.png')
}
},
success: Result => {
if(Result.errMsg === 'login:ok'){
let {access_token, openid} = Result.authResult
keyAuth({
access_token,
openid
}).then(res => {
this.setAuthToken(res.token_type + ' ' + res.access_token, res.is_new)
uni.closeAuthView()
}).catch(err => {
uni.showToast({
title: '登录失败:' + err.message,
icon : 'none'
})
uni.closeAuthView()
})
}
},
fail: err => {
console.log(err)
}
})
},
// setToken
setAuthToken(token, isNew){
this.$store.commit('setToken', token);
if(isNew){
uni.setStorageSync('isnew', 0)
this.$Router.replace({name: 'AuthRole'})
return
}
uni.setStorageSync('isnew', 1)
this.$Router.pushTab({name: 'Life'})
}
}
}
import {
smsAuth,
getInvitationSms,
keyAuth,
captcha,
} from '@/apis/interfaces/auth.js'
export default {
data() {
return {
phone: '',
code: '',
parentId: '', // 父类邀请码
getSms: false,
sendCode: '获取验证码',
isShowParent: false,
isKeyAuth: false,
shareId: '',
captchaImg: '',
captchaKey: '',
captchaCode: '',
showCaptchaCode: false, // 是否显示图片验证弹窗
};
},
onShow() {
setTimeout(() => {
if (plus.runtime.arguments.split('?')[1]) {
let args = plus.runtime.arguments.split('?')[1]
this.shareId = args.split('invitation')[0]
this.parentId = args.split('invitation')[1]
}
}, 100);
uni.showLoading({
title: '加载中...',
mask: true
})
// 预登录
uni.preLogin({
provider: 'univerify',
success: res => {
this.isKeyAuth = true
},
complete() {
uni.hideLoading()
}
})
},
methods: {
open() {
},
close() {
this.showCaptchaCode = false
},
// 弹窗确认验证码
sureImgCode() {
if (this.captchaCode != '' && this.captchaCode.length == 4) {
this.showCaptchaCode = false;
this.getPhoneCode();
return;
}
uni.showToast({
title: '请核对图片验证码',
icon: 'none',
mask: true,
duration: 2000
})
},
// 获取图片验证码
getCaptcha() {
if (this.phone.length != 11) {
uni.showToast({
title: '请核对手机号码',
icon: 'none',
mask: true,
duration: 2000,
})
return;
}
this.captchaCode = ''
this.captchaKey = ''
this.captchaImg = ''
this.showCaptchaCode = true;
captcha().then(res => {
this.captchaKey = res.key;
this.captchaImg = res.img;
}).catch(err => {
uni.showToast({
title: err.message,
icon: 'none',
mask: true,
duration: 2000,
})
})
},
// 获取验证码
getPhoneCode() {
if (this.phone.length != 11) {
uni.showToast({
title: '请核对手机号码',
icon: 'none',
mask: true,
duration: 2000,
})
return;
}
uni.showLoading({
title: '加载中...',
mask: true
})
let outTime;
let smsTime = 60;
getInvitationSms({
mobileNo: this.phone,
captcha_key: this.captchaKey,
captcha: this.captchaCode,
}).then(res => {
uni.showToast({
title: res.message,
icon: "none",
});
this.isShowParent = res.is_show_parent
this.getSms = true;
this.sendCode = smsTime + 's后重新获取';
this.captchaKey = ''
this.captchaCode = ''
outTime = setInterval(() => {
if (smsTime <= 1) {
this.getSms = false;
this.sendCode = '重新获取';
clearInterval(outTime);
return
}
this.sendCode = smsTime + 's后重新获取';
smsTime -= 1;
}, 1000);
this.captchaKey = ''
this.captchaCode = ''
}).catch((err) => {
this.captchaCode = ''
this.captchaKey = ''
uni.showToast({
title: err.message,
icon: "none",
});
});
},
// 登录
login(type) {
if (type === 'code') {
uni.showLoading({
title: '登录中'
})
let data = {
mobileNo: this.phone,
code: this.code,
parent_id: this.parentId
}
smsAuth(data).then((res) => {
this.setAuthToken(res.token_type + ' ' + res.access_token, res.is_new)
uni.hideLoading()
}).catch((err) => {
uni.showToast({
title: err.message,
icon: "none",
});
});
return;
}
if (type === 'Akey') {
this.onKeyLogin()
}
},
// 一键登录
onKeyLogin() {
uni.login({
provider: 'univerify',
univerifyStyle: {
icon: {
path: require('@/static/logo.png')
},
authButton: {
normalColor: '#34CE98',
highlightColor: '#25b381',
disabledColor: '#25b381'
},
otherLoginButton: {
visible: false
},
privacyTerms: {
termsColor: '#34CE98',
uncheckedImage: require('@/static/icon/unchecked-icon.png'),
checkedImage: require('@/static/icon/checked-icon.png')
}
},
success: Result => {
if (Result.errMsg === 'login:ok') {
let {
access_token,
openid
} = Result.authResult
keyAuth({
access_token,
openid
}).then(res => {
this.setAuthToken(res.token_type + ' ' + res.access_token, res
.is_new)
uni.closeAuthView()
}).catch(err => {
uni.showToast({
title: '登录失败:' + err.message,
icon: 'none'
})
uni.closeAuthView()
})
}
},
fail: err => {
uni.showToast({
title:err.message,
icon:'none',
mask:true,
duration:2000
})
}
})
},
// setToken
setAuthToken(token, isNew) {
this.$store.commit('setToken', token);
if (isNew) {
uni.setStorageSync('isnew', 0)
this.$Router.replace({
name: 'AuthRole',
params: {
shareId: this.shareId
}
})
return
}
uni.setStorageSync('isnew', 1)
if (this.shareId != '' && this.shareId != undefined) {
setTimeout(() => {
uni.hideLoading()
plus.runtime.arguments = null;
plus.runtime.arguments = '';
uni.reLaunch({
url: '/pages/group-book/success/success?access=1&id=' + this.shareId
})
}, 1000)
} else {
this.$Router.pushTab({
name: 'Life'
})
}
}
}
}
</script>
<style lang="scss">
@@ -214,6 +322,28 @@
color: white;
}
.auth-img-code {
display: flex;
flex-direction: row;
align-items: center;
border-radius: 50rpx;
margin-top: 40rpx;
background: white;
height: 100rpx;
input {
height: 100rpx;
font-size: 32rpx;
padding: 0 50rpx;
flex: 1;
}
image {
width: 180rpx;
margin-right: 50rpx;
}
}
.auth-input {
background: white;
height: 100rpx;
@@ -299,5 +429,43 @@
}
}
}
.showImgCode {
width: 600rpx;
padding: 50rpx 30rpx;
display: flex;
flex-direction: column;
.title {
text-align: center;
font-size: 40rpx;
font-weight: bold;
}
.cover {
width: 100%;
padding: 50rpx 0;
height: 150rpx;
}
.input {
border-radius: 6rpx;
border: solid 1rpx #cacaca;
padding: 30rpx 0;
text-align: center;
font-size: 34rpx;
}
.btn {
background-color: #34ce98;
color: #fff;
font-weight: bold;
border-radius: 10rpx;
margin-top: 30rpx;
text-align: center;
padding: 30rpx 0;
font-size: 36rpx;
}
}
}
</style>

View File

@@ -71,7 +71,19 @@
storage_id : this.storageId
}).then(res => {
uni.setStorageSync('isnew', 1)
this.$Router.pushTab({name: 'Life'})
if(this.$Route.query.shareId!='' && this.$Route.query.shareId != undefined){
setTimeout(() => {
uni.hideLoading()
plus.runtime.arguments = null;
plus.runtime.arguments = '';
uni.reLaunch({
url: '/pages/group-book/success/success?access=1&id=' + this.$Route.query.shareId
})
}, 1000)
}else{
this.$Router.pushTab({name: 'Life'})
}
uni.setStorageSync('isnew', 1)
}).catch(err => {
this.disabled = false
uni.showToast({

View File

@@ -52,7 +52,7 @@
>
<slot>
<view class="wechat-content">
<image class="wechat-qrcode" :src="require('@/static/user/qrCode.jpeg')" mode="widthFix"></image>
<image class="wechat-qrcode" :src="require('@/static/user/qrCode.png')" mode="widthFix"></image>
<view class="wechat-text">扫描企业微信二维码添加微信客服</view>
</view>
</slot>
@@ -97,7 +97,7 @@
methods: {
dowQrCode(){
uni.saveImageToPhotosAlbum({
filePath: require('@/static/user/qrCode.jpeg'),
filePath: require('@/static/user/qrCode.png'),
success(res) {
uni.showToast({
title: '二维码已保存到系统相册',

BIN
pages/group-book/.DS_Store vendored Normal file

Binary file not shown.

View File

@@ -0,0 +1,417 @@
<template>
<view class="pin-detail">
<view class="goods">
<image class="cover" :src="goods.cover" mode="aspectFill" />
<view class="info">
<view class="title">{{goods.name}} </view>
<view class="subtitle">
<view class="hasPined" v-if="collage.sale>0">
<image src="/static/store/fire.png" mode="widthFix" />已拼{{collage.sale}}
</view>
<view class="tuan">{{collage.number}}人团</view>
</view>
<view class="price">
<view class="now">{{goods.price}}<span>DT积分</span></view>
<view class="old"> {{goods.cost}}积分 </view>
</view>
</view>
</view>
<view class="pin">
<view class="title">
<block v-if="collage.down>0 && collage.status == 3">
<u-count-down :time="collage.down* 1000" format="DD:HH:mm:ss" autoStart millisecond @change="onChange">
&nbsp; </u-count-down>
距离结束<span>{{ timeData.days }}</span>&nbsp;
<span>{{ timeData.hours>10?timeData.hours:'0'+timeData.hours}}&nbsp;</span>小时<span>{{ timeData.minutes }}&nbsp;</span>分钟<span>{{ timeData.seconds }}&nbsp;</span>
</block>
<block v-if="collage.status != 3">
<span>{{collage.status_text}}</span>
</block>
</view>
<view class="avatars">
<block>
<image v-for="(item,index) in users" :key='"avatar"+index+1' :class="['avatar',item.master?'pin':''] " :src="item" mode="aspectFill" />
</block>
<block v-if="collage.surplus>0">
<image v-for="(item,index) in collage.surplus" :key='"surplus"+index+2' class="wen" src="/static/book/wen.png" mode="aspectFill" />
</block>
</view>
<view class="title" v-if="collage.sale>0">已拼<span>{{collage.sale}}</span></view>
<view class="progress">
{{collage.number - collage.surplus}}
<u-line-progress activeColor="#34ce98" class="line" :percentage="collage.score" :showText="false" />
{{collage.number}}
</view>
</view>
<view class="warn" v-if="collage.status == 3 || collage.status == 2">完成支付后需在24小时内邀请好友参加拼团否则拼团失败自动退款</view>
<view class="order" v-if="orderDetail.order_no != ''">
<view class="title">订单详情</view>
<view class="order-item">
<view class="order-item-title">订单编号</view>
<view class="order-item-detail">{{orderDetail.order_no}}</view>
</view>
<view class="order-item">
<view class="order-item-title">下单时间</view>
<view class="order-item-detail">{{orderDetail.created_at}}</view>
</view>
<view class="order-item">
<view class="order-item-title">支付时间</view>
<view class="order-item-detail">{{orderDetail.paid_at}}</view>
</view>
<view class="order-item" v-if="collage.status == 1&& express.deliver_at">
<view class="order-item-title">发货时间</view>
<view class="order-item-detail">{{ express.deliver_at || '--'}}</view>
</view>
<view class="order-item" v-if="collage.status == 1 && express.receive_at">
<view class="order-item-title">签收时间</view>
<view class="order-item-detail">{{ express.receive_at || '--'}}</view>
</view>
<view class="order-item">
<view class="order-item-title">支付方式</view>
<view class="order-item-detail">DT支付</view>
</view>
<view class="order-item">
<view class="order-item-title">备注信息</view>
<view class="order-item-detail">{{orderDetail.remark || '--'}}</view>
</view>
</view>
<view class="btn" v-if="collage.status == 1 && can">
<view v-if="can.logistic_show" @click="onBtn('logistic')" class="btn-item"> 查看物流 </view>
<view v-if="can.sign" @click="onBtn('sign')" class="btn-item success"> 确认签收 </view>
</view>
</view>
</template>
<script>
import {
myPinDetail
} from '@/apis/interfaces/pin.js'
import { sign } from '@/apis/interfaces/order'
export default {
data() {
return {
orderDetail: {},
goods: {},
collage: {},
users: [],
timeData: {},
express: {},
can: {}
};
},
onLoad() {
this.getInfo()
},
methods: {
getInfo(){
myPinDetail(this.$Route.query.id).then(res => {
console.log(res)
this.orderDetail = res.order_detail;
this.goods = res.item;
let collage = res.collage;
collage.score = (res.collage.number - res.collage.surplus)/res.collage.number * 100
this.collage = collage;
this.users = res.users;
this.express = res.order_detail.express;
this.can = res.order_detail.can;
}).catch(err => {
uni.showToast({
title: err.message,
icon: "none",
mask: true,
duration: 3000
})
})
},
onChange(e) {
this.timeData = e
},
onBtn(type) {
switch (type) {
case 'logistic':
this.$Router.push({
name: 'OrderLogistics',
params: {
orderNo: this.orderDetail.order_no,
},
});
break;
case 'sign':
uni.showModal({
title: '温馨提示',
content: '是否确认收到货物并签收该订单',
confirmText: '确认签收',
confirmColor: "#34CE98",
cancelText: '再想想',
cancelColor: "#666666",
success: (res) => {
if (res.confirm) {
sign(this.orderDetail.order_no).then(res => {
this.getInfo();
return;
}).catch(err => {
uni.showToast({
title: err.message,
icon: 'none'
})
})
}
}
});
break;
}
}
}
}
</script>
<style lang="scss">
.pin-detail {
background-color: $window-color;
min-height: 100vh;
position: relative;
.goods {
padding: $padding;
border-top: solid 20rpx #f9f9f9;
display: flex;
flex-direction: row;
align-items: center;
justify-content: center;
box-sizing: border-box;
background-color: #fff;
.cover {
width: 200rpx;
height: 200rpx;
border-radius: 10rpx;
}
.info {
flex: 1;
margin-left: 20rpx;
font-size: 32rpx;
.title {
font-size: 32rpx;
color: #454545;
}
.subtitle {
width: 100%;
display: flex;
flex-direction: row;
align-items: center;
justify-content: flex-start;
box-sizing: border-box;
color: #999;
font-size: 26rpx;
margin-top: 20rpx;
.hasPined {
display: flex;
flex-direction: row;
align-items: center;
justify-content: flex-start;
box-sizing: border-box;
color: #d81e06;
background-color: rgba(255, 0, 0, .1);
padding: 4rpx 24rpx;
border-radius: 30rpx;
image {
width: 34rpx;
height: 34rpx;
margin: 6rpx;
}
}
.tuan {
margin-left: 20rpx;
}
}
.price {
display: flex;
flex-direction: row;
align-items: center;
justify-content: flex-start;
box-sizing: border-box;
margin-top: 20rpx;
margin-left: 10rpx;
.now {
font-size: 38rpx;
font-weight: bold;
color: #d81e06;
span {
font-weight: normal;
font-size: 24rpx;
padding-left: 4rpx;
}
}
.old {
font-weight: normal;
font-size: 26rpx;
color: #999;
margin-left: 30rpx;
text-decoration: line-through;
padding-top: 16rpx;
}
}
}
}
.pin {
margin-top: $margin - 10;
background-color: #fff;
padding: $padding;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
box-sizing: border-box;
.title {
font-size: 30rpx;
color: #454545;
span {
color: #d81e06;
font-size: 36rpx;
font-weight: bold;
padding: 0 6rpx;
}
}
.progress {
width: 100%;
display: flex;
flex-direction: row;
align-items: center;
justify-content: center;
box-sizing: border-box;
color: #454545;
font-size: 28rpx;
margin-top: $margin*2 - 20;
.line {
flex: 1;
margin: 0 $margin - 10;
}
}
.avatars {
display: flex;
flex-direction: row;
align-items: center;
justify-content: center;
box-sizing: border-box;
position: relative;
margin-top: $margin;
image {
width: 100rpx;
height: 100rpx;
// padding: 20rpx;
border-radius: 50%;
margin: 10rpx 20rpx;
border: solid 2rpx #f9f9f9;
}
.pin {
position: relative;
&::after {
position: absolute;
top: 0;
left: 0;
content: '拼主';
background: orange;
padding: 4rpx 0;
font-size: 20rpx;
width: 100%;
text-align: center;
color: #fff;
}
}
}
}
.warn {
text-align: center;
padding: $padding - 10 $padding + 20;
color: grey;
font-size: 26rpx;
}
.order {
background-color: #fff;
padding: $padding;
margin-top: 20rpx;
padding-bottom: 150rpx;
.title {
font-size: 32rpx;
color: #454545;
font-weight: bold;
border-bottom: solid 1rpx #f9f9f9;
padding-bottom: 20rpx;
}
.order-item {
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
;
box-sizing: border-box;
color: #454545;
padding: $padding 0;
border-bottom: solid 1rpx #f9f9f9;
.order-item-title {
font-size: 30rpx;
}
.order-item-detail {
font-size: 30rpx;
}
}
}
.btn {
position: fixed;
bottom: 0;
background-color: #fff;
width: 100%;
display: flex;
flex-direction: row;
align-items: center;
justify-content: flex-end;
box-sizing: border-box;
padding: 0 $padding + 20 $padding $padding + 20;
.btn-item {
font-size: 26rpx;
margin-left: $margin/2;
color: #333;
line-height: 56rpx;
border: solid 1rpx #ddd;
padding: 0 ($margin - 10);
border-radius: 28rpx;
display: inline-block;
margin-top: $margin;
}
.success {
color: #34CE98;
border-color: #34CE98;
}
}
}
</style>

125
pages/group-book/index.vue Normal file
View File

@@ -0,0 +1,125 @@
<template>
<view class="groupBook">
<view class="top">
<view class="title">爆款推荐</view>
<view>省钱省心限时拼</view>
</view>
<!-- 有数据 -->
<scroll-view scroll-y="true" class="scroll" @scrolltolower='scrolltolower' v-if="lists.length>0">
<block v-for="(item,index) in lists" :key="index">
<pinGoodsItem :item="item" @goPin="goPin" />
</block>
</scroll-view>
<!-- 没数据 -->
<scroll-view scroll-y="true" class="scroll" v-else>
<view class="vertical pages-empty" style="padding-top: 200rpx;">
<u-empty
icon="http://cdn.uviewui.com/uview/empty/list.png"
textColor="#999"
text="暂无拼单商品~"
/>
</view>
</scroll-view>
</view>
</template>
<script>
import pinGoodsItem from '@/components/pin-goods-item/index.vue'
import {
pinList
} from '@/apis/interfaces/pin.js'
export default {
components: {
pinGoodsItem
},
data() {
return {
lists: [],
page: 1,
has_more: true,
};
},
onLoad() {
this.getList()
},
methods: {
getList() {
pinList({
page: this.page
}).then(res => {
this.lists = this.lists.concat(res.data)
this.has_more = res.page.has_more
}).catch(err => {
uni.showToast({
title: err.message,
icon: "none",
mask: true
})
})
},
// 触底获取更多~
scrolltolower() {
if (this.has_more) {
this.page = this.page + 1
this.getList()
}else{
uni.showToast({
title:'没有更多~',
icon:'none'
})
}
},
// 马上拼团
goPin(id) {
console.log('fule gopin....')
uni.navigateTo({
url:'/pages/store/goods?id='+id
})
}
}
}
</script>
<style lang="scss">
.groupBook {
width: 100%;
min-height: 100vh;
position: relative;
background: $window-color;
box-sizing: border-box;
position: relative;
.top {
position: absolute;
top: 0;
left: 0;
font-size: $title-size - 2;
color: #fff;
width: 100%;
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
padding: $padding;
box-sizing: border-box;
background: linear-gradient(to bottom, #22aa98, rgba(255, 255, 255, 0));
padding-bottom: 40vh;
z-index: 1;
.title {
font-size: 40rpx;
font-weight: bold;
}
}
.scroll {
height: 100vh;
position: relative;
padding: $padding * 4 $padding $padding $padding;
box-sizing: border-box;
z-index: 2;
}
}
</style>

View File

@@ -0,0 +1,215 @@
<template>
<view class="content">
<!-- tabs -->
<u-sticky>
<u-tabs class="tabs" :list="tabs" :scrollable="false" :current="index" lineColor="#34CE98" @click="onTabs"
sticky />
</u-sticky>
<block v-if="array.length >= 1">
<!-- 订单列表 -->
<orderPin v-for="(item, arrayIndex) in array" :key="arrayIndex" :order-info="item" @onBtn="onType" />
<!-- 加载更多 -->
<view class="pages-load">
<u-loadmore :status="status" />
</view>
</block>
<block v-else>
<view class="vertical order-null">
<u-empty mode="order" icon="http://cdn.uviewui.com/uview/empty/order.png" text="暂无相关订单"
textColor="#999" />
</view>
</block>
<!-- 分享 -->
<uni-popup ref="popupShare" type="share" background-color="#fff">
<uni-popup-share title="立即分享到" @select="select" />
</uni-popup>
</view>
</template>
<script>
import {
orders,
del,
cancel,
sign
} from '@/apis/interfaces/order'
import {
myPinList
} from '@/apis/interfaces/pin'
import eventBus from '../../../utils/eventBus.js';
import orderPin from '@/components/oct-order-pin/index.vue'
export default {
components: {
orderPin
},
data() {
return {
status: "loading",
tabs: [{
name: "全部",
type: "",
},
{
name: "拼团中",
type: "3",
},
{
name: "拼团成功",
type: "1",
},
{
name: "拼团失败",
type: "2",
}
],
index: '0',
array: [],
page: 1,
shareInfo: {},
};
},
onLoad() {
this.getOrder()
},
onShow() {
if (this.$store.getters.getRefresh == 1) {
this.$store.commit('setRefresh', 0)
this.array = []
this.page = 1
this.getOrder()
}
},
methods: {
getOrder() {
myPinList({
state: this.tabs[this.index].type,
page: this.page
}).then(res => {
console.log(res)
if (res.page.current === 1) {
this.array = []
}
let ordersArr = res.data.map(val => {
return {
no: val.order_no,
cover: val.item.cover,
name: val.item.name,
price: val.item.price,
sum: 1,
collage: val.collage,
shop: val.shop,
goods_id: val.item.goods_id,
unit: val.item.unit,
users: val.users,
invite: val.invite,
order: val.order,
url: val.url
}
})
this.array = this.array.concat(ordersArr)
this.status = res.page.has_more ? 'loadmore' : 'nomore'
})
},
onTabs(e) {
this.page = 1
this.index = e.index
this.getOrder()
},
onType(e) {
let orderNo = e.order.no;
let shopId = e.order.shop.shop_id;
let goodsId = e.order.goods_id;
switch (e.type) {
case 'share':
this.shareInfo = e.order
this.$refs.popupShare.open();
console.log('触发分享', this.shareInfo)
break;
case 'goInfo':
uni.navigateTo({
url:'/pages/group-book/detail/detail?id='+e.order.no
})
break;
}
},
// 分享选项
select(e) {
console.log(this.shareInfo.url + this.shareInfo.collage.collage_id + 'invitation' + this
.shareInfo.invite, this.shareInfo.collage.surplus, this.shareInfo.cover, this.shareInfo.name)
switch (e.item.name) {
case 'wxchum':
uni.share({
provider: 'weixin',
scene: 'WXSceneSession',
type: 0,
href: this.shareInfo.url + this.shareInfo.collage.collage_id + 'invitation' + this
.shareInfo.invite,
title: '【仅剩' + this.shareInfo.collage.surplus + '个名额】邀请您一起拼团',
summary: '好货不用一分钱,点点就能带回家【 ' + this.shareInfo.name + '】',
imageUrl: this.shareInfo.cover,
fail: (err) => {
uni.showToast({
title: err.errMsg,
icon: 'none'
})
},
success: (res) => {
this.shareInfo = {}
}
})
break;
case 'wxcircle':
uni.share({
provider: 'weixin',
scene: 'WXSceneTimeline',
type: 0,
href: this.shareInfo.url + this.shareInfo.collage.collage_id + 'invitation' + this
.shareInfo.invite,
summary: '好货不用一分钱,点点就能带回家【 ' + this.shareInfo.name + '】',
imageUrl: this.shareInfo.cover,
fail: (err) => {
uni.showToast({
title: err.errMsg,
icon: 'none'
})
},
success: (res) => {
this.shareInfo = {}
}
})
break;
}
},
},
onReachBottom() {
if (this.status === 'loadmore') {
this.page += 1
this.status = 'loading'
this.getOrder()
}
}
}
</script>
<style lang="scss">
.content {
background: $window-color;
min-height: 100vh;
}
.tabs {
background: white;
}
// 数据列表空
.order-null {
height: 80vh;
}
// 加载分页
.pages-load {
padding-bottom: $padding;
}
</style>

View File

@@ -0,0 +1,299 @@
<template>
<view class="pinSuccess">
<view class="count-down" v-if="downTime>0">
<u-count-down ref="countDown" :time="downTime" format="HH:mm:ss" :autoStart="true" millisecond />
</view>
<view class="title" v-if="surplus>0"> 还差 <span>{{surplus}}</span> 赶紧邀请好友来拼单吧 </view>
<block v-if="share.status == 3">
<view class="btn invite" v-if="!share.can_share " @click="onTake"> 参与该拼单 </view>
<view class="btn invite" v-if="share.can_share" @click="onShare"> 邀请好友拼单 </view>
</block>
<view class="btn index" @click="goIndex"> 去首页逛逛</view>
<view class="goodInfo">
<view class="avatars">
<block >
<image v-for="(item,index) in details" :key='index+1' :class="['avatar',item.master?'pin':''] " :src="item.cover" mode="aspectFill" />
</block>
<block v-if="surplus>0">
<image v-for="(item,index) in surplus" :key='index+2' class="wen" src="/static/book/wen.png" mode="aspectFill" />
</block>
</view>
<block>
<view class="orderInfo">
<view class="left"> 订单详情 </view>
<view class="right" @click="goDetail">
<view class="right-title"> {{goodName}} </view>
<u-icon name="arrow-right" />
</view>
</view>
<view class="orderInfo">
<view class="left">拼单规则</view>
<view class="right">
<view class="right-title">人满发货 · 人不满退款 · 只能拼一次 </view>
</view>
</view>
</block>
</view>
<!-- 分享 -->
<uni-popup ref="popupShare" type="share" background-color="#fff">
<uni-popup-share title="立即分享到" @select="select" />
</uni-popup>
</view>
</template>
<script>
import {
repages
} from '@/apis/interfaces/store.js'
export default {
data() {
return {
goodName: '',
details: [],
downTime: 0,
surplus: 0,
goods: {}, // order 是{} 标识不是我的订单,否则就是我的订单可以跳转订单详情
share:{},
access: '0', // 参与别人的1 自己的分享的0 后来想想这个接口作用不大了 ~ 闹挺 ~ 所以这个字段暂时不用,用后端返回的新字段来区分是自己的拼单还是别人的拼单;
};
},
onLoad() {
this.access = this.$Route.query.access
repages(this.$Route.query.id,{invite:this.invite}).then(res => {
this.share = res.share
this.goods = res.goods
this.goodName = res.goods.name
this.surplus = res.share.surplus
this.details = res.share.details
this.downTime = res.share.down * 1000
uni.setNavigationBarTitle({
title:res.share.status_text
})
}).catch(err => {
uni.showToast({
title: err.message,
icon: "none",
mask: true,
duration: 3000
})
})
},
onHide() {
try {
if (this.$refs.countDown) {
this.$refs.countDown.pause()
}
} catch (err) {
uni.showToast({
title: err,
icon: 'none'
})
}
},
methods: {
// 参与拼单
onTake(){
console.log()
uni.navigateTo({
url: '/pages/store/goods?id=' + this.goods.goods_id+'&shareId='+this.share.collage_id ,// shareId 代表当前商品详情下面拼单有带 id
})
},
// 分享
onShare() {
this.$refs.popupShare.open();
},
// 分享选项
select(e) {
switch (e.item.name) {
case 'wxchum':
uni.share({
provider: 'weixin',
scene: 'WXSceneSession',
type: 0,
href: this.share.url + this.share.collage_id+'invitation'+this.share.invite.invite,
title: '【仅剩' + this.surplus +'个名额】邀请您一起拼团',
summary: '好货不用一分钱,点点就能带回家【 ' + this.goods.name + '】',
imageUrl: this.goods.cover,
fail(err) {
uni.showToast({
title: err.errMsg,
icon: 'none'
})
}
})
break;
case 'wxcircle':
uni.share({
provider: 'weixin',
scene: 'WXSceneTimeline',
type: 0,
href: this.share.url + this.share.collage_id+'invitation'+this.share.invite.invite,
summary: '好货不用一分钱,点点就能带回家【 ' + this.goods.name + '】',
imageUrl: this.goods.cover,
fail(err) {
uni.showToast({
title: err.errMsg,
icon: 'none'
})
}
})
break;
}
},
// 返回首页
goIndex() {
uni.reLaunch({
url: '/pages/store/index'
})
},
// 商品详情
goDetail() {
uni.navigateTo({
url: '/pages/store/goods?id=' + this.goods.goods_id
})
}
}
}
</script>
<style lang="scss">
.pinSuccess {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
box-sizing: border-box;
.count-down {
background-color: #f9f9f9;
border-radius: 4rpx;
padding: 10rpx $padding;
margin-top: $margin;
}
.title {
font-size: 38rpx;
font-weight: bold;
margin-top: $margin * 2;
span {
color: $main-color;
font-size: 42rpx;
padding: 0 10rpx;
}
}
.btn {
width: 80%;
background-color: $main-color;
color: #fff;
text-align: center;
padding: $padding - 4;
font-size: 34rpx;
border-radius: 10rpx;
margin-top: $margin;
border: solid $main-color 3rpx;
}
.invite {
margin-top: $margin + 20;
}
.index {
background-color: rgba($color: #fff, $alpha: 1.0);
color: $main-color;
}
.goodInfo {
border-top: solid 20rpx #f9f9f9;
width: 100%;
margin-top: $margin + 20;
padding: $padding + 10;
box-sizing: border-box;
.avatars {
display: flex;
flex-direction: row;
align-items: center;
justify-content: center;
box-sizing: border-box;
position: relative;
border-bottom: solid 1rpx #f9f9f9;
padding-bottom: $padding;
image {
width: 90rpx;
height: 90rpx;
border-radius: 50%;
margin: 10rpx 20rpx;
border: solid 2rpx #f9f9f9;
}
.me {
position: relative;
&::after {
position: absolute;
top: 0;
left: 0;
content: '我';
border-radius: 20rpx;
background: $main-color;
padding: 4rpx 34rpx;
text-align: center;
font-size: 24rpx;
color: #fff;
}
}
.pin {
position: relative;
&::after {
position: absolute;
top: 0;
left: 0;
content: '拼主';
// border-radius: 20rpx;
background: orange;
padding: 4rpx 0;
font-size: 20rpx;
width: 100%;
text-align: center;
color: #fff;
}
}
}
.orderInfo {
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
box-sizing: border-box;
padding: 30rpx 0;
font-size: 28rpx;
color: #666;
border-bottom: solid 1rpx #f9f9f9;
.right {
flex: 1;
margin-left: $margin;
text-align: right;
display: flex;
flex-direction: row;
align-items: center;
justify-content: flex-end;
box-sizing: border-box;
.right-title {
margin-right: 10rpx;
color: #999;
}
}
}
}
}
</style>

View File

@@ -19,7 +19,7 @@
</view>
<!-- 分享 -->
<uni-popup ref="popupShare" type="share" background-color="#fff">
<uni-popup-share title="分享到" @select="select"></uni-popup-share>
<uni-popup-share title="分享到" @select="select" :isDowImg="true"></uni-popup-share>
</uni-popup>
</view>
</template>

View File

@@ -2,6 +2,12 @@
<view class="capacity">
<view class="capacity-title">共力分总产率/小时<text>{{baseHour}}GLF/h</text></view>
<view class="capacity-sbutitle">总产率=角色产率+团队产率+共建产率+共力值产率</view>
<view class="capacity-block">
<view class="capacity-block-title">
<view class="title">平台数据</view>
</view>
<view class="capacity-block-text">平台注册人数<text>{{userData.login}}</text>活跃人数<text>{{userData.online}}</text></view>
</view>
<view class="capacity-block">
<view class="capacity-block-title">
<view class="title">我的角色</view>
@@ -11,12 +17,11 @@
</view>
<view class="capacity-block">
<view class="capacity-block-title">
<view class="title">成员产率({{group.effect}}/{{group.count}})<text< /text>
</view>
<view class="title">成员产率({{group.effect}}/{{group.count}})</view>
<view class="capacity-block-glf">{{group.capacity}}GLF/h</view>
<!-- <view class="more" @click="onInvitation">邀请更多好友</view> -->
</view>
<view class="capacity-block-table pt30">
<view class="capacity-block-table">
<view class="header">
<view class="flex-item">家族成员产率</view>
</view>
@@ -104,7 +109,11 @@
build: {},
together: {},
other: {},
can_repeat_sign: false
can_repeat_sign: false,
userData: {
login : '-',
online : '-'
}
};
},
created() {
@@ -128,11 +137,11 @@
confirmText: '立即重置',
cancelColor: '#999',
cancelText: '再想想',
success: (res1) => {
success: (res1) => {
this.Sign()
return
if (res1.confirm) {
console.log('再次签到。。。')
this.checkIMEI().then(res => {
console.log(res);
switch (res) {
case 'Permanent':
uni.showModal({
@@ -174,7 +183,7 @@
methods: {
glz(){
glz().then(res => {
console.log(res);
this.userData = res.userData
this.nickname = res.nickname
this.identityText = res.identity_text
this.baseHour = res.base_hour
@@ -340,24 +349,22 @@
color: gray;
font-size: 30rpx;
}
}
}
&-text {
font-size: 28rpx;
color: gray;
line-height: 40rpx;
padding-top: 30rpx;
padding-top: 10rpx;
text{
color: $main-color;
font-weight: bold;
padding: 0 10rpx;
}
}
&-table {
border: solid 1px $border-color;
margin-bottom: 20rpx;
padding-top: 30rpx;
&:last-child {
margin-top: 0;
}
margin-top: 20rpx;
.header {
background: $border-color;
line-height: 50rpx;
@@ -365,7 +372,6 @@
font-size: 26rpx;
color: gray;
}
.flex {
display: flex;
border-top: solid 1rpx $border-color;

View File

@@ -33,12 +33,12 @@
</view>
</view>
<!-- 微信阅读 -->
<view class="reading" v-if="!isOver">
<!-- <view class="reading" v-if="!isOver">
<view class="reading-icon number-float" @click="onReading">
<image class="reading-icon-image" :src="require('@/static/icon/reading_btn.png')" alt="签到"></image>
</view>
<view class="reading-title">共力分加成</view>
</view>
</view> -->
<image class="life-cover-back" :src="require('@/static/life/back.png')"></image>
<view class="life-role">
<image class="life-role-src" :src="figurePath" mode="widthFix" />
@@ -51,7 +51,26 @@
</view>
</view>
<!-- 功能入口 -->
<view class="life-flex">
<view class="life-flex">
<!-- 公告 -->
<view class="life-notice" v-if="notices.length > 0">
<view class="life-notice-bar">
<uni-icons class="life-notice-icon" size="18" type="notification-filled" color="#34CE98"></uni-icons>
<swiper
class="life-notice-swiper"
:autoplay="true"
circular
vertical
>
<swiper-item v-for="(item, index) in notices" :key="index">
<view class="life-notice-item">
<navigator :url="'./noticeDetails?id=' + item.article_id" hover-class="none">{{item.title}}</navigator>
</view>
</swiper-item>
</swiper>
<navigator class="life-notice-more" hover-class="none" url="./notice">更多</navigator>
</view>
</view>
<view class="life-flex-item house" @click="onNav({name: 'Store'}, 'tab')">
<view class="house-content">
<view class="house-title">DT商城</view>
@@ -60,10 +79,11 @@
<image src="../../static/img/house_back.jpg" mode="aspectFill"></image>
</view>
<view class="life-flex-item both">
<view class="both-item team" @click="onToast('共力文娱暂未开放尽情期待')">
<!-- <view class="both-item team" @click="onNav({name: 'Mission'}, '')"> -->
<view class="both-item team" @click="onToast('正在努力开发中,耐心等待~')">
<view class="team-content">
<view class="team-title">共力文娱</view>
<view class="team-subtitle">文娱短视频近期开放</view>
<view class="team-title">奖励任务</view>
<view class="team-subtitle">完成任务可获DT积分/商品</view>
</view>
<image src="../../static/img/text_back.jpg" mode="aspectFill"></image>
</view>
@@ -150,7 +170,8 @@
timeData: {},
isSign: false,
isAccount: false,
isOver : false,
isOver : false,
notices : []
};
},
onShow() {
@@ -171,7 +192,8 @@
},
// 共力人生
getLife() {
life().then(res => {
life().then(res => {
this.notices = res.notices
this.glz = res.account.glz
this.base_hour = res.account.base_hour
this.base_seconds = res.account.base_seconds
@@ -221,7 +243,10 @@
if(this.isSign){
this.$Router.push({name: 'Capacity'})
return
}
}
// 签到
this.Sign()
return
this.checkIMEI().then(res => {
switch (res) {
case 'Permanent':
@@ -260,11 +285,13 @@
title: ''
})
readingUrl().then(res => {
if(res.is_over){
plus.runtime.openURL(res.ticket)
if(!res.is_over){
try{
plus.runtime.openURL(res.ticket)
}catch(e){
console.log(e)
}
}
console.log(res)
uni.hideLoading()
}).catch(err => {
uni.showToast({
@@ -283,7 +310,7 @@
this.Sign()
}
}, err => {
this.Sign()
// this.Sign()
})
},
// 签到
@@ -361,7 +388,6 @@
icon: 'none'
})
}
}
}
</script>
@@ -403,7 +429,39 @@
flex-wrap: wrap;
position: relative;
z-index: 1;
.life-notice{
width: calc(100% - 20rpx);
margin: 10rpx;
&-bar{
position: relative;
background-color: white;
border-radius: 20rpx;
padding: 0 150rpx 0 80rpx;
height: 90rpx;
}
&-icon{
position: absolute;
left: 30rpx;
top: 26rpx;
}
&-more{
position: absolute;
right: 30rpx;
top: 0;
line-height: 90rpx;
font-size: 28rpx;
color: $main-color;
}
&-swiper{
height: 90rpx;
}
&-item{
line-height: 90rpx;
font-size: 28rpx;
color: #333;
@extend .nowrap;
}
}
.life-flex-item {
background: white;
border-radius: 20rpx;

85
pages/life/notice.vue Normal file
View File

@@ -0,0 +1,85 @@
<template>
<view class="conten">
<block v-if="list.length > 0">
<navigator class="list-item" v-for="(item, index) in list" :key="index" :url="'./noticeDetails?id=' + item.article_id">
<view class="item-title">{{item.title}}</view>
<view class="item-time"><text>{{item.categories[0].title}}</text>{{item.created_at}}</view>
<uni-icons class="item-icon" type="forward" color="#ddd" size="20"></uni-icons>
</navigator>
</block>
<block v-else>
<view class="list-empty">
<u-empty
mode="data"
icon="http://cdn.uviewui.com/uview/empty/data.png"
text="暂无公告信息"
>
</u-empty>
</view>
</block>
</view>
</template>
<script>
import { list } from '@/apis/interfaces/notice.js'
export default {
data() {
return {
list: [],
page: {}
};
},
created() {
list().then(res => {
this.list = res.data
this.page = res.page
}).catch(err => {
uni.showToast({
title: res.message,
icon : 'none'
})
})
}
}
</script>
<style lang="scss">
.list-empty{
height: 80vh;
@extend .vertical;
}
.conten{
min-height: 100vh;
background: #F3F6FB;
padding-top: 30rpx;
box-sizing: border-box;
.list-item{
position: relative;
margin: 0 30rpx 30rpx 30rpx;
background: white;
border-radius: 20rpx;
padding: 30rpx 60rpx 30rpx 30rpx;
.item-icon{
position: absolute;
right: 30rpx;
top: 50%;
margin-top: -10px;
}
.item-title{
padding-bottom: 10rpx;
font-size: 34rpx;
font-weight: bold;
color: #333;
@extend .nowrap;
}
.item-time{
font-size: 26rpx;
color: gray;
text{
color: $main-color;
margin-right: 20rpx;
}
}
}
}
</style>

View File

@@ -0,0 +1,110 @@
<template>
<view class="content">
<view class="title">{{title}}</view>
<view class="time"><text>{{categorie}}</text>{{time}}</view>
<view class="text">
<rich-text :nodes="content"></rich-text>
</view>
<!-- 分享 -->
<uni-popup ref="popupShare" type="share" background-color="#fff">
<uni-popup-share title="分享到" @select="select"></uni-popup-share>
</uni-popup>
</view>
</template>
<script>
import { info } from '@/apis/interfaces/notice.js'
export default {
data() {
return {
title : '',
content : '',
time : '',
categorie : '',
id : '',
description : ''
};
},
onLoad(e){
info(e.id).then(res => {
this.id = e.id
this.title = res.title
this.description= res.description
this.time = res.created_at
this.content = res.content.replace(/\<img/gi, '<img style="max-width:100%; height:auto; display:block;"');
this.categorie = res.categories[0].title
}).catch(err => {
uni.showToast({
title: err.message,
icon : 'none'
})
})
},
methods: {
select(e){
switch (e.item.name) {
case 'wxchum':
uni.share({
provider: 'weixin',
scene: 'WXSceneSession',
type: 0,
href: 'https://invite.gongli.vip/articles/' + this.id,
title: '共力生态-' + this.title,
summary: this.description,
imageUrl: 'https://gl-ecological.oss-cn-zhangjiakou.aliyuncs.com/images/2022/06/11/3b7e6e330f465ecbf136d15def1039fd.jpg',
fail(err) {
uni.showToast({
title: err.errMsg,
icon: 'none'
})
}
})
break;
case 'wxcircle':
uni.share({
provider: 'weixin',
scene: 'WXSceneTimeline',
type: 0,
href: 'https://invite.gongli.vip/articles/' + this.id,
summary: '共力生态-' + this.title,
imageUrl: 'https://gl-ecological.oss-cn-zhangjiakou.aliyuncs.com/images/2022/06/11/3b7e6e330f465ecbf136d15def1039fd.jpg',
fail(err) {
uni.showToast({
title: err.errMsg,
icon: 'none'
})
}
})
break;
}
}
},
onNavigationBarButtonTap() {
this.$refs.popupShare.open();
}
}
</script>
<style lang="scss">
.content{
background: white;
min-height: 100vh;
padding: 30rpx;
box-sizing: border-box;
.title{
font-size: 40rpx;
font-weight: bold;
padding: 20rpx 0;
}
.time{
color: gray;
font-size: 28rpx;
padding-bottom: 70rpx;
text{
color: $main-color;
margin-right: 20rpx;
text-align: justify;
}
}
}
</style>

BIN
pages/mission/.DS_Store vendored Normal file

Binary file not shown.

View File

@@ -0,0 +1,111 @@
<template>
<view class="content">
<view class="dt-header">
<view class="title">已领取DT积分</view>
<view class="num">{{glz}}</view>
</view>
<view class="logs-title">账户记录</view>
<block v-if="log.length > 0">
<view class="logs-item" v-for="(item, index) in log" :key="index">
<view class="logs-item-title">{{item.remark}}</view>
<view class="logs-item-time">{{item.created_at}}</view>
<view class="logs-item-price" :class="item.amount > 0 ? 'add': 'remove'">{{item.amount}}</view>
</view>
</block>
<block v-else>
<view class="vertical pages-empty">
<u-empty icon="http://cdn.uviewui.com/uview/empty/list.png" textColor="#999" text="暂无领取记录~" />
</view>
</block>
</view>
</template>
<script>
import { integral } from '@/apis/interfaces/account.js'
export default {
data() {
return {
glz: '0.00',
log: []
};
},
created() {
integral().then(res => {
this.glz = res.glz
this.log = res.lists.data
}).catch(err => {
uni.showToast({
title: err.message,
icon : 'none'
})
})
}
}
</script>
<style lang="scss">
.pages-empty {
height: 50vh;
}
.content{
background: $window-color;
min-height: 100vh;
.dt-header{
background: #e74a45;
padding: $padding*2 $padding $padding*2;
.title{
color: rgba(255, 255, 255, .9);
font-size: 28rpx;
}
.num{
font-weight: bold;
font-size: 60rpx;
padding-top: 10rpx;
color: white;
}
}
// 账户记录
.logs-title{
padding: 0 $padding;
font-weight: bold;
line-height: 90rpx;
color: #333;
font-size: 30rpx;
}
.logs-item{
position: relative;
background: white;
border-radius: $radius;
padding: $padding - 10 $padding;
padding-right: 240rpx;
box-sizing: border-box;
margin: 0 $margin ($margin - 10);
.logs-item-title{
font-weight: bold;
font-size: 30rpx;
line-height: 50rpx;
}
.logs-item-time{
font-size: 28rpx;
line-height: 40rpx;
color: gray;
}
.logs-item-price{
position: absolute;
right: $padding;
top: $padding - 10;
line-height: 90rpx;
width: 180rpx;
text-align: right;
font-weight: bold;
@extend .nowrap;
&.add{
color: #e74a45;
}
&.remove{
color: $text-price;
}
}
}
}
</style>

View File

@@ -0,0 +1,160 @@
<template>
<view class="content">
<view class="dt-header">
<view class="title">已领取商品数量</view>
<view class="num">{{glz}}<span></span></view>
</view>
<view class="logs-title">领取记录</view>
<block v-if="array.length >= 1">
<view style="padding: 0 30rpx;">
<!-- 订单列表 -->
<missionsGoodsItem v-for="(item, arrayIndex) in array" :order-info="item" :key="arrayIndex"
@onBtn="onType" />
<!-- 加载更多 -->
<view class="pages-load">
<u-loadmore :status="status" />
</view>
</view>
</block>
<block v-else>
<view class="vertical order-null">
<u-empty mode="order" icon="http://cdn.uviewui.com/uview/empty/order.png" text="暂无领取记录"
textColor="#999" />
</view>
</block>
</view>
</template>
<script>
import missionsGoodsItem from '@/components/missions-goods-item/index.vue'
import {myPinList} from '@/apis/interfaces/pin'
export default {
components:{
missionsGoodsItem
},
data() {
return {
status: "loading",
glz: '0.00',
array: []
};
},
onLoad() {
this.getOrder()
},
onReachBottom() {
if (this.status === 'loadmore') {
this.page += 1
this.status = 'loading'
this.getOrder()
}
},
methods:{
getOrder() {
myPinList({
page: this.page
}).then(res => {
console.log(res)
if (res.page.current === 1) {
this.array = []
}
let ordersArr = res.data.map(val => {
return {
no: val.order_no,
cover: val.item.cover,
name: val.item.name,
price: val.item.price,
sum: 1,
collage: val.collage,
shop: val.shop,
goods_id: val.item.goods_id,
unit: val.item.unit,
users: val.users,
invite: val.invite,
order: val.order,
url: val.url
}
})
this.array = this.array.concat(ordersArr)
this.status = res.page.has_more ? 'loadmore' : 'nomore'
})
},
onType(item){
console.log(item);
}
}
}
</script>
<style lang="scss">
.pages-empty {
height: 50vh;
}
.content{
background: $window-color;
min-height: 100vh;
.dt-header{
background: #e74a45;
padding: $padding*2 $padding $padding*2;
.title{
color: rgba(255, 255, 255, .9);
font-size: 28rpx;
}
.num{
font-weight: bold;
font-size: 60rpx;
padding-top: 10rpx;
color: white;
span{
font-size:26rpx;
padding-left: 20rpx;
padding-bottom: 10rpx;
font-weight: normal;
}
}
}
// 账户记录
.logs-title{
padding: 0 $padding;
font-weight: bold;
line-height: 90rpx;
color: #333;
font-size: 30rpx;
}
.logs-item{
position: relative;
background: white;
border-radius: $radius;
padding: $padding - 10 $padding;
padding-right: 240rpx;
box-sizing: border-box;
margin: 0 $margin ($margin - 10);
.logs-item-title{
font-weight: bold;
font-size: 30rpx;
line-height: 50rpx;
}
.logs-item-time{
font-size: 28rpx;
line-height: 40rpx;
color: gray;
}
.logs-item-price{
position: absolute;
right: $padding;
top: $padding - 10;
line-height: 90rpx;
width: 180rpx;
text-align: right;
font-weight: bold;
@extend .nowrap;
&.add{
color: #e74a45;
}
&.remove{
color: $text-price;
}
}
}
}
</style>

450
pages/mission/mission.vue Normal file
View File

@@ -0,0 +1,450 @@
<template>
<view class="mission">
<!-- 姓名 头像 已领DT积分 已领商品 -->
<view class="top">
<image class="bg" src="/static/mission/diwen.png" mode="widthFix" />
<view class="userinfo">
<view class="nickname" >{{user.nickname}}</view>
</view>
<view class="avatar" > <image :src="user.avatar" mode="aspectFill" /> </view>
<view class="count">
<view class="count-item" @click="onTab('GetDt')">
<view class="number">{{user.DtScore}} </view>
<view class="des"> 已领DT积分 </view>
</view>
<view class="line"></view>
<view class="count-item" @click="onTab('GetGoods')">
<view class="number">{{user.goodsNum}} </view>
<view class="des"> 已领商品 </view>
</view>
</view>
</view>
<!-- 看视频 得积分 -->
<!--
giftCode:item.me.code, // 任务是否完成 1 已完成 2 未完成
is_gift :item.me.is_gift, // 1已领取 0 未领取
gift_type:item.gift_type.code, //1商品 2 dt 积分
-->
<view class="list-content" v-if="videos.length>0">
<view class="title">
<image class="bind" src="/static/mission/icon-right.png" mode="widthFix" />
<view class="name">看视频得奖励</view>
<image class="bind" src="/static/mission/icon-left.png" mode="widthFix" />
<view class="right-title" @click="change('1')" >
<block v-if="videoHasMore"> <image :class="['change',canRotate0?'rotateChange':'']" src="/static/mission/change.png" mode="widthFix" /> 换一换 </block>
</view>
</view>
<block>
<view class="list" v-for="item in videos" :key="item.task_id">
<image class='icon' src="/static/mission/video.png" mode="widthFix" />
<view class="list-item">
<view class="list-item-left">
<view class="item-title">{{item.title}}<span v-if="item.gift_type && item.gift_type.code == 2">+{{item.attach_gift.price}}</span> </view>
<view class="item-des"> {{item.description}}</view>
</view>
<view class="list-item-right">
<view class="btn" v-if="item.me.code == 0 || item.me.code == 2" @click="goPlay(item.task_id)">去完成</view>
<block v-if="item.me && item.me.code == 1">
<block v-if="item.gift_type && item.gift_type.code == 1">
<view class="btn" v-if="item.me && item.me.is_gift == 0" @click="goAdr(item.task_id)">完善收货</view>
<view class="btn" v-if="item.me && item.me.is_gift == 1" >已完成</view>
</block>
<block v-if="item.gift_type && item.gift_type.code == 2">
<view class="btn">已完成</view>
</block>
</block>
<view class="count" v-if="item.type && item.type.code == 1 "> ({{item.me.number}}/{{item.attach_type.num}}</view>
</view>
</view>
</view>
</block>
</view>
<!-- 做任务 得积分 -->
<!--
giftCode:item.me.code, // 任务是否完成 1 已完成 2完成一半 0未开始
is_gift :item.me.is_gift, // 1已领取 0 未领取
gift_type:item.gift_type.code, //1商品 2 dt 积分
-->
<view class="list-content">
<view class="title" style="margin-top:30rpx;">
<image class="bind" src="/static/mission/icon-right.png" mode="widthFix" />
<view class="name">做任务得积分</view>
<image class="bind" src="/static/mission/icon-left.png" mode="widthFix" />
<view class="right-title" @click="change('2')" >
<block v-if="missionsHasMore">
<image :class="['change',canRotate1?'rotateChange':'']" src="/static/mission/change.png" mode="widthFix" /> 换一换
</block>
</view>
</view>
<block v-if="missions.length>0">
<view class="list" v-for="item in missions" :key="item.task_id">
<image class='icon' src="/static/mission/mission.png" mode="widthFix" />
<view class="list-item">
<view class="list-item-left">
<view class="item-title">{{item.title}}<span v-if="item.gift_type && item.gift_type.code == 2">+{{item.attach_gift.price}}</span> </view>
<view class="item-des"> {{item.description}}</view>
</view>
<view class="list-item-right">
<view class="btn" @click="goWebView(item.task_id)">去完成</view>
<!-- <view class="count">({{item.me.number}}/{{item.attach_type.num}}</view> -->
</view>
</view>
</view>
</block>
</view>
</view>
</template>
<script>
import {list,user} from '@/apis/interfaces/mission.js'
import eventBus from '@/utils/eventBus.js'
export default {
data() {
return {
videos: [],
videoPage: 1,
videoHasMore: true,
missions: [],
missionsPage: 1,
missionsHasMore: true,
canRotate0: false,
canRotate1: false,
user:{},
};
},
onLoad() {
this.getUser();
this.getList(1);
// this.getList(2);
eventBus.$on('played', (data)=> {
let index = this.videos.findIndex((item) => item.task_id == data.task_id);
this.videos[index].me.number = data.number
this.videos[index].me.is_gift = data.is_gift
this.videos[index].me.code = data.code
});
},
destroyed() {
eventBus.$off('played')
},
methods: {
getUser(){
user().then(res=>{
res.base.DtScore = res.DtScore
res.base.goodsNum = res.goodsNum
this.user = res.base
}).catch(err=>{
uni.showToast({
title: err.message,
icon: 'none',
mask: true,
duration: 2000,
})
})
},
goPlay(id) {
uni.navigateTo({
url: '/pages/mission/videoPlay/videoPlay?id=' + id,
})
},
goAdr(id){
uni.navigateTo({
url:'/pages/address/index?task_id='+id
})
},
goWebView(id){
uni.navigateTo({
url: '/pages/mission/webview/webview?id=' + id,
})
},
getList(type) {
let data = {
page: type == 1 ? this.videoPage : this.missionsPage,
type: type,
}
list(data).then(res => {
if (type == 1) {
if (this.videoPage == 1) {
this.videos = [];
}
this.videoHasMore = res.page.has_more;
this.videos = res.data
return;
}
if (type == 2) {
if (this.missionsPage == 1) {
this.missions = [];
}
this.missionsHasMore = res.page.has_more;
this.missions = res.data
return;
}
}).catch(err => {
uni.showToast({
title: err.message,
icon: 'none',
mask: true,
duration: 2000,
})
})
},
change(num) {
switch (num) {
case '1':
this.canRotate0 = true;
if (this.videoHasMore) {
this.videoPage = this.videoPage + 1;
} else {
this.videoPage = 1;
}
this.getList(1);
break;
case '2':
// if(this.videoHasMore){
// this.videoPage = this.videoPage + 1;
// }else{
// this.videoPage = 1;
// }
break;
}
this.close();
},
close() {
setTimeout(() => {
this.canRotate0 = false;
this.canRotate1 = false;
}, 3000)
},
// 跳转已领取的 dt 积分和商品
onTab(it) {
this.$Router.push({
name: it
})
}
}
}
</script>
<style lang="scss">
.top {
width: 100%;
height: 300rpx;
background-color: #e74a45;
position: relative;
padding-top: 140rpx;
margin-bottom: $padding * 5;
// 背景图片
.bg {
position: absolute;
width: 100%;
height: 100%;
bottom: 0;
}
// 用户信息
.userinfo {
color: #fff;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
box-sizing: border-box;
font-size: 40rpx;
font-weight: bold;
.nickname {
padding-bottom: 30rpx;
padding-left: 14rpx;
}
}
// 头像
.avatar {
display: flex;
flex-direction: row;
align-items: center;
justify-content: center;
box-sizing: border-box;
position: relative;
top: 10rpx;
z-index: 2;
image {
width: 160rpx;
height: 160rpx;
border-radius: 50%;
box-shadow: 0 2rpx 20rpx 2rpx rgba(255, 0, 0, 0.3);
border: solid 10rpx rgba(255, 255, 255, 0.8);
background-color: #fff;
}
}
// 积分数量
.count {
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-around;
box-sizing: border-box;
background-color: #fff;
margin: 0 $margin;
padding: $padding*3 $padding $padding $padding;
border-radius: 20rpx;
box-shadow: 0 0 20rpx 4rpx rgba(255, 0, 0, 0.1);
position: relative;
top: -$padding * 2;
.line {
width: 2rpx;
height: 60rpx;
background-color: #cacaca;
}
.count-item {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
box-sizing: border-box;
font-size: 26rpx;
.number {
font-size: 40rpx;
font-weight: bold;
color: #333;
}
.des {
color: #626675;
padding-top: 10rpx;
}
}
}
}
.list-content {
.title {
display: flex;
flex-direction: row;
align-items: center;
justify-content: center;
box-sizing: border-box;
position: relative;
padding: 0 $padding;
.bind {
width: 100rpx;
}
.right-title {
margin-left: $margin * 2;
display: flex;
flex-direction: row;
align-items: center;
justify-content: flex-end;
box-sizing: border-box;
font-size: 26rpx;
color: #626675;
.change {
width: 30rpx;
height: 0;
margin-right: 10rpx;
}
.rotateChange {
animation: fadenum1;
animation-duration: 1s;
}
@keyframes fadenum1 {
100% {
transform: rotate(180deg);
}
}
}
.name {
padding: $padding $padding - 10;
font-size: 34rpx;
font-weight: bold;
color: #454545;
}
}
.list {
padding: 0 $padding;
display: flex;
flex-direction: row;
align-items: center;
justify-content: flex-start;
box-sizing: border-box;
.icon {
width: 60rpx;
height: 0;
}
.list-item {
border-bottom: solid 1rpx #f9f9f9;
flex: 1;
margin-left: $margin;
padding: $padding 0;
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
box-sizing: border-box;
.list-item-left {
flex: 1;
}
.list-item-right {
display: flex;
flex-direction: column;
justify-content: center;
box-sizing: border-box;
align-items: center;
margin-left: $margin;
.btn {
background-color: #e74a45;
color: #fff;
border-radius: 40rpx;
padding: 12rpx $padding;
font-size: 26rpx;
}
.count {
color: #626675;
font-size: 24rpx;
padding-top: 10rpx;
}
}
.item-title {
font-size: 30rpx;
span {
padding-left: $padding - 10;
color: #e74a45;
font-size: 30rpx;
}
}
.item-des {
padding-top: 10rpx;
color: #999;
font-size: 26rpx;
}
}
}
}
</style>

View File

@@ -0,0 +1,162 @@
<template>
<view class="videoContainer">
<view class="currentDownFixed">
<view class="currentDown">
<view class="currentDownItem">
<view>视频</view>
<block>
<view class="line"> </view>
<view> {{duration>0?duration+' 秒后可':'已'}}获得奖励</view>
</block>
</view>
<view class="currentDownItem">
<block v-if="duration>0">
<u-icon :name="muted?'volume-off':'volume'" color='#fff' @click='muted =! muted' />
<view class="line"> </view>
</block>
<view @click="close"> 关闭</view>
</view>
</view>
</view>
<video v-if="src!=''" @timeupdate='timeupdate' class="video" :src="src" :controls='false' autoplay direction='0'
:muted='muted' />
</view>
</template>
<script>
import {
getVideoUrl,
execute,
} from '@/apis/interfaces/mission.js'
import eventBus from '@/utils/eventBus.js'
export default {
data() {
return {
// url: this.$route.query.url,
src: '',
muted: false, // 静音播放
duration: 0,
id: '',
canClose: false,
};
},
onLoad(e) {
this.id = e.id;
getVideoUrl(e.id).then(res => {
this.src = res
}).catch(res => {
uni.showModal({
title: '视频播放出错',
confirmText: '立即返回',
showCancel: false,
success: (res) => {
uni.navigateBack()
}
})
})
},
methods: {
close() {
if (!this.canClose) {
uni.navigateBack()
return;
}
if (this.duration > 0) {
uni.showModal({
title: '暂未获得奖励',
content: ' 是否继续观看视频',
cancelText: '放弃',
confirmText: '继续',
confirmColor: '#34ce98',
cancelColor: '#999',
success: (res) => {
if (res.confirm) {
return;
}
if (res.cancel) {
uni.navigateBack();
return;
}
}
})
} else {
this.executeBtn()
}
},
executeBtn() {
execute(this.id).then(res => {
res.task_id= this.id
eventBus.$emit('played', res);
uni.navigateBack();
}).catch(err => {
console.log(err)
uni.showToast({
title: err.message,
icon: 'none',
duration: 2000,
mask: true,
})
})
},
timeupdate(e) {
this.duration = parseInt(parseInt(e.detail.duration) - parseInt(e.detail.currentTime));
this.canClose = true;
}
},
}
</script>
<style lang="scss">
.videoContainer {
width: 100vw;
height: 100vh;
background-color: #000;
position: relative;
.video {
width: 100%;
height: calc(100% - 200rpx);
}
.currentDownFixed {
width: 100%;
background-color: #000;
color: #fff;
font-size: 28rpx;
height: 160rpx;
padding: var(--status-bar-height) $padding $padding - 10 $padding;
box-sizing: border-box;
.currentDown {
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
box-sizing: border-box;
padding-top: 20rpx;
.currentDownItem {
position: relative;
z-index: 3;
border: solid 1rpx rgba(255, 255, 255, 0.2);
border-radius: 50rpx;
padding: 14rpx $padding+4;
display: flex;
flex-direction: row;
align-items: center;
justify-content: center;
box-sizing: border-box;
.line {
width: 2rpx;
height: 30rpx;
background-color: rgba(255, 255, 255, 0.3);
margin: 0 20rpx;
}
}
}
}
}
</style>

View File

@@ -0,0 +1,39 @@
<template>
<view>
<web-view :src="src" />
</view>
</template>
<script>
import {
getVideoUrl
} from '@/apis/interfaces/mission.js'
import eventBus from '@/utils/eventBus.js'
export default {
data() {
return {
id: '',
src:''
};
},
onLoad(e) {
this.id = e.id;
getVideoUrl(e.id).then(res => {
this.src = res
}).catch(res => {
uni.showModal({
title: '视频播放出错',
confirmText: '立即返回',
showCancel: false,
success: (res) => {
uni.navigateBack()
}
})
})
},
}
</script>
<style lang="scss">
</style>

310
pages/news/detail.vue Normal file
View File

@@ -0,0 +1,310 @@
<template>
<view class="notification">
<view class="notification-block">
<view class="notification-title">
<view class="" style="display: flex;flex-direction: row;">
<image class="answer-img" src="/static/news/news.png" mode="widthFix" />官方客服回复
</view>
<view class="date" v-if="notificationInfo.detail"> {{notificationInfo.detail.created_at}}</view>
</view>
<view class="notification-radiobox">
<view class="answer show"> A : {{notificationInfo.content}}</view>
</view>
</view>
<view class="notification-block">
<view class="notification-title">
我的意见与建议
<view class="date"> {{notificationInfo.created_at}}</view>
</view>
<view class="notification-radiobox">
<view class="notification-radiobox-item" :class="{'show': radioValue === '页面闪退'}">页面闪退</view>
<view class="notification-radiobox-item" :class="{'show': radioValue === '操作体验'}">操作体验</view>
<view class="notification-radiobox-item" :class="{'show': radioValue === '账号问题'}">账号问题</view>
<view class="notification-radiobox-item" :class="{'show': radioValue === '功能异常'}">功能异常</view>
<view class="notification-radiobox-item" :class="{'show': radioValue === '产品建议'}">产品建议</view>
<view class="notification-radiobox-item" :class="{'show': radioValue === '其他问题'}">其他问题</view>
</view>
</view>
<view class="notification-block" v-if="notificationImg.length>0">
<view class="notification-title">上传应用截图({{notificationImg.length}}/8)</view>
<view class="notification-sbutitle">上传出现问题的应用图片</view>
<view class="notification-imgs">
<view class="notification-imgs-item" v-for="(item, index) in notificationImg" :key="index">
<image :src="item" mode="aspectFill" @click="prieve(index)"></image>
</view>
</view>
</view>
<view class="notification-block" v-if="description.length>0">
<view class="notification-title"> 问题说明</view>
<view class="notification-sbutitle">请对您所遇到的问题进行尽可能详细的描述</view>
<view class="notification-textarea">
<textarea maxlength="200" v-model="description" :disabled="true" />
<view class="notification-textarea-size">{{description.length}}/200</view>
</view>
</view>
<view class="notification-block" v-if="mobile.length>0">
<view class="notification-title">联系方式</view>
<input class="notification-input" type="number" :disabled="true" v-model="mobile" maxlength="11"
placeholder="输入手机号码" />
</view>
<!-- 微信客服 -->
<u-modal :show="wechatCode" title="微信客服" confirmColor="#34CE98" :showCancelButton="true" cancelText="关闭"
confirmText="保存二维码" @cancel="wechatCode = false" @confirm="dowQrCode">
<slot>
<view class="wechat-content">
<image class="wechat-qrcode" :src="require('@/static/user/qrCode.png')" mode="widthFix"></image>
<view class="wechat-text">扫描企业微信二维码添加微信客服</view>
</view>
</slot>
</u-modal>
</view>
</template>
<script>
import {
notifications
} from '@/apis/interfaces/versions'
import {
detail
} from '@/apis/interfaces/news'
export default {
data() {
return {
radioValue: "页面闪退",
description: "",
mobile: "",
systemInfo: {},
notificationImg: [],
wechatCode: false,
notificationInfo: {}
}
},
onLoad() {
uni.getSystemInfo({
success: systemRes => {
this.systemInfo = {
brand: systemRes.brand,
models: systemRes.model,
pixel: systemRes.pixelRatio,
width: systemRes.windowWidth,
height: systemRes.windowHeight,
version: systemRes.system,
platform: systemRes.platform,
font_size: systemRes.fontSizeSetting,
client_id: systemRes.deviceId,
}
}
})
detail(this.$Route.query.id).then(res => {
this.notificationInfo = res;
this.radioValue = res.detail.type || ''
this.notificationImg = res.detail.pictures || []
this.description = res.detail.description || ''
this.mobile = res.detail.mobile || ''
}).catch(err => {
uni.showToast({
title: err.message,
icon: 'none',
mask: true,
})
})
},
onNavigationBarButtonTap() {
this.wechatCode = true
},
methods: {
dowQrCode() {
uni.saveImageToPhotosAlbum({
filePath: require('@/static/user/qrCode.png'),
success(res) {
uni.showToast({
title: '二维码已保存到系统相册',
icon: 'none'
})
},
fail(err) {
uni.showToast({
title: err.message,
icon: 'none'
})
}
})
},
prieve(index) {
uni.previewImage({
urls: this.notificationImg,
current:index
});
}
}
}
</script>
<style scoped lang="scss">
.notification-block {
padding: 30rpx;
border-top: solid 20rpx #F8F8F8;
}
.notification-title {
font-size: 34rpx;
font-weight: bold;
line-height: 40rpx;
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
box-sizing: border-box;
.date{
color: grey;
font-size: 26rpx;
font-weight: normal;
}
}
.notification-title text {
color: #e6576b;
padding-left: 5rpx;
}
.notification-radiobox {
display: flex;
flex-wrap: wrap;
margin: 20rpx -10rpx 0;
}
.notification-radiobox-item {
position: relative;
width: calc(33.33% - 20rpx);
display: inline-block;
margin: 10rpx;
background: #F8F8F8;
text-align: center;
line-height: 70rpx;
border-radius: 30rpx;
font-size: 30rpx;
}
.answer {
position: relative;
width: calc(100% - 20rpx);
display: inline-block;
margin: 10rpx;
background: rgba($color: #34ce98, $alpha: 0.1);
text-align: center;
line-height: 70rpx;
border-radius: 10rpx;
font-size: 30rpx;
text-align: left;
padding: 10rpx 20rpx;
}
.notification-radiobox-item.show {
background: #34CE98;
color: white;
}
.notification-imgs {
display: flex;
flex-direction: row;
flex-wrap: wrap;
margin: 10rpx -10rpx 0;
}
.notification-imgs-item {
position: relative;
width: calc(25% - 20rpx);
padding-top: calc(25% - 20rpx);
margin: 20rpx 10rpx 0 10rpx;
}
.notification-imgs-item image {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
border: solid 1rpx #f8f8f8;
}
.notification-sbutitle {
font-size: 28rpx;
padding-top: 10rpx;
color: gray;
}
.notification-textarea {
background: #F8F8F8;
border-radius: 20rpx;
padding: 20rpx;
margin-top: 20rpx;
}
.notification-textarea textarea {
width: 100%;
height: 200rpx;
font-size: 32rpx;
}
.notification-textarea-size {
text-align: right;
font-size: 28rpx;
color: gray;
}
.notification-input {
background: #F8F8F8;
border-radius: 20rpx;
height: 90rpx;
line-height: 90rpx;
margin-top: 20rpx;
font-size: 32rpx;
padding: 0 20rpx;
}
.btn {
padding: 30rpx;
}
.btn button {
height: 90rpx;
line-height: 90rpx;
border-radius: 45rpx;
background: #34CE98;
font-size: 34rpx;
font-weight: bold;
color: white;
border: none;
padding: 0;
}
.btn button:after {
display: none;
}
/* 弹出层 */
.wechat-content {
text-align: center;
padding: 30rpx 0;
}
.wechat-qrcode {
width: 248rpx;
height: 248rpx;
}
.wechat-text {
text-align: center;
font-size: 28rpx;
color: gray;
padding-top: 30rpx;
}
.answer-img {
width: 50rpx;
height: 50rpx;
margin-right: 10rpx;
}
</style>

174
pages/news/index.vue Normal file
View File

@@ -0,0 +1,174 @@
<template>
<view class="news">
<block v-if="lists.length > 0">
<view class="list-item" v-for="(item,index) in lists" :key="index" @click="goUrl(item.notification_id,index)">
<u-badge class="bell_fill_dot" :isDot="item.read_at === ''" type="error" />
<image src="/static/news/news.png" mode="widthFix" />
<view class="list-item-right">
<view class="top">
<view class="title">
<view class="titl"> 系统反馈 </view>
<view class="des">官方</view>
</view>
<view class="date">{{item.created_at}}</view>
</view>
<view class="sub-title">快捷反馈:{{item.content}}</view>
</view>
</view>
</block>
<view class="no-list" v-else>
<u-empty mode="message" icon="http://cdn.uviewui.com/uview/empty/message.png" text="暂无消息~" textColor="#999" />
</view>
</view>
</template>
<script>
import {list,readAll} from '@/apis/interfaces/news.js'
export default {
data() {
return {
lists:[],
type:'FeedbackNotification',
has_more: true,
page: 1,
}
},
onLoad() {
this.getList();
},
onReachBottom() {
if(this.has_more){
this.page = this.page + 1;
this.getList();
} else{
uni.showToast({
title:'没有更多啦~',
icon:'none',
mask:true,
})
}
},
onNavigationBarButtonTap() {
readAll(this.type).then(res=>{
uni.showToast({
title:'全部已读',
icon:"none",
mask:true,
duration:3000
});
this.page = 1;
this.has_more = true;
this.getList();
}).catch(err=>{
uni.showToast({
title:err.message,
icon:"none",
mask:true,
duration:3000
})
})
},
methods: {
goUrl(id,index){
this.lists[index].read_at = '11111'
this.$Router.push({name:'newsDetail',params:{id:id}});
},
getList(){
list(this.type,{page:this.page}).then(res=>{
if(this.page === 1){
this.lists = []
}
this.lists = this.lists.concat(res.data)
this.has_more = res.page.has_more
}).catch(err=>{
uni.showToast({
title:err.message,
icon:"none",
mask:true,
duration:3000
})
})
}
}
}
</script>
<style lang="scss">
.list-item {
padding: $padding - 10 $padding;
display: flex;
flex-direction: row;
align-items: flex-start;
justify-content: center;
box-sizing: border-box;
border-bottom: solid 1rpx #f0f0f0;
image {
width: 100rpx;
height: 100rpx;
}
.list-item-right {
padding-left: $padding - 10;
flex: 1;
.top {
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
box-sizing: border-box;
.title {
display: flex;
flex-direction: row;
align-items: center;
justify-content: center;
box-sizing: border-box;
.titl {
font-size: 32rpx;
font-weight: bold;
}
.des {
margin-left: 10rpx;
border-radius: 6rpx;
border: solid 1rpx #F76260;
font-size: 24rpx;
font-weight: bold;
color: #F76260;
padding: 0 10rpx;
}
}
.date {
font-size: 26rpx;
color: grey;
padding-right: 10rpx;
}
}
.sub-title {
font-size: 26rpx;
color: grey;
padding-top: 10rpx;
display: -webkit-box;
overflow: hidden;
text-overflow: ellipsis;
-webkit-box-orient: vertical;
-webkit-line-clamp: 2;
}
}
}
.no-list {
height: 80vh;
display: flex;
flex-direction: row;
align-items: center;
justify-content: center;
box-sizing: border-box;
}
</style>

View File

@@ -100,7 +100,7 @@
orders({
state: this.tabs[this.index].type,
page: this.page
}).then(res => {
}).then(res => {
if (res.page.current === 1) {
this.array = []
}
@@ -114,7 +114,8 @@
stateText: val.state,
cans: val.can,
shop: val.shop,
goods_id:val.items[0].sku.goods_id
goods_id:val.items[0].sku.goods_id,
unit:val.items[0].sku.unit
}
})
this.array = this.array.concat(ordersArr)
@@ -149,10 +150,8 @@
success: (res) => {
if (res.confirm) {
cancel(orderNo).then(res => {
console.log(res)
let orderIndex = this.array.findIndex(val => val.no === e
.order.no)
console.log(this.index, typeof this.index, orderIndex);
if (this.index == '0') {
this.array[orderIndex].stateText = "已取消";
this.array[orderIndex].cans = {
@@ -208,10 +207,8 @@
success: (res) => {
if (res.confirm) {
sign(orderNo).then(res => {
console.log(res)
let orderIndex = this.array.findIndex(val => val.no === e
.order.no)
console.log(this.index, typeof this.index, orderIndex);
if (this.index == '0') {
this.array[orderIndex].stateText = "已签收";
this.array[orderIndex].cans = {

View File

@@ -6,17 +6,20 @@
</view>
</template>
<script>
<script>
import payKeyboard from '@/components/mi-payKeyboard/mi-payKeyboard.vue'
import eventBus from '../../utils/eventBus.js';
import {
wxPAY,
alPAY,
dtPAY,
collagePAY,
payIndex
} from '@/apis/interfaces/pay'
export default {
components: { payKeyboard },
export default {
components: {
payKeyboard
},
data() {
return {
payNo: "",
@@ -26,8 +29,9 @@
oepnType: '',
canpay: true,
has_transfer_password: true,
password: '',
password: '',
showKeyBoard: false,
type: '',
}
},
mounted() {
@@ -36,7 +40,9 @@
if (this.$Route.query.oepnType === 'order') {
this.oepnType = this.$Route.query.oepnType
}
if (this.$Route.query.type) {
this.type = this.$Route.query.type
}
},
onShow() {
this.payIndex();
@@ -109,23 +115,27 @@
}
},
// 输入正确的回调
enterSuccess(password) {
this.password = password
this.showKeyBoard = false
this.getDTPAY();
},
// 点击[取消] 关闭输入框 的回调
close(){
this.showKeyBoard = false;
this.canpay = true;
// 输入正确的回调
enterSuccess(password) {
this.password = password
this.showKeyBoard = false
this.getDTPAY();
},
// 点击[取消] 关闭输入框 的回调
close() {
this.showKeyBoard = false;
this.canpay = true;
},
// 调用 dt 支付
getDTPAY() {
if (this.canpay) {
this.canpay = false
dtPAY(this.payNo, this.password).then(res => {
this.canpay = false
let requestUrl = dtPAY
if (this.type === 'pin') {
requestUrl = collagePAY
}
requestUrl(this.payNo, this.password).then(res => {
if (res.state === 'warning') {
uni.showModal({
title: '当前DT积分不足',
@@ -162,27 +172,66 @@
}
})
} else {
uni.showModal({
title: '支付成功',
content: '该订单已支付成功',
confirmText: '我的订单',
confirmColor: "#34CE98",
cancelText: '再逛逛',
cancelColor: "#666666",
success: (res) => {
if (res.confirm) {
this.$Router.push({
name: "Order",
params: {
index: 0
},
})
} else {
uni.navigateBack();
}
this.canpay = true
if (this.type === 'pin') {
console.log('pin........', res)
this.canpay = true
if (res.detailId) {
uni.showLoading({
title:'跳转中',
mask:true,
})
setTimeout(() => {
uni.hideLoading()
uni.navigateTo({
url: '/pages/group-book/success/success?id=' + res.detailId
})
}, 2000)
} else {
uni.showModal({
title: '温馨提示',
content: '该订单拼团成功',
confirmText: '查看订单',
confirmColor: "#34CE98",
cancelText: '再逛逛',
cancelColor: "#666666",
success: (res) => {
if(res.confirm){
uni.navigateTo({
url:'/pages/group-book/list/list'
})
} if(res.cancel){
uni.navigateBack({
delta:2
});
}
}
})
}
})
} else {
uni.showModal({
title: '支付成功',
content: '该订单已支付成功',
confirmText: '我的订单',
confirmColor: "#34CE98",
cancelText: '再逛逛',
cancelColor: "#666666",
success: (res) => {
if (res.confirm) {
this.$Router.push({
name: "Order",
params: {
index: 0
},
})
} else {
uni.navigateBack();
}
this.canpay = true
}
})
}
}
}

View File

@@ -1,50 +1,47 @@
<template>
<view class="rank">
<view class="rank_top">
<view class="rank_top_left">
<image class="rank_title" src="../../static/rank/rank_txt.png" mode="widthFix" />
<view class="rank_sub_title" @click="toHelp">
共力家族 周会员推荐
<image src="/static/rank/help.png" mode="widthFix" />
</view>
<view class="rank_sub_title" @click="toHelp"> 共力家族 周会员邀请 <image src="/static/rank/help.png" mode="widthFix" /> </view>
</view>
<image class="rank_top_right" src="../../static/rank/rank.png" mode="widthFix" />
</view>
<u-sticky bgColor="#34CE98">
<u-tabs :list="tabs" lineColor="white" :activeStyle="{color: 'white', fontWeight: 'bold', fontSize: '15px'}" :inactiveStyle="{color: 'rgba(255,255,255,.6)', fontSize: '15px'}" :itemStyle="{'height': '50px'}" @click="onTabs" />
</u-sticky>
<view class="rank_type">
<view :class="['rank_type_item',type === '1'?'rank_type_item_active':'']" @click="changeType('1')"> 上周加成榜</view>
<view :class="['rank_type_item',type === '2'?'rank_type_item_active':'']" @click="changeType('2')">本周推荐榜</view>
</view>
<view class="rank_update_time" v-if="lists.length > 0">
<view class="title"> 加成{{type === '1'?'结束':'生效'}}倒计时 : </view>
<u-count-down :time="end_timestamp" format="DD:HH:mm:ss" autoStart millisecond @change="onChange">
<view class="rank_update_time" v-if="type != '3' && type != '4' && end_timestamp">
<view class="title"> 加成{{type === '1'?'结束':'生效'}}倒计时:</view>
<u-count-down ref="countDown" format="DD:HH:mm:ss" :time="end_timestamp" :autoStart="false"
@change="downTime">
<view class="time">
<view class="time__item">
<view class="time__item_no">{{ timeData.days }} </view>
</view>
<view class="time__item">
<view class="time__item_no">{{ timeData.hours>9?timeData.hours:'0'+timeData.hours}}</view>
</view>
<view class="time__item">
<view class="time__item_no">{{ timeData.minutes>9?timeData.minutes:'0'+timeData.minutes}}</view>
</view>
<view class="time__item">
<view class="time__item_no">{{ timeData.seconds>9?timeData.seconds:'0'+timeData.seconds}}</view>
</view>
<view class="time__item"> <text class="time__item_no">{{ timeData.days > 9 ? timeData.days: '0' + timeData.days }} </text> </view>
<view class="time__item"> <text class="time__item_no">{{ timeData.hours > 9 ? timeData.hours : '0' + timeData.hours}}</text> </view>
<view class="time__item"> <text class="time__item_no">{{ timeData.minutes > 9 ? timeData.minutes : '0' + timeData.minutes}}</text> </view>
<view class="time__item"> <text class="time__item_no">{{ timeData.seconds > 9 ? timeData.seconds : '0' + timeData.seconds}}</text> </view>
</view>
</u-count-down>
</view>
<block v-if="type =='3' || type == '4'">
<view class="rank_update_time">
<view :class="['title', 'sub-title',current?'actived':'']" @click="getCurrent('1')">
<image v-if="current" src="/static/rank/mo.png" mode="widthFix" />
<image v-else src="/static/rank/mo-null.png" mode="widthFix" /> 本月排行
</view>
<view :class="['title', 'sub-title',!current?'actived':'']" @click="getCurrent('2')">
<image v-if="!current" src="/static/rank/mo.png" mode="widthFix" />
<image v-else src="/static/rank/mo-null.png" mode="widthFix" />上月排行
</view>
</view>
</block>
<view class="list">
<block v-if="lists.length>0">
<view class="list_item" v-for="(item,index) in lists" :keys='index'>
<view class="no">
<image v-if="index < 3" class="image" :src="'/static/rank/rank-'+(index+1)+'.png'"
mode="widthFix" />
<image v-if="index < 3" class="image" :src="'/static/rank/rank-'+(index+1)+'.png'" mode="widthFix" />
<view v-else class="txt"> {{index + 1}} </view>
</view>
<view class="user_info">
@@ -55,7 +52,7 @@
</view>
<view class="tuijian">
<view class="num"> {{item.number}}</view>
<view class="title">推荐会员</view>
<view class="title">{{type === '4'?'邀请用户':'邀请会员'}}</view>
</view>
</view>
</view>
@@ -63,45 +60,76 @@
<block v-else>
<view class="vertical pages-empty">
<u-empty icon="http://cdn.uviewui.com/uview/empty/list.png" textColor="#999"
:text="type === '1'?'上周无加成数据':'当前暂无推荐数据'">
:text="type === '1'?'上周无加成数据':'当前暂无邀请数据'">
</u-empty>
</view>
</block>
</view>
</view>
</template>
<script>
import {
week,
week_mul
week_mul,
total,
totaluser,
monthVip,
monthUser
} from '@/apis/interfaces/rank.js'
export default {
data() {
return {
end_timestamp: 0,
lists: [],
timeData: {},
type: "1", // 1 加成榜 2推荐榜
timeData: {
days: 0,
hours: 0,
minutes: 0,
seconds: 0
},
type: '1', // 1加成榜 2邀请榜 3会员邀请 4用户邀请
page_id: '',
tabs: [{
name: '上周加成榜',
type: '1'
},
{
name: '本周邀请榜',
type: '2'
},
{
name: '会员邀请榜',
type: '3'
},
{
name: '用户邀请榜',
type: '4'
},
],
current: true,
listsInfo:{},// current last
}
},
onShow() {
this.getList();
},
methods: {
onChange(e) {
this.timeData = e
},
changeType(type) {
if (this.type !== type) {
this.lists = [];
this.type = type;
uni.showLoading({})
this.getList();
onTabs(e) {
if (this.type == e.type) {
return
}
if (this.$refs.countDown) {
this.$refs.countDown.pause()
}
uni.showLoading({
title: '加载中...'
})
this.type = e.type
this.lists = []
this.getList()
},
downTime(e) {
this.timeData = e
},
toHelp() {
uni.navigateTo({
@@ -109,17 +137,31 @@
})
},
getList() {
let urlRequest = ''
if (this.type === '1') {
urlRequest = week_mul
} else {
} else if (this.type === '2') {
urlRequest = week
} else if (this.type === '4') {
urlRequest = monthUser
} else {
urlRequest = monthVip
}
urlRequest().then(res => {
this.lists = res.rand;
if (this.type === '1' || this.type === '2') {
this.lists = res.rand;
this.end_timestamp = res.end_timestamp * 1000;
this.$nextTick(() => {
if (this.$refs.countDown) {
this.$refs.countDown.start()
}
})
} else if (this.type === '3' || this.type === '4') {
this.current = true;
this.listsInfo = res.rank;
this.lists = res.rank.current;
}
this.page_id = res.page_id;
this.end_timestamp = res.end_timestamp * 1000;
uni.hideLoading()
}).catch(err => {
uni.showToast({
@@ -128,11 +170,34 @@
mask: true
})
})
},
getCurrent(id){
if(id === '1'){
this.current = true;
}else{
this.current = false;
}
if(this.current){
this.lists = this.listsInfo.current
}else{
this.lists = this.listsInfo.last
}
}
},
onHide() {
try {
if (this.$refs.countDown) {
this.$refs.countDown.pause()
}
} catch (err) {
uni.showToast({
title: err,
icon: 'none'
})
}
}
}
</script>
<style lang="scss">
.rank {
.rank_top {
@@ -143,6 +208,7 @@
box-sizing: border-box;
background-color: #34CE98;
padding: 50rpx 30rpx 40rpx 30rpx;
border-bottom: solid 1rpx rgba($color: #fff, $alpha: 0.6);
.rank_top_left {
display: flex;
@@ -179,42 +245,6 @@
}
}
.rank_type {
display: flex;
flex-direction: row;
align-items: center;
justify-content: center;
box-sizing: border-box;
background-color: #26b398;
.rank_type_item {
flex: 1;
text-align: center;
padding: 40rpx;
font-size: 32rpx;
font-weight: 400;
color: rgba($color: #fff, $alpha: 0.6);
}
.rank_type_item_active {
position: relative;
color: white;
&::after {
content: '';
border-bottom: 20rpx solid white;
border-right: 16rpx solid transparent;
border-left: 16rpx solid transparent;
position: absolute;
bottom: 0;
left: 50%;
margin-left: -20rpx;
}
}
}
.rank_update_time {
display: flex;
flex-direction: row;
@@ -223,54 +253,54 @@
box-sizing: border-box;
padding: 50rpx 30rpx;
width: 100%;
border-bottom: 20rpx solid $window-color;
.title {
font-size: 28rpx;
font-weight: normal;
color: #34CE98;
}
.time {
padding-left: 20rpx;
.sub-title {
flex: 1;
font-size: 28rpx;
display: flex;
flex-direction: row;
align-items: center;
justify-content: center;
box-sizing: border-box;
color: #333;
image {
width: 36rpx !important;
margin-right: 20rpx;
}
}
.title {
font-size: 28rpx;
font-weight: normal;
color: #999;
padding-right: 10rpx;
}
.actived {
color: #34CE98;
}
.time {
display: flex;
.time__item {
display: flex;
flex-direction: row;
align-items: center;
justify-content: center;
box-sizing: border-box;
font-size: 28rpx;
color: #34CE98;
}
.time__item_no {
display: flex;
flex-direction: row;
align-items: center;
justify-content: center;
box-sizing: border-box;
background-color: #34CE98;
color: white;
min-width: 50rpx;
min-height: 50rpx;
border-radius: 4rpx;
margin: 0 16rpx;
font-size: 36rpx;
font-weight: bold;
padding: 2rpx 10rpx;
}
.time__item_no {
background: #34CE98;
border-radius: 5rpx;
color: white;
width: 50rpx;
display: inline-block;
text-align: center;
margin: 0 10rpx;
}
}
}
.list {
border-top: 30rpx solid #f9f9f9;
padding: 30rpx;
.list_item {
@@ -328,7 +358,7 @@
.nickname {
font-size: 30rpx;
color: #333;
max-width: 200rpx;
max-width: 200rpx;
font-weight: bold;
overflow: hidden;
text-overflow: ellipsis;

View File

@@ -8,7 +8,8 @@
<image :src="goodsInfo.cover" mode="aspectFill" class="good-img" />
<view class="item--content">
<view class="title">{{goodsInfo.goods_name}}</view>
<view class="sub_title" v-if="goodsInfo.shop">{{goodsInfo.shop.name}}</view>
<view class="sub_title" v-if="goodsInfo.shop">{{goodsInfo.shop.name}}</view>
<view class="unit" v-if="goodsInfo.unit"> {{goodsInfo.unit}} </view>
<view class="price">{{goodsInfo.price || '0'}}
<view class="price-type">
<text> DT积分</text>
@@ -22,7 +23,7 @@
<view class="sales-item" @click="goSales('refund')">
<view class="sales-item-left">
<image class="icon"
src="http://storage.zh.shangkelian.cn/images/2022/01/11/9093c59ea5d513008926ac4233c20992.png"
src="/static/icon/icon-back.png"
mode="aspectFill" />
<view class="sales-title">退货</view>
</view>
@@ -38,7 +39,7 @@
<view class="sales-item" @click="goSales('exchange')">
<view class="sales-item-left">
<image class="icon"
src="http://storage.zh.shangkelian.cn/images/2022/01/11/9093c59ea5d513008926ac4233c20992.png"
src="/static/icon/icon-exchange.png"
mode="aspectFill" />
<view class="sales-title">换货</view>
</view>
@@ -182,6 +183,11 @@
font-size: 26rpx;
padding-top: 6rpx;
// @extend .ellipsis-1;
}
&>.unit{
color:#999;
font-size: 26rpx;
padding-top: 10rpx;
}
&>.price {
@@ -248,8 +254,8 @@
font-weight: bold;
.icon {
width: 60rpx;
height: 60rpx;
width: 46rpx;
height: 46rpx;
border-radius: 50%;
margin-right: $margin - 10;
}

View File

@@ -3,7 +3,6 @@
<view class="service-content">
<view class="service"> 本次售后服务将由<span>DT生态平台</span>为您提供服务 </view>
</view>
<view class="plane">
<view class="plane-state">
<uni-steps class="steps" active-color='#fff' :active="process.index" deactive-color='#fff'
@@ -11,19 +10,19 @@
<view class="title" v-if="refundInfo.state"> {{refundInfo.state.remark}}</view>
</view>
</view>
<view class="goods-item">
<image :src="goodsInfo.cover" mode="aspectFill" class="good-img" />
<view class="item--content">
<view class="title">{{goodsInfo.goods_name}}</view>
<view class="sub_title" v-if="goodsInfo.shop">{{goodsInfo.shop.name}}</view>
<view class="sub_title" v-if="goodsInfo.shop">{{goodsInfo.shop.name}}</view>
<view class="unit" v-if="goodsInfo.unit">
{{goodsInfo.unit}}
</view>
<view class=" number">
{{goodsInfo.qty}}
</view>
</view>
</view>
<view class="total">
<view class="total-item grey">
申请金额<text>{{refundInfo.refund_total || '0.00'}} DT</text>
@@ -86,11 +85,21 @@
<view class="info-item">
<view class="label">申请时间</view>
<view class="content">{{refundInfo.created_at}}</view>
</view>
</view>
</view>
<view class="info-item">
<view class="label">店铺名称</view>
<view class="content" v-if="refundInfo.shop">{{refundInfo.shop.name || '-'}}</view>
</view>
<view class="info-item">
<view class="label">联系电话</view>
<view class="content" v-if="refundInfo.shop">{{refundInfo.shop.mobile || '-'}}</view>
</view>
</view>
<view class="call-phone">
<view class="call-phone-btn" @click="onCallPhone">联系商家</view>
</view>
</view>
</template>
</template>
<script>
import {
@@ -120,7 +129,7 @@
methods: {
refund() {
refundsInfo(this.$Route.query.id).then(res => {
this.goodsInfo = res.items[0];
this.goodsInfo = res.items[0];
this.refundInfo = res;
this.type = res.type.state;
this.process = res.process
@@ -160,13 +169,37 @@
})
}
})
}
},
onCallPhone(){
uni.makePhoneCall({
phoneNumber: this.refundInfo.shop.mobile,
complete(err) {
console.log(err)
}
})
}
}
}
</script>
<style lang="scss">
.history {}
.history {}
.call-phone{
position: fixed;
bottom: 0;
left: 0;
right: 0;
@extend .ios-bottom;
background: white;
&-btn{
text-align: center;
line-height: 100rpx;
font-size: 30rpx;
color: $main-color;
}
}
.applyBtn {
width: 70%;
@@ -184,8 +217,9 @@
.afterSales {
background-color: #f9f9f9;
min-height: 100vh;
min-height: 100vh;
padding-bottom: calc(env(safe-area-inset-bottom) + 130rpx);
padding-bottom: calc(env(safe-area-inset-bottom) + 130rpx);
.plane {
width: 100%;
@@ -198,11 +232,12 @@
box-sizing: border-box;
padding: 60rpx $padding 40rpx $padding;
.title {
font-size: 40rpx;
.title {
width: 100%;
font-size: 26rpx;
color: #FFFFFF;
font-weight: bold;
margin-top: 20rpx;
margin-top: 20rpx;
text-align: center;
}
}
@@ -318,6 +353,11 @@
font-size: 26rpx;
padding-top: 6rpx;
// @extend .ellipsis-1;
}
.unit{
color:#999;
font-size: 26rpx;
padding-top: 10rpx;
}
&>.price {

View File

@@ -23,7 +23,13 @@
<view class="order--flex" @click="$Router.push({ name: 'StoreGoods', params: {id: item.items[0].goods_id}})">
<image class="order--cover" :src="item.items[0].cover" mode="aspectFill"></image>
<view class="order--title">{{item.items[0].goods_name}}</view>
<view class="order--title">
{{item.items[0].goods_name}}
<view class="unit" v-if="item.items[0].sku.unit">
{{item.items[0].sku.unit}}
</view>
</view>
<view class="order--count">
<view class="order--price">{{item.items[0].price}}<text>DT积分</text></view>
<view class="order--sum">{{item.items[0].qty}}</view>
@@ -85,7 +91,7 @@
getOrder() {
refunds({
page: this.page
}).then(res => {
}).then(res => {
if (res.page.current === 1) {
this.array = []
}
@@ -234,6 +240,11 @@
padding-left: $margin;
font-size: 28rpx;
line-height: 40rpx;
}
.unit{
color:#999;
font-size: 26rpx;
padding-top: 10rpx;
}
.order--count {

View File

@@ -5,21 +5,24 @@
<view class="item--content">
<view class="title">{{goodsInfo.goods_name}}</view>
<view class="sub_title" v-if="goodsInfo.shop">{{goodsInfo.shop.name}}</view>
<view class="unit" v-if="goodsInfo.unit">
{{goodsInfo.unit}}
</view>
<view class=" number">
{{goodsInfo.qty}}
</view>
</view>
</view>
<view class="total">
<view class="total-item grey">
申请金额<text>{{refund_total || '0.00'}} DT</text>
</view>
<view class="total-item">
合计退款<text>{{refund_total|| '0.00'}} DT</text>
</view>
</view>
</view>
<view class="total">
<view class="total-item grey">
申请金额<text>{{refund_total || '0.00'}} DT</text>
</view>
<view class="total-item">
合计退款<text>{{refund_total|| '0.00'}} DT</text>
</view>
</view>
<view class="logistics--logs">
<block v-for="(log, logIndex) in logs" :key="logIndex">
<view class="item">
@@ -39,14 +42,14 @@
data() {
return {
logs: [],
goodsInfo: {},
refund_total:''
goodsInfo: {},
refund_total: ''
}
},
onLoad() {
refundsLogs(this.$Route.query.id).then(res => {
this.logs = res.logs
this.goodsInfo = res.refund.items[0]
this.logs = res.logs
this.goodsInfo = res.refund.items[0]
this.refund_total = res.refund.refund_total
}).catch(err => {
uni.showToast({
@@ -76,8 +79,8 @@
$radius: 10rpx;
.RefundHistory {
padding: $padding;
min-height: 100vh;
padding: $padding;
min-height: 100vh;
background-color: #f9f9f9;
}
@@ -124,8 +127,8 @@
border-radius: $radius $radius 0 0;
z-index: 9;
padding: $margin;
overflow: hidden;
margin-top: 30rpx;
overflow: hidden;
margin-top: 30rpx;
min-height: 50vh;
.item {
@@ -214,6 +217,12 @@
// @extend .ellipsis-1;
}
.unit {
color: #999;
font-size: 26rpx;
padding-top: 10rpx;
}
&>.price {
padding-top: 10rpx;
display: flex;
@@ -250,31 +259,31 @@
}
}
}
.total {
background-color: #fff;
padding: 0 $padding $padding $padding;
border-top: solid 2rpx #f9f9f9;
font-size: 28rpx;
color: #333;
.total-item {
flex: 1;
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
box-sizing: border-box;
padding-top: $padding;
text {
font-size: 32rpx;
}
}
.grey {
color: #666;
}
}
.total {
background-color: #fff;
padding: 0 $padding $padding $padding;
border-top: solid 2rpx #f9f9f9;
font-size: 28rpx;
color: #333;
.total-item {
flex: 1;
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
box-sizing: border-box;
padding-top: $padding;
text {
font-size: 32rpx;
}
}
.grey {
color: #666;
}
}
</style>

View File

@@ -10,6 +10,9 @@
<view class="item--content">
<view class="title">{{goodsInfo.goods_name}}</view>
<view class="sub_title" v-if="goodsInfo.shop">{{goodsInfo.shop.name}}</view>
<view class="unit" v-if="goodsInfo.unit">
{{goodsInfo.unit}}
</view>
<view class="price">{{goodsInfo.price || '0'}}
<view class="price-type">
<text> DT积分</text>
@@ -22,7 +25,7 @@
<view class="block info-box">
<view class="info-item">
<view class="label">申请类型</view>
<view class="nowrap info-item-title" >我要退款无需退货</view>
<view class="nowrap info-item-title">我要退款无需退货</view>
</view>
<view class="info-item">
<view class="label">申请原因</view>
@@ -82,8 +85,8 @@
params = {
title: this.ttext,
remark: this.remark,
pictures: [],
type:1,
pictures: [],
type: 1,
};
if (this.ttext === '请选择申请原因') {
uni.showToast({
@@ -179,6 +182,7 @@
}
}
}
.goods-item {
background-color: #Fff;
width: 100%;
@@ -219,6 +223,12 @@
// @extend .ellipsis-1;
}
&>.unit {
color: #999;
font-size: 26rpx;
padding-top: 10rpx;
}
&>.price {
padding-top: 10rpx;
display: flex;

View File

@@ -8,7 +8,10 @@
<image :src="goodsInfo.cover" mode="aspectFill" class="good-img" />
<view class="item--content">
<view class="title">{{goodsInfo.goods_name}}</view>
<view class="sub_title" v-if="goodsInfo.shop">{{goodsInfo.shop.name}}</view>
<view class="sub_title" v-if="goodsInfo.shop">{{goodsInfo.shop.name}}</view>
<view class="unit" v-if="goodsInfo.unit">
{{goodsInfo.unit}}
</view>
<view class="price">{{goodsInfo.price || '0'}}
<view class="price-type">
<text> DT积分</text>
@@ -242,6 +245,11 @@
font-size: 26rpx;
padding-top: 6rpx;
// @extend .ellipsis-1;
}
&>.unit{
color:#999;
font-size: 26rpx;
padding-top: 10rpx;
}
&>.price {

BIN
pages/store/.DS_Store vendored Normal file

Binary file not shown.

View File

@@ -1,337 +1,476 @@
<template>
<view class="content">
<!-- address -->
<block v-if="address != ''">
<view class="block address" @click="$Router.push({name: 'Address'})">
<uni-icons class="address-icon location" type="location-filled" size="24" color="#34CE98"></uni-icons>
<uni-icons class="address-icon arrows" type="right" size="20" color="#999"></uni-icons>
<view class="user"><text>{{address.name}}</text>{{address.mobile}}</view>
<view class="city">{{address.full_address}}</view>
</view>
</block>
<block v-else>
<view class="block address-new" @click="$Router.push({name: 'Address'})">
<uni-icons class="icon" type="plus" size="26" color="#34CE98"></uni-icons>添加收货地址
</view>
</block>
<!-- 订单产品 -->
<view class="block goods-box">
<block v-for="(item, index) in goodsInfo" :key="index">
<view class="goods-item">
<image class="order-cover" :src="item.items[0].cover" mode="aspectFill"></image>
<view class="order-title">
<view class="title"> {{item.items[0].title}}</view>
<view class="subtitle" v-if="item.items[0] && item.items[0].value"> {{item.items[0].value}} </view>
</view>
<view class="order-count">
<view class="order-price">{{item.items[0].price}}<text class="type">DT积分</text></view>
</view>
</view>
</block>
</view>
<!-- 订单信息 -->
<view class="block info-box">
<view class="info-item">
<view class="label">购买数量</view>
<uni-number-box class="info-number" :value="qty" :min="1" :max="999" @change="numberChange" />
</view>
<view class="info-item">
<view class="label">配送方式</view>
<view class="nowrap">快递</view>
</view>
<view class="info-item">
<view class="label">配送费用</view>
<view class="nowrap">{{freight == 0 ? '免费': freight}}</view>
</view>
</view>
<view class="block info-box">
<view class="info-item">
<view class="label">订单备注</view>
<textarea class="info-textarea" v-model="remark" placeholder="请输入备注"></textarea>
</view>
</view>
<!-- footer -->
<view class="order-footer">
<view class="total">总计<text>{{total}} <text class="type">DT积分</text></text></view>
<button class="btn" @click="subOrder">确认订单</button>
</view>
</view>
</template>
<script>
import { buy, verify } from '@/apis/interfaces/store'
export default {
data() {
return {
qty : 1,
goodsInfo : [],
total : 0,
freight : 0,
address : "",
remark : "",
canApply :true
};
},
onShow(){
if(JSON.stringify(this.$store.getters.getAddress) !== '{}') this.address = this.$store.getters.getAddress
},
mounted() {
this.getBuy()
},
methods:{
getBuy(){
buy({
goods_sku_id: this.$Route.query.skuId,
qty: this.qty
}).then(res => {
this.address = res.address
this.freight = res.freight
this.total = res.total
this.goodsInfo = res.detail
}).catch(err => {
uni.showToast({
title: err.message,
icon : 'none'
})
})
},
numberChange(e){
this.qty = e
this.getBuy()
},
// 确认订单
subOrder(){
if(this.address === ""){
uni.showModal({
title : '提示',
content : '暂未添加收货地址,无法下单',
showCancel : true,
confirmText : '添加',
success : res => {
if(res.confirm){
this.$Router.push({name: 'Address'})
}
}
})
return
}
if(this.canApply){
this.canApply = false;
verify({
goods_sku_id: this.$Route.query.skuId,
qty : this.qty,
address_id : this.address.address_id,
remark : this.remark || ''
<template>
<view class="content">
<!-- address -->
<block v-if="address != ''">
<view class="block address" @click="$Router.push({name: 'Address'})">
<uni-icons class="address-icon location" type="location-filled" size="24" color="#34CE98"></uni-icons>
<uni-icons class="address-icon arrows" type="right" size="20" color="#999"></uni-icons>
<view class="user"><text>{{address.name}}</text>{{address.mobile}}</view>
<view class="city">{{address.full_address}}</view>
</view>
</block>
<block v-else>
<view class="block address-new" @click="$Router.push({name: 'Address'})">
<uni-icons class="icon" type="plus" size="26" color="#34CE98"></uni-icons>添加收货地址
</view>
</block>
<!-- 订单产品 -->
<view class="block goods-box">
<block v-for="(item, index) in goodsInfo" :key="index">
<view class="goods-item">
<image class="order-cover" :src="item.items[0].cover" mode="aspectFill"></image>
<view class="order-title">
<view class="title"> {{item.items[0].title}}</view>
<view class="subtitle" v-if="item.items[0] && item.items[0].value"> {{item.items[0].value}}
</view>
</view>
<view class="order-count">
<view class="order-price">{{item.items[0].price}}<text class="type">DT积分</text></view>
</view>
</view>
</block>
</view>
<!-- 订单信息 -->
<view class="block info-box">
<view class="info-item">
<view class="label">购买数量</view>
<uni-number-box class="info-number" :value="qty" :min="1" :max="limit" @change="numberChange" />
</view>
<view class="info-item">
<view class="label">配送方式</view>
<view class="nowrap">快递</view>
</view>
<view class="info-item">
<view class="label">配送费用</view>
<view class="nowrap">{{freight == 0 ? '免费': freight}}</view>
</view>
</view>
<view class="block info-box">
<view class="info-item">
<view class="label">订单备注</view>
<textarea class="info-textarea" v-model="remark" placeholder="请输入备注"></textarea>
</view>
</view>
<!-- footer -->
<view class="order-footer">
<view class="total">总计<text>{{total}} <text class="type">DT积分</text></text></view>
<button class="btn" @click="subOrder">确认订单</button>
</view>
</view>
</template>
<script>
import {
buy,
buyPin,
verify,
collages,
} from '@/apis/interfaces/store'
export default {
data() {
return {
qty: 0,
goodsInfo: [],
total: 0,
freight: 0,
address: "",
remark: "",
canApply: true,
limit:0,
type: '', // 是否为空
};
},
onShow() {
if (JSON.stringify(this.$store.getters.getAddress) !== '{}') this.address = this.$store.getters.getAddress
},
onLoad() {
this.qty = this.$Route.query.qty;
if (this.$Route.query.type === 'pin') {
this.type = 'pin'
}
this.getBuy()
},
methods: {
getBuy() {
console.log(this.type === 'pin')
if (this.type == 'pin') {
let data = {
goods_sku_id: this.$Route.query.skuId,
collage_id:this.$Route.query.collageid || '',
}
buyPin(data).then(res => {
this.address = res.address
this.freight = res.freight
this.total = res.total
this.goodsInfo = res.detail
this.limit = res.limit
}).catch(err => {
uni.showModal({
title: '温馨提示',
content: err.message,
showCancel: false,
confirmColor: '#34CE98',
cancelText: '知道了',
success: (res) => {
uni.navigateBack({})
}
})
})
} else {
buy({
goods_sku_id: this.$Route.query.skuId,
qty: this.qty
}).then(res => {
this.$store.commit('setAddress', {})
this.$Router.replace({
name: 'Pay',
params: {
orderNo: res.order_no,
price : res.total,
coins : res.coins,
}
})
this.canApply = true
}).catch(err=>{
this.canApply = true
})
}else{
this.canApply = true
}
}
}
}
</script>
<style lang="scss" scoped>
.content{
background: $window-color;
min-height: 100vh;
overflow: hidden;
padding-bottom: $padding + 80;
box-sizing: border-box;
}
.block{
background: white;
margin: $margin;
border-radius: $radius;
}
// 地址管理
.address{
position: relative;
padding: $padding 80rpx $padding 90rpx;
font-size: $title-size-lg;
.user{
font-size: $title-size;
line-height: 40rpx;
color: $text-gray;
text{
color: black;
max-width: 200rpx;
display: inline-block;
margin-right: $margin/2;
}
}
.city{
padding-top: $padding/2;
font-size: $title-size-sm;
color: $text-gray;
line-height: 36rpx;
}
.address-icon{
position: absolute;
top: 50%;
&.location{
margin-top: -26rpx;
left: $margin - 10;
}
&.arrows{
margin-top: -20rpx;
right: $margin - 10;
}
}
}
.address-new{
padding: $padding;
text-align: center;
height: 90rpx;
line-height: 90rpx;
color: $main-color;
.icon{
vertical-align: middle;
margin-bottom: 8rpx;
margin-right: 10rpx;
}
}
// 订单列表
.goods-item{
display: flex;
align-items: center;
padding: $padding;
.order-cover{
vertical-align: top;
width: 128rpx;
height: 128rpx;
}
.order-title{
flex: 1;
padding-left: $margin;
// line-height: 40rpx;
.title{
font-size: 28rpx;
@extend .ellipsis;
text-align: left;
}
.subtitle{
font-size: 26rpx;
color: #666;
padding-top: 10rpx;
}
}
.order-count{
text-align: right;
padding-left: $margin;
line-height: 40rpx;
.order-price{
font-size: 32rpx;
font-weight: bold;
color: $text-price;
&>text{
font-size: 24rpx;
}
}
.type{
font-size: 22rpx;
padding-left: 6rpx;
}
.order-sum{
font-size: $title-size-sm;
color: $text-gray;
}
}
}
// 订单信息
.info-box{
.info-item{
position: relative;
padding: $padding $padding $padding 200rpx;
font-size: $title-size-m;
min-height: 40rpx;
text-align: right;
.label{
position: absolute;
left: $margin;
top: $margin;
color: $text-gray;
}
.info-textarea{
height: 120rpx;
width: 100%;
text-align: left;
font-size: $title-size-m;
}
&::after{
position: absolute;
left: $margin;
right: $margin;
content: " ";
height: 1rpx;
bottom: 0;
background: $border-color;
}
&:last-child::after{
display: none;
}
}
}
// footer
.order-footer{
position: fixed;
bottom: 0;
left: 0;
right: 0;
padding: $padding;
background: white;
border-radius: $radius $radius 0 0;
box-shadow: 0 0 10rpx 10rpx rgba($color: #000000, $alpha: .02);
z-index: 99;
display: flex;
.total{
line-height: 80rpx;
font-size: $title-size-lg;
font-weight: bold;
width: calc(100% - 300rpx - #{$margin});
color: $text-gray;
font-weight: normal;
@extend .nowrap;
text{
color: $text-price;
font-size: $title-size-lg;
font-weight: bold;
}
.type{
font-size: 22rpx;
padding-left: 6rpx;
}
}
.btn{
margin-left: $margin;
width: 300rpx;
height: 80rpx;
padding: 0;
line-height: 80rpx;
font-size: $title-size-lg;
border-radius: 40rpx;
background: $main-color;
color: white;
font-weight: bold;
&::after{
display: none;
}
}
}
console.log(res)
this.address = res.address
this.freight = res.freight
this.total = res.total
this.goodsInfo = res.detail
this.limit = res.limit
}).catch(err => {
uni.showModal({
title: '温馨提示',
content: err.message,
showCancel: false,
confirmColor: '#34CE98',
cancelText: '知道了',
success: (res) => {
uni.navigateBack({})
}
})
})
}
},
numberChange(e) {
this.qty = e
this.getBuy()
},
// 确认订单
subOrder() {
if (this.address === "") {
uni.showModal({
title: '提示',
content: '暂未添加收货地址,无法下单',
showCancel: true,
confirmText: '添加',
success: res => {
if (res.confirm) {
this.$Router.push({
name: 'Address'
})
}
}
})
return
}
if (this.canApply) {
this.canApply = false;
if (this.type == 'pin'){
collages({
goods_sku_id: this.$Route.query.skuId,
collage_id:this.$Route.query.collageid || '',
address_id: this.address.address_id,
remark: this.remark || ''
}).then(res => {
console.log(res)
this.$store.commit('setAddress', {})
this.$Router.replace({
name: 'Pay',
params: {
orderNo: res.order_no,
price: res.total,
coins: res.coins,
type:'pin'
}
})
this.canApply = true
}).catch(err => {
this.canApply = true
uni.showToast({
title: err.message,
icon: "none",
mask: true,
duration: 2000
})
})
}else{
verify({
goods_sku_id: this.$Route.query.skuId,
qty: this.qty,
address_id: this.address.address_id,
remark: this.remark || ''
}).then(res => {
console.log(res)
if (res.order_no === '') {
uni.showModal({
title: ' 温馨提示',
content: '领取商品成功',
confirmColor: '#34CE98',
confirmText: ' 查看订单',
cancelColor: '#999',
cancelText: '返回首页',
success: (res) => {
if (res.confirm) {
uni.navigateTo({
url: '/pages/order/index?index=0'
})
}
if (res.cancel) {
uni.reLaunch({
url: '/pages/store/index'
})
}
}
})
} else {
this.$store.commit('setAddress', {})
this.$Router.replace({
name: 'Pay',
params: {
orderNo: res.order_no,
price: res.total,
coins: res.coins,
}
})
}
this.canApply = true
}).catch(err => {
this.canApply = true
uni.showToast({
title: err.message,
icon: "none",
mask: true,
duration: 2000
})
})
}
} else {
this.canApply = true
}
}
}
}
</script>
<style lang="scss" scoped>
.content {
background: $window-color;
min-height: 100vh;
overflow: hidden;
padding-bottom: $padding + 80;
box-sizing: border-box;
}
.block {
background: white;
margin: $margin;
border-radius: $radius;
}
// 地址管理
.address {
position: relative;
padding: $padding 80rpx $padding 90rpx;
font-size: $title-size-lg;
.user {
font-size: $title-size;
line-height: 40rpx;
color: $text-gray;
text {
color: black;
max-width: 200rpx;
display: inline-block;
margin-right: $margin/2;
}
}
.city {
padding-top: $padding/2;
font-size: $title-size-sm;
color: $text-gray;
line-height: 36rpx;
}
.address-icon {
position: absolute;
top: 50%;
&.location {
margin-top: -26rpx;
left: $margin - 10;
}
&.arrows {
margin-top: -20rpx;
right: $margin - 10;
}
}
}
.address-new {
padding: $padding;
text-align: center;
height: 90rpx;
line-height: 90rpx;
color: $main-color;
.icon {
vertical-align: middle;
margin-bottom: 8rpx;
margin-right: 10rpx;
}
}
// 订单列表
.goods-item {
display: flex;
align-items: center;
padding: $padding;
.order-cover {
vertical-align: top;
width: 128rpx;
height: 128rpx;
}
.order-title {
flex: 1;
padding-left: $margin;
// line-height: 40rpx;
.title {
font-size: 28rpx;
@extend .ellipsis;
text-align: left;
}
.subtitle {
font-size: 26rpx;
color: #666;
padding-top: 10rpx;
}
}
.order-count {
text-align: right;
padding-left: $margin;
line-height: 40rpx;
.order-price {
font-size: 32rpx;
font-weight: bold;
color: $text-price;
&>text {
font-size: 24rpx;
}
}
.type {
font-size: 22rpx;
padding-left: 6rpx;
}
.order-sum {
font-size: $title-size-sm;
color: $text-gray;
}
}
}
// 订单信息
.info-box {
.info-item {
position: relative;
padding: $padding $padding $padding 200rpx;
font-size: $title-size-m;
min-height: 40rpx;
text-align: right;
.label {
position: absolute;
left: $margin;
top: $margin;
color: $text-gray;
}
.info-textarea {
height: 120rpx;
width: 100%;
text-align: left;
font-size: $title-size-m;
}
&::after {
position: absolute;
left: $margin;
right: $margin;
content: " ";
height: 1rpx;
bottom: 0;
background: $border-color;
}
&:last-child::after {
display: none;
}
}
}
// footer
.order-footer {
position: fixed;
bottom: 0;
left: 0;
right: 0;
padding: $padding;
background: white;
border-radius: $radius $radius 0 0;
box-shadow: 0 0 10rpx 10rpx rgba($color: #000000, $alpha: .02);
z-index: 99;
display: flex;
.total {
line-height: 80rpx;
font-size: $title-size-lg;
font-weight: bold;
width: calc(100% - 300rpx - #{$margin});
color: $text-gray;
font-weight: normal;
@extend .nowrap;
text {
color: $text-price;
font-size: $title-size-lg;
font-weight: bold;
}
.type {
font-size: 22rpx;
padding-left: 6rpx;
}
}
.btn {
margin-left: $margin;
width: 300rpx;
height: 80rpx;
padding: 0;
line-height: 80rpx;
font-size: $title-size-lg;
border-radius: 40rpx;
background: $main-color;
color: white;
font-weight: bold;
&::after {
display: none;
}
}
}
</style>

848
pages/store/goods(pt).vue Normal file
View File

@@ -0,0 +1,848 @@
<template>
<view>
<!-- 产品封面 -->
<view class="goods-swiper">
<swiper :indicator-dots="false" @change="current = $event.detail.current + 1">
<swiper-item v-for="(item, index) in goods.pictures" :key="index">
<view class="swiper-cover">
<image :src="item" mode="aspectFill" />
</view>
</swiper-item>
</swiper>
<view class="swiper-pages">
{{current}}/{{goods.pictures.length}}
</view>
</view>
<!-- 详情 -->
<view class="main">
<view class="title"> {{goods.name}} </view>
<view class="sub-title">{{goods.description}}</view>
<view class="box-flex">
<view class="price">
{{goods.price.show}}<text>DT积分</text>
</view>
<view class="sales" v-if="goods.skus">库存量{{goods.skus[0].stock}}</view>
<!-- <view class="sales" v-if="goods.skus && !goods.is_active">库存量{{goods.skus[0].stock}}</view> -->
<!-- <view class="_pin" v-if="goods.is_active">
<view class="_has" v-if="goods.active.count>0">
<image src="/static/book/fire.png" mode="widthFix" class="fire" /> 已拼{{goods.active.count}}
</view>
<view class="tuan">{{goods.active.number}}人团</view>
</view> -->
</view>
<view class="unit" v-if="goods.skus && goods.skus[0].unit !== ''" @click="open()">
<span> 规格 : {{selectSkusValues.unit_text}}</span>
<uni-icons type="right" color="#cacaca" />
</view>
<!-- <view class="unit" v-if="goods.skus && goods.skus[0].unit !== '' && !goods.is_active" @click="open()">
<span>规格:{{selectSkusValues.unit_text}}</span>
<uni-icons type="right" color="#cacaca" />
</view> -->
<!-- <view class="is_active" v-if="goods.is_active && actives.length>0">
<view class="title" v-if="actives.length > 2">
这些人刚刚拼单成功可参与拼单
<span @click="getMorePin = true">查看更多
<uni-icons type="right" color="#cacaca" />
</span>
</view>
<view class="title" v-if="actives.length <= 2">
{{actives.length}}人正在拼单可参与拼单
</view>
<view class="content">
<block v-for="(item,index) in actives" :key="index">
<view class="content-item" v-if="index < 2">
<view class="info">
<u-avatar-group :urls="item.urls" size="34" gap="0.6" class="avatar-group" />
<view class="nickname"> {{item.name}}</view>
</view>
<view class="btn">去拼单</view>
</view>
</block>
</view>
</view> -->
<!-- 店铺信息 -->
<view class="shopInfo" @click="toShop(goods.shop.shop_id)" v-if="goods.shop">
<view class="shopInfo-title-left">
<image class="shop-logo" :src="goods.shop.cover" mode="aspectFill" />
<view class="shop-title">
<view class="shop-titl">{{goods.shop.name}}</view>
<view> 店铺评分:
<span class='no'>5.0</span>
<text style="padding-left: 20rpx;">
服务态度:
<span class='no'>5.0</span>
</text>
</view>
</view>
</view>
<view class="shopInfo-title-right">全部商品 {{goods.shop.goods_count || 0}}
<uni-icons type="right" color="grey" />
</view>
</view>
<view class="imgs">
<block v-for="(item, index) in goods.content" :key="index">
<image :src="item" mode="widthFix" />
</block>
</view>
</view>
<!-- 立即购买 -->
<view class="footer">
<view @click="toShop(goods.shop.shop_id)" class=" shop">
<uni-icons type="shop" size="26" color="grey" />店铺
</view>
<button type="default" hover-class="none" @click="buy">立即购买</button>
</view>
<!-- 更多拼单弹窗 -->
<!-- <u-popup :show="getMorePin" :round="10" mode="center" @close="close" :closeable='true' zIndex="1229930">
<view class="getPinTitle"> 可参与拼单 </view>
<scroll-view scroll-y="true" class="getPinList">
<view class="content">
<block v-for="(item,index) in actives" :key="index">
<view class="content-item">
<view class="info">
<u-avatar-group :urls="item.urls" size="34" gap="0.6" class="avatar-group" />
<view class="nickname"> {{item.name}}</view>
</view>
<view class="btn">去拼单</view>
</view>
</block>
</view>
</scroll-view>
</u-popup> -->
<!-- 多规格弹窗 -->
<u-popup :show="skuShow" :round="10" mode="bottom" @close="close" @open="open">
<scroll-view class="skuView" scroll-y="true">
<view class="goods-info">
<image class="goods-cover" :src="selectSkusValues.cover" mode="aspectFill" />
<view class="baseInfo">
<view class="money"> {{selectSkusValues.price}}<span>DT积分</span> </view>
<view class="shop-name" v-if="goods.shop"> {{goods.shop.name}} </view>
<view class="sku-text"> 商品规格{{selectSkusValues.unit_text}} </view>
<view class="stock" v-if="selectSkusValues.stock>0"> 剩余库存{{selectSkusValues.stock}} </view>
<view class="stock" v-else> 当前商品库存不足</view>
</view>
</view>
<view class="sku" v-for="(item,index) in specs" :key="item.spec_id">
<view class="sku-title">{{item.name}}</view>
<view class="sku-list">
<block v-for="it in item.values" :keys='it.value_id'>
<view :class="['sku-item',specselect[index] == it.value_id ? 'sku-active':'']"
@click="clickSkus(index,it.value_id)">
{{it.value}}
</view>
</block>
</view>
</view>
<view class="buy-number">
<view class="buy-title">数量</view>
<uni-number-box :min="1" :max="selectSkusValues.stock" :disabled="selectSkusValues.stock == 0"
@change="qty = $event" />
</view>
<button class="now-buy" type="default" hover-class="none" @click="buy2(selectSkusValues)">立即购买</button>
</scroll-view>
</u-popup>
</view>
</template>
<script>
import {
goods
} from '@/apis/interfaces/store'
import userAuth from '@/public/userAuth'
export default {
data() {
return {
current: 1,
goods: {
pictures: [],
name: "",
description: "",
content: [],
price: {
show: 0
}
},
skus: [],
skuid: '',
skuShow: false,
specs: [],
unitText: '',
specselect: [],
selectSkusValues: {},
qty: 1,
// actives: [{
// urls: [
// 'https://cdn.uviewui.com/uview/album/1.jpg',
// 'https://cdn.uviewui.com/uview/album/2.jpg'
// ],
// name: "洛基洛基、张三张三张三张三张三张三"
// }
// ],
// getMorePin: false,
};
},
mounted() {
this.getGoods()
},
methods: {
getGoods() {
let id = this.$Route.query.id
goods(id).then(res => {
this.goods = res
this.specs = res.specs
this.skus = res.skus
this.skuid = res.skus[0].sku_id
this.unitText = res.skus[0].unit_text
this.specselect = res.skus[0].unit.split('|')
this.selectSkusValues = res.skus[0]
})
},
open() {
this.skuShow = true
this.qty = 1;
},
close() {
this.skuShow = false
this.getMorePin = false
this.qty = 1;
// this.specselect = this.skus[0].unit.split('|')
// this.selectSkusValues = this.skus[0]
},
clickSkus(index, id) {
this.skuid = ''
this.specselect[index] = id;
let newlist = []
let str = ''
for (var i in this.specselect) {
if (i == index) {
newlist.push(id);
if (i == 0) {
str = id
} else {
str = str + '|' + id
}
} else {
newlist.push(this.specselect[i])
if (i == 0) {
str = this.specselect[i]
} else {
str = str + '|' + this.specselect[i]
}
}
}
for (var i in this.skus) {
if (this.skus[i].unit == str) {
this.selectSkusValues = this.skus[i];
break;
}
}
this.specselect = newlist
},
buy() {
if (this.$store.state.token === '') {
const Auth = new userAuth()
Auth.Login()
return
}
if (this.goods.type === 2) {
this.open();
return
}
this.goUrl();
},
buy2(value) {
let {
sku_id,
stock
} = value;
if (stock > 0) {
this.skuid = sku_id;
this.goUrl()
} else {
uni.showToast({
title: '当前商品库存不足',
icon: 'none',
mask: true,
duration: 2000
})
}
},
goUrl() {
this.$Router.push({
name: 'StoreBuy',
params: {
skuId: this.skuid,
qty: this.qty
}
})
this.close()
},
toShop(id) {
this.$Router.push({
name: 'ShopDetail',
params: {
ShopId: id
}
})
},
}
}
</script>
<style lang="scss">
.goods-swiper {
position: relative;
width: 100%;
padding-top: 110%;
background: $window-color;
&>swiper {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
.swiper-cover {
width: 100%;
height: 100%;
image {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
}
}
}
.swiper-pages {
position: absolute;
bottom: 20rpx;
left: 0;
right: 0;
z-index: 9;
line-height: 90rpx;
text-align: center;
color: white;
font-size: $title-size-m;
text-shadow: 0 5rpx 5rpx rgba($color: #000000, $alpha: .02);
}
}
// 详情
.main {
position: relative;
z-index: 9;
margin-top: -20rpx;
background: white;
border-radius: $radius $radius 0 0;
box-shadow: 0 0 10rpx 10rpx rgba($color: #000000, $alpha: .02);
padding-bottom: ($padding*2) + 90;
.hr {
position: relative;
min-height: 1rpx;
margin: 0 $margin;
text-align: center;
text {
position: relative;
z-index: 1;
color: $text-gray;
font-size: $title-size-m;
background: white;
padding: 0 $padding;
}
&::after {
content: " ";
background: $border-color;
width: 100%;
height: 1rpx;
position: absolute;
left: 0;
top: 50%;
}
}
.title {
padding: $padding;
font-weight: bold;
font-size: $title-size + 14;
display: flex;
flex-direction: row;
align-items: center;
justify-content: flex-start;
flex-wrap: wrap;
box-sizing: border-box;
}
.sub-title {
padding: 0 $padding;
font-size: $title-size-m;
color: $text-gray;
}
.box-flex {
padding: $padding;
display: flex;
justify-content: space-between;
align-items: center;
.price {
font-weight: bold;
color: $text-price;
font-size: $title-size + 10;
text {
font-size: 60%;
margin-left: 10rpx;
}
}
.sales {
font-size: $title-size-m;
color: $text-gray;
}
._pin {
font-size: 26rpx;
display: flex;
flex-direction: row;
align-items: center;
justify-content: flex-start;
box-sizing: border-box;
color: $text-gray;
._has {
display: flex;
flex-direction: row;
align-items: center;
justify-content: flex-start;
box-sizing: border-box;
color: #d81e06;
background-color: rgba($color: $text-price, $alpha: 0.1);
padding: 4rpx 10rpx;
border-radius: 30rpx;
image {
width: 24rpx;
height: 24rpx;
margin-right: 10rpx;
}
}
.tuan {
margin-left: $margin;
}
}
}
.unit {
padding: 30rpx;
font-size: $title-size;
color: #333;
border-top: solid 20rpx #f9f9f9;
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
box-sizing: border-box;
}
.is_active {
border-top: solid 20rpx #f9f9f9;
.title {
font-size: 30rpx;
color: #333;
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
box-sizing: border-box;
border-bottom: solid 1rpx #f9f9f9;
span {
font-size: 26rpx;
color: #666;
font-weight: normal;
}
}
.content {
padding: 0 $padding;
.content-item {
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
box-sizing: border-box;
font-size: 28rpx;
padding-bottom: $padding - 10;
padding-top: $padding - 10;
border-bottom: solid 1rpx #f9f9f9;
.info {
display: flex;
flex-direction: row;
align-items: center;
justify-content: flex-start;
box-sizing: border-box;
overflow: hidden;
.avatar-group {
margin-right: 30rpx;
}
.nickname {
width: 300rpx;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
}
.btn {
background-color: $main-color;
color: white;
padding: 6rpx 20rpx;
border-radius: 10rpx;
}
}
}
}
.imgs {
image {
vertical-align: top;
width: 100%;
}
}
.shopInfo {
border-top: solid $padding #f9f9f9;
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
box-sizing: border-box;
width: 100%;
padding: $padding $padding - 10;
border-bottom: solid 10rpx #f9f9f9;
.shopInfo-title-left {
width: 500rpx;
display: flex;
flex-direction: row;
align-items: center;
justify-content: flex-start;
box-sizing: border-box;
.shop-logo {
width: 100rpx;
height: 100rpx;
border-radius: 10rpx;
border: solid 1rpx #f9f9f9;
}
.shop-title {
display: flex;
flex-direction: column;
align-items: flex-start;
justify-content: flex-start;
box-sizing: border-box;
font-size: 26rpx;
margin-left: $margin;
color: #999;
width: 370rpx;
.no {
color: $text-price;
padding-left: 4rpx;
}
.shop-titl {
font-size: 34rpx;
color: #333;
font-weight: bold;
margin-bottom: 6rpx;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
width: 100%;
}
}
}
.shopInfo-title-right {
display: flex;
flex-direction: row;
align-items: center;
justify-content: center;
box-sizing: border-box;
font-size: 26rpx;
color: #222;
}
}
}
// 购买
.footer {
position: fixed;
bottom: 0;
left: 0;
right: 0;
padding: $padding;
z-index: 98;
background: white;
display: flex;
flex-direction: row;
align-items: center;
justify-content: center;
box-sizing: border-box;
// linear-gradient(to top, white 86%, rgba(255,255,255,.0))
.shop {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
box-sizing: border-box;
font-size: 24rpx;
color: $text-gray;
}
button {
background: $main-color;
margin-left: 60rpx;
flex: 1;
color: white;
border-radius: $radius-lg;
height: 90rpx;
line-height: 90rpx;
font-weight: bold;
font-size: $title-size;
&::after {
display: none;
}
}
}
.getPinTitle {
text-align: center;
font-size: 30rpx;
color: #333333;
font-weight: bold;
padding: $padding - 10 0;
border-bottom: solid 1rpx #f9f9f9;
position: absolute;
top: 0;
width: 100%;
background-color: #fff !important;
border-radius: 20rpx 20rpx 0 0;
z-index: 1000000000000000;
}
.getPinList {
width: 80vw;
max-height: 60vh;
color: $text-color;
position: relative;
.content {
padding: 0 $padding;
padding-top: $padding * 3;
.content-item {
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
box-sizing: border-box;
font-size: 28rpx;
padding-bottom: $padding - 10;
padding-top: $padding - 10;
border-bottom: solid 1rpx #f9f9f9;
.info {
display: flex;
flex-direction: row;
align-items: center;
justify-content: flex-start;
box-sizing: border-box;
overflow: hidden;
.avatar-group {
margin-right: 30rpx;
}
.nickname {
width: 240rpx;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
}
.btn {
background-color: $main-color;
color: white;
padding: 6rpx 20rpx;
border-radius: 10rpx;
}
}
}
}
// 规格弹窗
.skuView {
min-height: 30vh;
max-height: 60vh;
padding: $padding + 10 $padding;
color: $text-color;
box-sizing: border-box;
// 商品信息
.goods-info {
display: flex;
flex-direction: row;
align-items: center;
justify-content: center;
box-sizing: border-box;
border-bottom: solid 1rpx #f9f9f9;
padding-bottom: 20rpx;
.goods-cover {
width: 200rpx;
height: 200rpx;
border-radius: 20rpx;
}
.baseInfo {
flex: 1;
padding-left: $padding;
box-sizing: border-box;
.money {
font-size: $title-size + 14;
font-weight: bold;
color: $text-price;
display: flex;
flex-direction: row;
align-items: center;
justify-content: flex-start;
box-sizing: border-box;
span {
font-weight: normal;
font-size: $title-size-m - 4;
padding-left: 10rpx;
padding-top: 12rpx;
display: inline-block;
}
}
.shop-name {
background: linear-gradient(to right, rgba(255, 255, 255, 0), rgba($color: $text-price, $alpha: 0.5));
display: inline-block;
padding: 4rpx 20rpx 4rpx 0;
color: #71440b;
font-size: $title-size-m - 2;
}
.sku-text {
font-size: $title-size-m - 2;
padding-top: 10rpx;
color: $text-gray;
}
.stock {
font-size: $title-size-m - 2;
padding-top: 6rpx;
color: $text-gray;
}
}
}
.buy-number {
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
box-sizing: border-box;
padding: $padding + 20 0 $padding 0;
.buy-title {
font-size: 32rpx;
font-weight: bold;
}
}
// 规格
.sku {
.sku-title {
font-size: 32rpx;
font-weight: bold;
padding-top: 30rpx;
}
.sku-list {
display: flex;
flex-direction: row;
align-items: center;
justify-content: flex-start;
box-sizing: border-box;
flex-wrap: wrap;
.sku-item {
padding: 10rpx 30rpx;
border: solid 1rpx #f9f9f9;
margin-right: 20rpx;
margin-top: 20rpx;
border-radius: 40rpx;
background-color: #f9f9f9;
font-size: 30rpx;
min-width: 70rpx;
text-align: center;
}
.sku-active {
background-color: rgba($color: $main-color, $alpha: 0.2);
color: $main-color;
font-weight: bold;
}
}
}
.now-buy {
background-color: #34ce98;
color: #fff;
border: none;
margin-top: $margin;
}
}
</style>

File diff suppressed because it is too large Load Diff

View File

@@ -1,382 +1,566 @@
<template>
<view class="content">
<!-- swiper -->
<view class="swiper">
<view class="swiper-box">
<swiper autoplay @change="swiperCount = $event.detail.current">
<swiper-item v-for="(item, index) in banners" :key="index">
<image :src="item.cover" mode="aspectFill"></image>
</swiper-item>
</swiper>
<view class="swiper-pages">
<block v-for="(item, index) in banners" :key="index">
<text class="pages-item" :class="{'show':swiperCount === index}"></text>
</block>
</view>
</view>
</view>
<!-- 健康产品分类 -->
<u-scroll-list class="classify-box" indicatorColor="#ddd" indicatorActiveColor="#34CE98">
<view v-for="(item, index) in goodTabs" :key="index" class="classify-item" @click="$Router.push({name: 'StoreList', params: {id: item.category_id, title: item.name}})">
<view class="classify-item-nav">
<image class="classify-item-cover" :src="item.cover"></image>
<view class="classify-item-title">{{item.name}}</view>
</view>
</view>
</u-scroll-list>
<!-- 每日上新 -->
<view class="new-box">
<view class="title">上新精选<text class="title-des"> | 精品上新新品推荐</text></view>
<view class="news">
<view class="news-item" v-for="(item, index) in newGood" :key="index" @click="$Router.push({ name: 'StoreGoods', params: {id: item.goods_id}})">
<view class="news-cover">
<image :src="item.cover" mode="aspectFill"></image>
</view>
<view class="news-title nowrap">{{item.name}}</view>
<view class="news-price nowrap">{{item.price.price_min}} <text>DT积分</text></view>
</view>
</view>
</view>
<template>
<view class="content">
<!-- swiper -->
<view class="swiper">
<view class="swiper-box">
<swiper autoplay @change="swiperCount = $event.detail.current">
<swiper-item v-for="(item, index) in banners" :key="index" @click="goBook(item)">
<image :src="item.cover" mode="aspectFill"></image>
</swiper-item>
</swiper>
<view class="swiper-pages">
<block v-for="(item, index) in banners" :key="index">
<text class="pages-item" :class="{'show':swiperCount === index}"></text>
</block>
</view>
</view>
</view>
<!-- 健康产品分类 -->
<u-scroll-list class="classify-box" indicatorColor="#ddd" indicatorActiveColor="#34CE98">
<view v-for="(item, index) in goodTabs" :key="index" class="classify-item"
@click="$Router.push({name: 'StoreList', params: {id: item.category_id, title: item.name}})">
<view class="classify-item-nav">
<image class="classify-item-cover" :src="item.cover"></image>
<view class="classify-item-title">{{item.name}}</view>
</view>
</view>
</u-scroll-list>
<!-- 线下商家 -->
<view class="offline-box">
<view class="title">推荐店铺 <view class="more"><text class="title-des"> | 您身边的优质体验店</text> <text class="more-txt" @click="$Router.push({name: 'ShopList'})">更多></text></view></view>
<view class="card-box">
<block v-for="(item, index) in shops" :key="index">
<view class="card-box-item" style="{'backgrond': #FFF}" v-if="index < 4" @click="$Router.push({name: 'ShopDetail', params: {ShopId: item.shop_id}})">
<view class="card-title">{{item.name}}</view>
<view class="card-subtitle"> 优质店铺 </view>
<view class="card-btn">前往体验</view>
<image class="card-cover" :src="item.cover" mode="aspectFill" />
</view>
</block>
</view>
</view>
<!-- 推荐品类 -->
<!-- <view class="card-box">
<block v-for="(item, index) in meals" :key="index">
<view class="card-box-item" :style="{'backgrond': item.color}" @click="$Router.push({name: 'StoreMeals', params: {id: item.meal_id}})">
<view class="card-title">{{item.title}}</view>
<view class="card-subtitle">{{item.subtitle}}</view>
<image class="card-cover" :src="item.cover" mode="aspectFill"></image>
</view>
</block>
</view> -->
<!-- goods -->
<view class="goods-box">
<oct-goods
:lists="goodsArr"
priceType="DT"
color="#e6576b"
@onGoods="$Router.push({ name: 'StoreGoods', params: {id: $event.goods_id}})"
/>
<!-- <u-loadmore status="loading" /> -->
</view>
</view>
</template>
<script>
import { mall } from "@/apis/interfaces/store"
export default {
data() {
return {
swiperCount : 0,
banners : [],
goodTabs : [],
newGood : [],
goodsArr : [],
meals : [],
shops : [],
};
},
mounted(){
this.getMall()
},
methods:{
getMall(){
mall().then(res => {
this.banners = res.banners
this.goodsArr = res.goods
this.newGood = res.news
this.goodTabs = res.categories
this.meals = res.meals
this.shops = res.shops
uni.stopPullDownRefresh()
})
}
},
onPullDownRefresh() {
this.getMall()
},
onNavigationBarButtonTap() {
this.$Router.push({name: 'StoreSearch'})
}
}
</script>
<style lang="scss">
.content{
background: $window-color;
}
// 商城列表
.goods-box{
padding-bottom: $padding;
&>.title{
padding: $padding $padding 0;
font-size: $title-size-lg;
color: $text-color;
font-weight: bold;
margin-bottom: -$margin/2;
}
}
// 商城分类
.classify-box{
.classify-item{
padding: 0 10rpx;
&:last-child{
padding-right: $padding;
}
&:first-child{
padding-left: $padding;
}
&-nav{
text-align: center;
width: 138rpx;
}
&-cover{
width: 86rpx;
height: 86rpx;
border-radius: 50%;
vertical-align: top;
margin-bottom: $margin/2;
}
&-title{
line-height: 40rpx;
font-size: $title-size-sm;
color: $text-color;
}
}
}
// 卡片推荐
.card-box{
padding: $padding $padding - 10;
padding-bottom: 0;
display: flex;
flex-wrap: wrap;
&-item{
margin: 0 10rpx;
width: calc(50% - 20rpx);
padding: $padding;
border-radius: $radius;
box-sizing: border-box;
position: relative;
.card-title{
font-size: $title-size-lg;
font-weight: bold;
color: $text-color;
line-height: 40rpx;
width: calc(100% - 80rpx);
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.card-subtitle{
font-size: 22rpx;
color: $text-gray;
// line-height: 40rpx;
min-height: 20rpx;
@extend .nowrap;
}
.card-cover{
width: 80rpx;
height: 80rpx;
position: absolute;
border-radius: 50%;
right: $margin;
top: $margin;
}
}
&-item:nth-child(1){
background: #fef2ae;
}
&-item:nth-child(2){
background: #c9ead9;
}
}
// 上新精选
.new-box{
padding: 0 $margin;
border-radius: $radius;
// padding: $padding - 10;
.title{
font-size: $title-size-lg;
color: $text-color;
font-weight: bold;
padding-bottom: 10rpx;
.title-des{
font-size: 24rpx !important;
padding-left: 10rpx;
color: $text-gray-m;
font-weight: normal;
}
}
.news{
margin: $margin/2 -10rpx 0;
display: flex;
.news-item{
margin: 0 10rpx;
width: calc(25% - 20rpx);
.news-cover{
position: relative;
width: 100%;
padding-top: 100%;
background-color: white;
border-radius: $radius-lg;
overflow: hidden;
image{
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
}
}
.news-title{
margin-top: $margin/2;
font-size: $title-size-sm;
text-align: center;
color: $text-color;
line-height: 40rpx;
}
.news-price{
text-align: center;
font-size: $title-size-sm;
font-weight: bold;
color: $text-price;
line-height: 40rpx;
text{
margin-left: 6rpx;
font-size: 70%;
}
}
}
}
}
.offline-box{
.title{
font-size: $title-size-lg;
color: $text-color;
font-weight: bold;
margin-top: $margin;
margin-left: $margin;
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
box-sizing: border-box;
.more{
flex: 1;
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
box-sizing: border-box;
padding-right: $padding;
.more-txt{
font-size: 24rpx;
color: $text-gray;
font-weight: normal;
}
}
}
.card-btn{
font-size: 22rpx;
color: #fff;
padding: 4rpx 20rpx;
border-radius: 20rpx;
background-color: $text-price;
display: inline-block;
}
.card-box {
// &-item{
// background: #fff !important;
// }
&-item:nth-child(1){
background: #fef2ae;
background: rgba($color: #fef2ae, $alpha:.5);
}
&-item:nth-child(2){
background: #c9ead9;
background: rgba($color: #c9ead9, $alpha:.5);
}
&-item:nth-child(3){
margin-top: $padding - 8;
background: #bde0ff;
background: rgba($color: #bde0ff, $alpha:.5);
}
&-item:nth-child(4){
margin-top: $padding - 8;
background: rgba($color: #ffd9e1, $alpha:.5);
}
}
.card-cover{
width: 100rpx;
height: 100rpx;
position: absolute;
right: $margin;
top: $margin;
}
.title-des{
font-size: 24rpx;
padding-left: 10rpx;
color: $text-gray-m;
font-weight: normal;
}
<!-- 拼团广告图 -->
<!-- <view class="collage" v-if="collage_banner!=''">
<image @click="goCollage" :src="collage_banner" mode="widthFix" />
</view> -->
<!-- 每日上新 -->
<view class="new-box">
<view class="title">上新精选<text class="title-des"> | 精品上新新品推荐</text></view>
<view class="news">
<view class="news-item" v-for="(item, index) in newGood" :key="index"
@click="$Router.push({ name: 'StoreGoods', params: {id: item.goods_id}})">
<view class="news-cover">
<image :src="item.cover" mode="aspectFill"></image>
</view>
<view class="news-title nowrap">{{item.name}}</view>
<view class="news-price nowrap">{{item.price.price_min}} <text>DT积分</text></view>
</view>
</view>
</view>
<!-- VIP换购 -->
<view class="new-box" style="margin-top: 30rpx;" v-if="vips.length>0">
<view class="title">VIP换购 <view class="more"><text class="title-des"> | 百款商品任意换购</text> <text
class="more-txt" @click="$Router.push({name: 'VipList'})">更多 ></text></view>
</view>
<view class="news">
<view class="news-item" v-for="(item, index) in vips" :key="index"
@click="$Router.push({ name: 'StoreGoods', params: {id: item.goods_id}})">
<view class="news-cover">
<image :src="item.cover" mode="aspectFill"></image>
<view class="tags"> VIP </view>
</view>
<view class="news-title nowrap">{{item.name}}</view>
<view class="news-price nowrap">{{item.price.price_min}} <text>DT积分</text></view>
<!-- <view class="news-price nowrap through">{{item.original_price}} <text>DT积分</text></view> -->
</view>
</view>
</view>
<!-- 线下商家 -->
<view class="offline-box">
<view class="title">推荐店铺 <view class="more"><text class="title-des"> | 您身边的优质体验店</text> <text
class="more-txt" @click="$Router.push({name: 'ShopList'})">更多 ></text></view>
</view>
<view class="card-box">
<block v-for="(item, index) in shops" :key="index">
<view class="card-box-item" style="{'backgrond': #FFF}" v-if="index < 4"
@click="$Router.push({name: 'ShopDetail', params: {ShopId: item.shop_id}})">
<view class="card-title">{{item.name}}</view>
<view class="card-subtitle"> {{item.type.code == 2 ? 'VIP优质店铺' : '优质店铺'}} </view>
<view class="card-btn">前往体验</view>
<image class="card-cover" :src="item.cover" mode="aspectFill" />
</view>
</block>
</view>
</view>
<!-- 推荐品类 -->
<!-- <view class="card-box">
<block v-for="(item, index) in meals" :key="index">
<view class="card-box-item" :style="{'backgrond': item.color}" @click="$Router.push({name: 'StoreMeals', params: {id: item.meal_id}})">
<view class="card-title">{{item.title}}</view>
<view class="card-subtitle">{{item.subtitle}}</view>
<image class="card-cover" :src="item.cover" mode="aspectFill"></image>
</view>
</block>
</view> -->
<!-- goods -->
<view class="goods-box">
<view class="title2">
猜你喜欢 <view class="more"><text class="title-des"> | 您身边的快捷推荐</text> <text class="more-txt" @click="$Router.push({name: 'StoreList'})">更多 ></text></view>
</view>
<oct-goods :lists="goodsArr" priceType="DT" color="#e6576b"
@onGoods="$Router.push({ name: 'StoreGoods', params: {id: $event.goods_id}})" />
<!-- <u-loadmore status="loading" /> -->
</view>
</view>
</template>
<script>
import {
mall
} from "@/apis/interfaces/store"
export default {
data() {
return {
swiperCount: 0,
banners: [],
goodTabs: [],
newGood: [],
goodsArr: [],
meals: [],
shops: [],
vips:[],
collage_banner:''
};
},
mounted() {
this.getMall()
},
methods: {
getMall() {
mall().then(res => {
this.banners = res.banners
this.goodsArr = res.goods
this.newGood = res.news
this.goodTabs = res.categories
this.meals = res.meals
this.shops = res.shops
this.vips = res.vips
this.collage_banner = res.collage_banner
uni.stopPullDownRefresh()
})
},
goCollage(){
uni.navigateTo({
url:'/pages/group-book/index'
})
},
goBook(item) {
if (item.url) {
if (item.url.openType === 'navigateTo') {
if (item.url.params != '') {
uni.navigateTo({
url: item.url.path + '?' + item.url.params,
})
} else {
uni.navigateTo({
url: item.url.path,
})
}
}
}
}
},
onPullDownRefresh() {
this.getMall()
},
onNavigationBarButtonTap() {
this.$Router.push({
name: 'StoreSearch'
})
}
}
</script>
<style lang="scss">
.content {
background: $window-color;
}
// 商城列表
.goods-box {
padding: $padding 0;
&>.title {
padding: $padding $padding 0;
font-size: $title-size-lg;
color: $text-color;
font-weight: bold;
margin-bottom: -$margin/2;
}
.title2 {
font-size: $title-size-lg;
color: $text-color;
font-weight: bold;
padding: 0 30rpx 10rpx 30rpx;
display: flex;
flex-direction: row;
align-items: center;
justify-content: flex-start;
box-sizing: border-box;
.title-des {
font-size: 24rpx !important;
padding-left: 10rpx;
color: $text-gray-m;
font-weight: normal;
}
.more {
flex: 1;
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
box-sizing: border-box;
padding-right: $padding;
.more-txt {
font-size: 24rpx;
color: $text-gray;
font-weight: normal;
}
}
}
}
// 商城分类
.classify-box {
.classify-item {
padding: 0 10rpx;
&:last-child {
padding-right: $padding;
}
&:first-child {
padding-left: $padding;
}
&-nav {
text-align: center;
width: 138rpx;
}
&-cover {
width: 86rpx;
height: 86rpx;
border-radius: 50%;
vertical-align: top;
margin-bottom: $margin/2;
}
&-title {
line-height: 40rpx;
font-size: $title-size-sm;
color: $text-color;
}
}
}
// 卡片推荐
.card-box {
padding: $padding $padding - 10;
padding-bottom: 0;
display: flex;
flex-wrap: wrap;
&-item {
margin: 0 10rpx;
width: calc(50% - 20rpx);
padding: $padding;
border-radius: $radius;
box-sizing: border-box;
position: relative;
.card-title {
font-size: $title-size-lg;
font-weight: bold;
color: $text-color;
line-height: 40rpx;
width: calc(100% - 80rpx);
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.card-subtitle {
font-size: 22rpx;
color: $text-gray;
// line-height: 40rpx;
min-height: 20rpx;
@extend .nowrap;
}
.card-cover {
width: 80rpx;
height: 80rpx;
position: absolute;
border-radius: 50%;
right: $margin;
top: $margin;
}
}
&-item:nth-child(1) {
background: #fef2ae;
}
&-item:nth-child(2) {
background: #c9ead9;
}
}
// swiper
.swiper{
background: linear-gradient(#FFF, #F3F6FB);
padding: $padding;
.swiper-box{
position: relative;
padding-top: 40%;
swiper,
image{
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
}
image{
border-radius: $radius;
}
}
.swiper-pages{
position: absolute;
z-index: 9;
left: 0;
right: 0;
bottom: $margin - 10;
height: 7rpx;
text-align: center;
.pages-item{
vertical-align: top;
display: inline-block;
height: 7rpx;
width: 25rpx;
margin: 0 5rpx;
background: rgba($color: #fff, $alpha: .5);
&.show{
background: white;
}
}
}
}
</style>
// 全民拼团
.collage{
box-sizing: border-box;
image{
width: 100%;
height: 0;
}
}
// 上新精选
.new-box {
padding: 0 $margin;
border-radius: $radius;
// padding: $padding - 10;
.title {
font-size: $title-size-lg;
color: $text-color;
font-weight: bold;
padding-bottom: 10rpx;
display: flex;
flex-direction: row;
align-items: center;
justify-content: flex-start;
box-sizing: border-box;
.title-des {
font-size: 24rpx !important;
padding-left: 10rpx;
color: $text-gray-m;
font-weight: normal;
}
.more {
flex: 1;
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
box-sizing: border-box;
padding-right: $padding;
.more-txt {
font-size: 24rpx;
color: $text-gray;
font-weight: normal;
}
}
}
.news {
margin: $margin/2 -10rpx 0;
display: flex;
.news-item {
margin: 0 10rpx;
width: calc(25% - 20rpx);
.news-cover {
position: relative;
width: 100%;
padding-top: 100%;
background-color: white;
border-radius: $radius-lg;
overflow: hidden;
image {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
}
.tags {
position: absolute;
top: 6rpx;
left: -54rpx;
background: #d81e06;
color: #fff;
width: 100%;
font-size: 24rpx;
padding: 4rpx 0;
text-align: center;
transform: rotate(-45deg);
font-weight: bold;
letter-spacing:2rpx;
}
}
.news-title {
margin-top: $margin/2;
font-size: $title-size-sm;
text-align: center;
color: $text-color;
line-height: 40rpx;
}
.news-price {
text-align: center;
font-size: $title-size-sm;
font-weight: bold;
color: $text-price;
line-height: 40rpx;
text {
margin-left: 6rpx;
font-size: 70%;
}
}
.through{
text-decoration: line-through !important;
}
}
}
}
.offline-box {
.title {
font-size: $title-size-lg;
color: $text-color;
font-weight: bold;
margin-top: $margin;
margin-left: $margin;
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
box-sizing: border-box;
.more {
flex: 1;
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
box-sizing: border-box;
padding-right: $padding;
.more-txt {
font-size: 24rpx;
color: $text-gray;
font-weight: normal;
}
}
}
.card-btn {
font-size: 22rpx;
color: #fff;
padding: 4rpx 20rpx;
border-radius: 20rpx;
background-color: $text-price;
display: inline-block;
}
.card-box {
// &-item{
// background: #fff !important;
// }
&-item:nth-child(1) {
background: #fef2ae;
background: rgba($color: #fef2ae, $alpha:.5);
}
&-item:nth-child(2) {
background: #c9ead9;
background: rgba($color: #c9ead9, $alpha:.5);
}
&-item:nth-child(3) {
margin-top: $padding - 8;
background: #bde0ff;
background: rgba($color: #bde0ff, $alpha:.5);
}
&-item:nth-child(4) {
margin-top: $padding - 8;
background: rgba($color: #ffd9e1, $alpha:.5);
}
}
.card-cover {
width: 100rpx;
height: 100rpx;
position: absolute;
right: $margin;
top: $margin;
}
.title-des {
font-size: 24rpx;
padding-left: 10rpx;
color: $text-gray-m;
font-weight: normal;
}
}
// swiper
.swiper {
background: linear-gradient(#FFF, #F3F6FB);
padding: $padding;
.swiper-box {
position: relative;
padding-top: 40%;
swiper,
image {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
}
image {
border-radius: $radius;
}
}
.swiper-pages {
position: absolute;
z-index: 9;
left: 0;
right: 0;
bottom: $margin - 10;
height: 7rpx;
text-align: center;
.pages-item {
vertical-align: top;
display: inline-block;
height: 7rpx;
width: 25rpx;
margin: 0 5rpx;
background: rgba($color: #fff, $alpha: .5);
&.show {
background: white;
}
}
}
}
</style>

View File

@@ -30,7 +30,7 @@
</template>
<script>
import { lists, classify } from "@/apis/interfaces/store"
import { lists, categories } from "@/apis/interfaces/store"
export default {
data() {
return {
@@ -46,17 +46,21 @@
uni.setNavigationBarTitle({
title: this.$Route.query.title
})
if (this.$Route.query.id) {
this.cid = this.$Route.query.id
} else {
this.getClassify();
}
this.getLists()
this.getClassify()
},
methods:{
// 商品列表
getLists() {
lists({
category_id : this.$Route.query.id,
category_cid: this.cid,
let data = {
category_id : this.cid,
page : this.page
}).then(res => {
};
lists(data).then(res => {
if(res.page.current === 1){
this.goodsArr = []
}
@@ -67,14 +71,15 @@
},
// 获取二级分类
getClassify(){
classify(this.$Route.query.id).then(res => {
categories().then(res => {
this.classify = this.classify.concat(res)
})
},
// 二级分类筛选
onTabs(e){
this.goodsArr = []
this.cid = e.category_id
this.page = 1;
this.goodsArr = [];
this.cid = e.category_id;
this.getLists()
},

View File

@@ -1,401 +1,432 @@
<template>
<view class="shopDetail">
<view class="top">
<view class="search" @click="search">
<uni-icons type="left" class="back" size="30" @click="$Router.back();" />
<view class="input">
<uni-icons type="search" class="search-icon" color="grey" size="20" /> 请输入要搜索商品的关键词
</view>
</view>
<view class="shopInfo">
<view class="shopInfo-title-left">
<image class="shop-logo" :src="logo" mode="aspectFill" />
<view class="shop-title">
<view class="shop-titl">{{name}}</view>
<view>店铺评分:<span class='no'>5.0</span> 服务态度 :<span class='no'>5.0</span></view>
</view>
</view>
<!-- <view class="shopInfo-title-right"> +关注 </view> -->
</view>
</view>
<view class="content">
<view class="left">
<scroll-view scroll-y="true" class="scroll-view-left">
<view :class="['classify-item', item.category_id === category_id?'active_classify_item':'']"
v-for="(item,index) in classify" :key="index" @click="selectClassify(item.category_id)">
{{item.name}}
</view>
</scroll-view>
</view>
<view class="right">
<scroll-view scroll-y="true" class="scroll-view-right" @scrolltolower='lower'>
<block v-if="goods.length > 0">
<view class="goods-item" v-for="(item,index) in goods" :key="index"
@click="onGoods(item.goods_id)">
<image :src="item.cover" mode="aspectFill" class="good-img" />
<view class="item--content">
<view class="title">{{item.name}}</view>
<view class="sub_title">{{item.shop.name}}</view>
<view class="price">{{item.price.price_min || '0'}}
<view class="price-type">
<text> DT积分</text>
<text class="kucun"> 库存量:{{item.stock}}</text>
</view>
</view>
</view>
</view>
</block>
<block v-else>
<view class="vertical pages-empty">
<u-empty icon="http://cdn.uviewui.com/uview/empty/list.png" textColor="#999" text="暂无相关商品">
</u-empty>
</view>
</block>
</scroll-view>
</view>
</view>
</view>
<view class="shopDetail">
<view class="top">
<view class="search" @click="search">
<uni-icons type="left" class="back" size="30" @click="$Router.back();" />
<view class="input">
<uni-icons type="search" class="search-icon" color="grey" size="20" /> 请输入要搜索商品的关键词
</view>
</view>
<view class="shopInfo">
<view class="shopInfo-title-left">
<image class="shop-logo" :src="logo" mode="aspectFill" />
<view class="shop-title">
<view class="shop-titl">{{name}}</view>
<view>店铺评分:<span class='no'>5.0</span> 服务态度 :<span class='no'>5.0</span></view>
</view>
</view>
<view class="shopInfo-title-right" v-if="shopType === 2" @click="goVip"> {{!vip.status?'开通会员':vip.name}}
</view>
</view>
</view>
<view class="content">
<view class="left">
<scroll-view scroll-y="true" class="scroll-view-left">
<view :class="['classify-item', item.category_id === category_id?'active_classify_item':'']"
v-for="(item,index) in classify" :key="index" @click="selectClassify(item.category_id)">
{{item.name}}
</view>
</scroll-view>
</view>
<view class="right">
<scroll-view scroll-y="true" class="scroll-view-right" @scrolltolower='lower'>
<block v-if="goods.length > 0">
<view class="goods-item" v-for="(item,index) in goods" :key="index"
@click="onGoods(item.goods_id)">
<image :src="item.cover" mode="aspectFill" class="good-img" />
<view class="item--content">
<view class="title">{{item.name}}</view>
<view class="sub_title">{{item.shop.name}}</view>
<view class="price">{{item.price.price_min || '0'}}
<view class="price-type">
<text> DT积分</text>
<text class="kucun"> 库存量:{{item.stock}}</text>
</view>
</view>
</view>
</view>
</block>
<block v-else>
<view class="vertical pages-empty">
<u-empty icon="http://cdn.uviewui.com/uview/empty/list.png" textColor="#999" text="暂无相关商品">
</u-empty>
</view>
</block>
</scroll-view>
</view>
</view>
</view>
</template>
<script>
import {
shopsDetail,
shopsGoods
} from "@/apis/interfaces/store"
export default {
data() {
return {
name : '',
logo : '',
category_id : '',
classify : [],
goods : [],
has_more:true,
page:1,
ShopId:'',
}
},
onLoad(e) {
this.ShopId = this.$Route.query.ShopId
shopsDetail(this.ShopId).then(res => {
this.classify = [{
category_id: '',
name: '全部商品',
}, ...res.categories]
this.name = res.name
this.logo = res.cover
this.getGoods()
}).catch(err => {
uni.showToast({
title: err.message,
icon: 'none'
})
})
},
onPullDownRefresh() {
this.has_more = true;
this.page = 1;
this.goods = [];
this.getGoods()
import {
shopsDetail,
shopsGoods
} from "@/apis/interfaces/store"
export default {
data() {
return {
name: '',
logo: '',
category_id: '',
classify: [],
goods: [],
has_more: true,
page: 1,
ShopId: '',
shopType: '', // 1。普通商品 2.会员制商品
vip: {},
}
},
methods: {
getGoods() {
uni.showLoading({
title:'请求中~',
mask:true,
onLoad(e) {
this.ShopId = this.$Route.query.ShopId
shopsDetail(this.ShopId).then(res => {
// vip 制 商品
if (res.type.code == 2) {
this.classify = [{
category_id: '',
name: '全部活动',
}, ...res.identities]
} else {
// 普通商品
this.classify = [{
category_id: '',
name: '全部商品',
}, ...res.categories]
}
this.name = res.name
this.logo = res.cover
this.vip = res.vip
this.shopType = res.type.code
this.getGoods()
}).catch(err => {
uni.showToast({
title: err.message,
icon: 'none'
})
})
},
onPullDownRefresh() {
this.has_more = true;
this.page = 1;
this.goods = [];
this.getGoods()
},
methods: {
getGoods() {
uni.showLoading({
title: '请求中~',
mask: true,
})
let data = {
shop_id: this.ShopId,
page: this.page,
}
if (this.shopType == 2) {
data.identity_id = this.category_id
data.is_user = 1
} else {
data.category_id = this.category_id
}
shopsGoods(data).then(res => {
this.goods = this.goods.concat(res.data);
this.has_more = res.page.has_more;
uni.hideLoading();
}).catch(err => {
uni.showToast({
title: err.message,
icon: 'none'
})
})
shopsGoods(this.ShopId, this.category_id,this.page).then(res => {
this.goods = this.goods.concat(res.data);
this.has_more = res.page.has_more;
uni.hideLoading();
}).catch(err => {
uni.showToast({
title: err.message,
icon: 'none'
})
})
},
lower(){
if(this.has_more){
this.page = this.page + 1
this.getGoods();
}else{
uni.showToast({
title:'没有更多~',
icon:"none",
mask:true,
})
}
},
selectClassify(id) {
if (id === this.category_id) return;
this.category_id = id;
this.page = 1;
this.goods =[];
this.has_more = true;
this.getGoods()
},
search() {
this.$Router.push({
name: 'StoreSearch'
});
},
onGoods(id) {
this.$Router.push({
name: 'StoreGoods',
params: {
id: id
}
})
}
}
}
lower() {
if (this.has_more) {
this.page = this.page + 1
this.getGoods();
} else {
uni.showToast({
title: '没有更多~',
icon: "none",
mask: true,
})
}
},
selectClassify(id) {
if (id === this.category_id) return;
this.category_id = id;
this.page = 1;
this.goods = [];
this.has_more = true;
this.getGoods()
},
search() {
this.$Router.push({
name: 'StoreSearch'
});
},
goVip() {
uni.navigateTo({
url: '/pages/store/vip/index/index?id=' + this.ShopId
})
},
onGoods(id) {
this.$Router.push({
name: 'StoreGoods',
params: {
id: id
}
})
}
}
}
</script>
<style lang="scss">
.pages-empty {
height: 70vh;
}
.pages-empty {
height: 70vh;
}
.shopDetail {
width: 100%;
height: 100vh;
.shopDetail {
width: 100%;
height: 100vh;
.top {
height: 320rpx;
display: flex;
flex-direction: column;
align-items: flex-start;
justify-content: flex-end;
box-sizing: border-box;
padding-top: 44px;
width: 100%;
.top {
height: 320rpx;
display: flex;
flex-direction: column;
align-items: flex-start;
justify-content: flex-end;
box-sizing: border-box;
padding-top: 44px;
width: 100%;
.search {
display: flex;
flex-direction: row;
align-items: center;
justify-content: flex-start;
box-sizing: border-box;
width: 100%;
padding-right: $padding;
.search {
display: flex;
flex-direction: row;
align-items: center;
justify-content: flex-start;
box-sizing: border-box;
width: 100%;
padding-right: $padding;
.back {
padding: 0 $padding;
}
.back {
padding: 0 $padding;
}
.input {
flex: 1;
display: flex;
flex-direction: row;
align-items: center;
justify-content: center;
box-sizing: border-box;
background-color: #f9f9f9;
color: gray;
font-size: 26rpx;
border-radius: 30rpx;
padding: 10rpx $padding;
.input {
flex: 1;
display: flex;
flex-direction: row;
align-items: center;
justify-content: center;
box-sizing: border-box;
background-color: #f9f9f9;
color: gray;
font-size: 26rpx;
border-radius: 30rpx;
padding: 10rpx $padding;
.search-icon {
margin-right: $margin;
}
}
}
.search-icon {
margin-right: $margin;
}
}
}
.shopInfo {
border-top: solid 1 #f9f9f9;
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
box-sizing: border-box;
width: 100%;
padding: $padding - 10;
background-color: #fff;
.shopInfo {
border-top: solid 1 #f9f9f9;
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
box-sizing: border-box;
width: 100%;
padding: $padding - 10;
background-color: #fff;
.shopInfo-title-left {
width: 500rpx;
display: flex;
flex-direction: row;
align-items: center;
justify-content: flex-start;
box-sizing: border-box;
.shopInfo-title-left {
width: 500rpx;
display: flex;
flex-direction: row;
align-items: center;
justify-content: flex-start;
box-sizing: border-box;
.shop-logo {
width: 100rpx;
height: 100rpx;
border-radius: 10rpx;
border: solid 1rpx #f9f9f9;
}
.shop-logo {
width: 100rpx;
height: 100rpx;
border-radius: 10rpx;
border: solid 1rpx #f9f9f9;
}
.shop-title {
display: flex;
flex-direction: column;
align-items: flex-start;
justify-content: flex-start;
box-sizing: border-box;
font-size: 26rpx;
margin-left: $margin;
color: #999;
width: 370rpx;
.shop-title {
display: flex;
flex-direction: column;
align-items: flex-start;
justify-content: flex-start;
box-sizing: border-box;
font-size: 26rpx;
margin-left: $margin;
color: #999;
width: 370rpx;
.no {
color: $text-price;
padding-left: 4rpx;
.no {
color: $text-price;
padding-left: 4rpx;
padding-right: 10rpx;
}
}
.shop-titl {
font-size: 34rpx;
color: #333;
font-weight: bold;
margin-bottom: 6rpx;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
width: 100%;
}
}
}
.shop-titl {
font-size: 34rpx;
color: #333;
font-weight: bold;
margin-bottom: 6rpx;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
max-width: 100%;
}
}
}
.shopInfo-title-right {
display: flex;
flex-direction: row;
align-items: center;
justify-content: center;
box-sizing: border-box;
font-size: 28rpx;
color: #222;
background-color: $main-color;
padding: 6rpx $padding;
color: #FFF;
}
.shopInfo-title-right {
display: flex;
flex-direction: row;
align-items: center;
justify-content: center;
box-sizing: border-box;
font-size: 28rpx;
color: #222;
background-color: $main-color;
padding: 6rpx $padding;
color: #FFF;
}
}
}
}
}
.content {
height: calc(100vh - 320rpx);
background-color: #eee;
display: flex;
flex-direction: row;
align-items: center;
padding-top: 20rpx;
box-sizing: border-box;
.content {
height: calc(100vh - 320rpx);
background-color: #eee;
display: flex;
flex-direction: row;
align-items: center;
padding-top: 20rpx;
box-sizing: border-box;
.left {
width: 180rpx;
height: 100%;
.left {
width: 180rpx;
height: 100%;
.scroll-view-left {
height: 100%;
width: 100%;
}
.scroll-view-left {
height: 100%;
width: 100%;
}
.classify-item {
width: 100%;
padding: $padding 0;
font-size: 26rpx;
text-align: center;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
color: #222;
display: inline-block;
}
.classify-item {
width: 100%;
padding: $padding 0;
font-size: 26rpx;
text-align: center;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
color: #222;
display: inline-block;
}
.active_classify_item {
background-color: #FFFFFF;
}
}
.active_classify_item {
background-color: #FFFFFF;
}
}
.right {
width: calc(100% - 180rpx);
height: 100%;
background-color: #fff;
.right {
width: calc(100% - 180rpx);
height: 100%;
background-color: #fff;
.scroll-view-right {
width: 100%;
height: 100%;
.scroll-view-right {
width: 100%;
height: 100%;
.goods-item {
width: 100%;
display: inline-block;
border-bottom: solid 1rpx #eee;
// padding: $padding;
padding-left: $padding;
padding-top: $padding;
padding-bottom: $padding;
display: flex;
flex-direction: row;
align-items: center;
justify-content: flex-start;
box-sizing: border-box;
.goods-item {
width: 100%;
display: inline-block;
border-bottom: solid 1rpx #eee;
// padding: $padding;
padding-left: $padding;
padding-top: $padding;
padding-bottom: $padding;
display: flex;
flex-direction: row;
align-items: center;
justify-content: flex-start;
box-sizing: border-box;
.good-img {
width: 160rpx;
height: 160rpx;
border-radius: 10rpx;
}
.good-img {
width: 160rpx;
height: 160rpx;
border-radius: 10rpx;
}
.item--content {
flex: 1;
padding: $padding - 10;
.item--content {
flex: 1;
padding: $padding - 10;
&>.title {
font-size: 28rpx;
color: #333;
// @extend .ellipsis-1;
}
&>.title {
font-size: 28rpx;
color: #333;
// @extend .ellipsis-1;
}
&>.sub_title {
color: #a05f0c;
font-size: 24rpx;
padding-top: 4rpx;
// @extend .ellipsis-1;
}
&>.sub_title {
color: #a05f0c;
font-size: 24rpx;
padding-top: 4rpx;
// @extend .ellipsis-1;
}
&>.price {
padding-top: $padding/2;
display: flex;
flex-direction: row;
align-items: flex-end;
justify-content: flex-start;
box-sizing: border-box;
line-height: 40rpx;
font-weight: bold;
font-size: 32rpx;
color: $text-price;
&>.price {
padding-top: $padding/2;
display: flex;
flex-direction: row;
align-items: flex-end;
justify-content: flex-start;
box-sizing: border-box;
line-height: 40rpx;
font-weight: bold;
font-size: 32rpx;
color: $text-price;
// @extend .ellipsis-1;
.price-type {
display: flex;
flex-direction: row;
align-items: flex-end;
justify-content: space-between;
box-sizing: border-box;
flex: 1;
// @extend .ellipsis-1;
.price-type {
display: flex;
flex-direction: row;
align-items: flex-end;
justify-content: space-between;
box-sizing: border-box;
flex: 1;
position: relative;
top: 5rpx;
text {
margin-right: $margin/2;
padding-left: 6rpx;
font-size: 70%;
}
text {
margin-right: $margin/2;
padding-left: 6rpx;
font-size: 70%;
}
.kucun {
color: $text-gray;
font-weight: normal;
}
}
.kucun {
color: $text-gray;
font-weight: normal;
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
</style>

View File

@@ -0,0 +1,126 @@
<template>
<view class="groupBook">
<view class="top">
<view class="title">VIP换购</view>
<view>百款商品任意换购</view>
</view>
<!-- 有数据 -->
<scroll-view scroll-y="true" class="scroll" @scrolltolower='scrolltolower' v-if="lists.length>0">
<block v-for="(item,index) in lists" :key="index">
<vipGoodsItem :item="item" @goPin="goPin" />
</block>
</scroll-view>
<!-- 没数据 -->
<scroll-view scroll-y="true" class="scroll" v-else>
<view class="vertical pages-empty" style="padding-top: 200rpx;">
<u-empty
icon="http://cdn.uviewui.com/uview/empty/list.png"
textColor="#999"
text="暂无VIP商品~"
/>
</view>
</scroll-view>
</view>
</template>
<script>
import vipGoodsItem from '@/components/vip-goods-item/index.vue'
import {
lists
} from '@/apis/interfaces/store.js'
export default {
components: {
vipGoodsItem
},
data() {
return {
lists: [],
page: 1,
has_more: true,
};
},
onLoad() {
this.getList()
},
methods: {
getList() {
lists({
is_user:'1',
page: this.page
}).then(res => {
this.lists = this.lists.concat(res.data)
this.has_more = res.page.has_more
}).catch(err => {
uni.showToast({
title: err.message,
icon: "none",
mask: true
})
})
},
// 触底获取更多~
scrolltolower() {
if (this.has_more) {
this.page = this.page + 1
this.getList()
}else{
uni.showToast({
title:'没有更多~',
icon:'none'
})
}
},
// 马上拼团
goPin(id) {
console.log('fule gopin....')
uni.navigateTo({
url:'/pages/store/goods?id='+id
})
}
}
}
</script>
<style lang="scss">
.groupBook {
width: 100%;
min-height: 100vh;
position: relative;
background: $window-color;
box-sizing: border-box;
position: relative;
.top {
position: absolute;
top: 0;
left: 0;
font-size: $title-size - 2;
color: #fff;
width: 100%;
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
padding: $padding;
box-sizing: border-box;
background: linear-gradient(to bottom, #d81e06, rgba(255, 255, 255, 0));
padding-bottom: 40vh;
z-index: 1;
.title {
font-size: 40rpx;
font-weight: bold;
}
}
.scroll {
height: 100vh;
position: relative;
padding: $padding * 4 $padding $padding $padding;
box-sizing: border-box;
z-index: 2;
}
}
</style>

View File

@@ -0,0 +1,349 @@
<template>
<view class="store-vip">
<image class="vip-bg" src="/static/store/store-vip-bg.png" mode="widthFix"/>
<swiper class="swiper" circular :current="swiperCurrent">
<swiper-item class="swiper-item" v-for="(item, index) in vip" :key="index">
<view class="top">
<view class="left" v-if="vip.length > 1">
<image class="left-img" src="/static/store/get-more.gif" mode="widthFix" /> 滑动获取更多
</view>
<view class="content">
<!-- 四个角标 -->
<block> <image class="jiao" src="/static/store/vip-left-top.png" mode="widthFix" /> <image class="jiao" src="/static/store/vip-right-top.png" mode="widthFix" /> <image class="jiao" src="/static/store/vip-left-bottom.png" mode="widthFix" /> <image class="jiao" src="/static/store/vip-right-bottom.png" mode="widthFix" /> </block>
<view class="title1"> {{item.shop.name}} </view>
<image class="title2" :src="item.title_cover" mode="widthFix" />
<view class="title3"> {{item.description}} </view> <!-- 分类 -->
<view class="type">
<view class="type-item" v-for="(it, itIndex) in item.rules" :key="itIndex">
<image :src="it.cover" mode="aspectFill" />
<view class="title">{{it.name}}</view>
</view>
</view>
<view class="title4">详情咨询可添加产品页下方客服二维码</view>
</view>
<view class="right" v-if="vip.length > 1"> 滑动获取更多 <image class="right-img" src="/static/store/get-more.gif" mode="widthFix" /> </view>
</view>
<view class="bottom">
<view class="left">
<view class="title-1">立享尊贵特权 >> </view>
<view class="title-2" v-if="item.vip_info.ended_at"> 到期时间{{item.vip_info.ended_at}} </view>
<view class="title-2" v-if="item.margins.days>0"> 距离{{item.margins.days}}天只需要补{{item.margins.price}}元升级 </view>
</view>
<view class="right" @click="onOpenVip(item.identity_id)">
{{item.is_vip ?'立即续费':item.margins.days>0 ? '立即升级':'立即开通'}}
</view>
</view>
</swiper-item>
</swiper>
</view>
</template>
<script>
import {
shopVipInfo,
shopVipCreate,
shopVipWeChat
} from '@/apis/interfaces/vip.js'
export default {
data() {
return {
id : '',
identityId : '',
vip : [],
swiperCurrent : 0
};
},
onLoad(e) {
this.id = e.id;
this.identityId = e.identityId
this.getInfo()
},
methods: {
getInfo() {
shopVipInfo(this.id).then(res => {
uni.setNavigationBarTitle({
title: res[0].shop.name + '会员'
});
this.vip = res;
this.swiperCurrent = res.findIndex(val => val.identity_id == this.identityId)
}).catch(err => {
uni.showToast({
title: err.message,
icon: 'none',
mask: true,
})
})
},
// 创建店铺vip会员
onOpenVip(identity) {
// 获取订单
uni.showLoading({
title: 'VIP会员开通中'
})
shopVipCreate(this.id,identity).then(res => {
// 支付参数
if (res.id) {
uni.showLoading({
title: '获取支付信息'
})
this.wxPay(res.id)
}
}).catch(err => {
uni.showToast({
title: err.message,
icon: 'none'
})
})
},
// 微信支付
wxPay(orderId) {
shopVipWeChat(orderId).then(orderInfo => {
uni.requestPayment({
provider: "wxpay",
orderInfo: JSON.parse(orderInfo),
success: res => {
uni.showModal({
title: '提示',
content: '开通成功',
showCancel: false,
success: () => {
uni.navigateBack({})
}
})
},
fail(err) {
let showToast = err.message
if (err.errMsg === 'requestPayment:fail [payment微信:-2]User canceled') {
showToast = '支付被取消'
}
uni.showToast({
title: showToast,
icon: 'none'
})
}
})
}).catch(err => {
uni.showToast({
title: err.message,
icon: 'none',
mask:true,
})
})
}
}
}
</script>
<style lang="scss">
.store-vip {
height: 100vh;
width: 100vw;
background-color: #f6f1eb;
position: relative;
z-index: 0;
overflow: hidden;
.vip-bg {
width: 100%;
// height: 100%;
position: absolute;
z-index: 1;
top: -50rpx;
left: -50rpx;
}
.swiper {
width: 100%;
height: 100%;
position: relative;
z-index: 2;
.swiper-item {
.top {
height: calc(100vh - 160rpx);
display: flex;
flex-direction: column;
align-items: center;
justify-content: space-around;
box-sizing: border-box;
.right {
font-size: 30rpx;
color: #999;
text-align: right;
width: 100%;
padding-bottom: 6%;
display: flex;
flex-direction: row;
align-items: center;
box-sizing: border-box;
justify-content: flex-end;
margin-right: 20%;
box-sizing: border-box;
.right-img{
width: 50rpx;
margin-left: 10rpx;
opacity: 0.6;
}
}
.left {
font-size: 30rpx;
color: #999;
text-align: left;
width: 100%;
padding-top: 6%;
display: flex;
flex-direction: row;
align-items: center;
box-sizing: border-box;
justify-content: flex-start;
margin-left: 20%;
box-sizing: border-box;
.left-img{
width: 50rpx;
transform: rotate(180deg);
margin-right: 10rpx;
opacity: 0.6;
}
}
.content {
padding: $padding * 2;
background-color: #fff;
border-radius: 10rpx;
width: 80%;
min-height: 70%;
position: relative;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
box-sizing: border-box;
.title1 {
font-size: 34rpx;
color: #e5c175;
font-weight: bold;
}
.title2 {
padding-top: $padding - 0;
width: 100%;
height: 0;
padding-bottom: $padding - 10;
}
.title3 {
font-size: 28rpx;
color: #2f3245;
}
.title4 {
font-size: 28rpx;
color: #e5c175;
padding-top: 30rpx;
}
.type {
display: flex;
flex-direction: row;
align-items: center;
justify-content: flex-start;
box-sizing: border-box;
flex-wrap: wrap;
margin-top: $padding * 2;
width: 100%;
.type-item {
width: 33.33%;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
box-sizing: border-box;
font-size: 28rpx;
color: #2f3245;
margin-bottom: 30rpx;
image {
width: 90rpx;
height: 90rpx;
border-radius: 50%;
margin-bottom: 20rpx;
}
}
}
.jiao {
width: 50rpx;
position: absolute;
}
.jiao:nth-child(1) {
left: 0;
top: 0;
}
.jiao:nth-child(2) {
right: 0;
top: 0;
}
.jiao:nth-child(3) {
left: 0;
bottom: 0;
}
.jiao:nth-child(4) {
right: 0;
bottom: 0;
}
}
}
.bottom {
height: 160rpx;
background-color: #2f3245;
color: #e5c175;
width: 100%;
display: flex;
flex-direction: row;
.left {
color: #e5c175;
width: 70%;
height: 100%;
font-weight: bold;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
box-sizing: border-box;
.title-1 {
font-size: 36rpx;
}
.title-2{
font-size: 28rpx;
font-weight: normal;
}
}
.right {
background-color: #e5c175;
width: 30%;
height: 100%;
color: #2f3245;
display: flex;
flex-direction: row;
align-items: center;
justify-content: center;
box-sizing: border-box;
font-size: 36rpx;
font-weight: bold;
}
}
}
}
}
</style>

View File

@@ -1,12 +1,15 @@
<template>
<view class="content">
<!-- 用户信息 -->
<view class="info-box">
<image src="@/static/user/user_back.png" mode="aspectFill" />
<view class="user-flex">
<view class="info-box" style="background-color: red;">
<image src="@/static/user/user_back.png" mode="aspectFill" />
<view class="user-flex">
<view class="news" @click="onBtn('newsIndex', {})">
<u-icon class="bell_fill" name="bell-fill" color="#fff" size="28" />
<u-badge class="bell_fill_dot" :isDot="messages > 0" type="error" />
</view>
<image class="cover" @click="onBtn('Setting', {})"
:src="userInfo.avatar || require('@/static/user/cover.png')" mode="aspectFill" />
<view class="user-content">
<view class="name">{{ userInfo.nickname }}</view>
<view class="tabs">
@@ -15,8 +18,7 @@
</view>
</view>
<view class="chainAddress" v-if="userInfo.addr">
<text
@click="copy(userInfo.addr)">区块地址:{{userInfo.addr.substring(0,5) + '****' + userInfo.addr.substring(userInfo.addr.length - 5)}}</text>
<text @click="copy(userInfo.addr)">区块地址:{{userInfo.addr.substring(0,5) + '****' + userInfo.addr.substring(userInfo.addr.length - 5)}}</text>
</view>
</view>
</view>
@@ -39,7 +41,7 @@
<view class="title">共力分</view>
<view class="num">{{account.glz}}</view>
</view>
<view class="health-flex-item">
<view class="health-flex-item" @click="onBtn('AccountDt', {})">
<view class="title">DT积分</view>
<view class="num">{{account.dt}}</view>
</view>
@@ -91,6 +93,16 @@
<image class="icon" src="@/static/user/userIcon_02.png" mode="widthFix" />
导出助记词
<uni-icons class="forward" type="forward" color="#999" />
</view>
<!-- <view class="btns-box-item" @click="onWbt">
<image class="icon" src="@/static/user/userIcon_02.png" mode="widthFix" />
文版通账号
<uni-icons class="forward" type="forward" color="#999" />
</view> -->
<view class="btns-box-item" @click="resetPassword">
<image class="icon" src="@/static/user/userIcon_13.png" mode="widthFix" />
{{hasPassword ? '修改' : '设置'}}支付密码
<uni-icons class="forward" type="forward" color="#999" />
</view>
<block v-if="canSeeData">
<view class="btns-box-item" @click="onBtn('DataBoard', {})">
@@ -100,32 +112,38 @@
</view>
</block>
</view>
<view class="btns-box">
<view class="btns-box">
<!-- <view class="btns-box-item" @click="onBtn('PinList', {})" v-if="collage_switch">
<image class="icon" src="@/static/user/userIcon_15.png" mode="widthFix" />
我的拼单 <uni-icons class="forward" type="forward" color="#999" />
</view> -->
<view class="btns-box-item" @click="onBtn('MyCard', {})">
<image class="icon" src="@/static/user/userIcon_00.png" mode="widthFix" />
我的卡券 <uni-icons class="forward" type="forward" color="#999" />
</view>
<view class="btns-box-item" @click="onBtn('Address', { type: 'edit' })">
<image class="icon" src="@/static/user/userIcon_03.png" mode="widthFix" />
地址管理
<uni-icons class="forward" type="forward" color="#999" />
地址管理 <uni-icons class="forward" type="forward" color="#999" />
</view>
<view class="btns-box-item" @click="onBtn('Invitation', {})">
<image class="icon" src="@/static/user/userIcon_07.png" mode="widthFix" />
分享邀请
<uni-icons class="forward" type="forward" color="#999" />
分享邀请 <uni-icons class="forward" type="forward" color="#999" />
</view>
<view class="btns-box-item" @click="onBtn('Supplier', {})">
<image class="icon" src="@/static/user/userIcon_09.png" mode="widthFix" />
供应商入驻
<uni-icons class="forward" type="forward" color="#999" />
供应商入驻 <uni-icons class="forward" type="forward" color="#999" />
</view>
<view class="btns-box-item" @click="resetPassword">
<image class="icon" src="@/static/user/userIcon_13.png" mode="widthFix" />
{{hasPassword ? '修改' : '设置'}}支付密码
<uni-icons class="forward" type="forward" color="#999" />
</view>
</view>
</view>
<view class="btns-box">
<view class="btns-box-item" @click="onShare">
<image class="icon" src="@/static/user/userIcon_14.png" mode="widthFix" />绑定分享关系
<block v-if="share == null"> <uni-icons class="forward" type="forward" color="#999" /> </block>
<block v-else> <text class="forward" style="color: gray;">{{share.nickname}}</text> </block>
</view>
</view>
<view class="btns-box">
<view class="btns-box-item" @click="onBtn('Feedback', {})">
<image class="icon" src="@/static/user/userIcon_06.png" mode="widthFix" />
意见反馈
<image class="icon" src="@/static/user/userIcon_06.png" mode="widthFix" />意见反馈
<uni-icons class="forward" type="forward" color="#999" />
</view>
<view class="btns-box-item" @click="updateApp">
@@ -149,7 +167,7 @@
<view>The total force ecological</view>
</view>
<!-- 助记词弹出框 -->
<u-modal :show="wordsShow" :zoom="false" confirmText="复制" @confirm="copyWord" confirmColor="#34CE98">
<u-modal :show="wordsShow" :zoom="false" confirmText="复制" @confirm="copyWord('zjc')" confirmColor="#34CE98">
<slot default>
<view class="wordsCont">
<view class="wordsCont-title">导出助记词</view>
@@ -160,6 +178,18 @@
</view>
</slot>
</u-modal>
<!-- 查看文版通账号 -->
<u-modal :show="wbtShow" :zoom="false" confirmText="复制" @confirm="copyWord('wbt')" confirmColor="#34CE98">
<slot default>
<view class="wordsCont">
<view class="wordsCont-title">文版通账号</view>
<view class="wordsCont-tips">请务必抄下文版通账号并存在安全的地方若文版通账号丢失重装或换设备登录时将无法查看历史消息若文版通账号被他人获取将可能获取你的信息</view>
<view class="wordsCont-text">账号{{wbtAccount}}</view>
<image class="wordsCont-close" @click="wordsShow = false;wbtShow= false;" src="@/static/icon/userCloes.png"
mode="widthFix"></image>
</view>
</slot>
</u-modal>
<!-- 输入支付密码 -->
<u-modal :show="showIv" title="请输入钱包支付密码" :showCancelButton="true" confirmColor="#34CE98" negativeTop="160"
@confirm="validationIv" @cancel="()=>{ this.showIv = false, this.iv = '' }">
@@ -169,21 +199,46 @@
placeholder="输入支付密码" />
</view>
</slot>
</u-modal>
</u-modal>
<!-- 绑定分享关系 -->
<u-modal
:show="showBind"
confirmColor="#34CE98"
:showCancelButton="true"
:confirmText="isInvitation ? '校验邀请码': '绑定关系'"
@cancel="()=> {
this.showBind = false
this.isInvitation = true
this.invitation = ''
}"
@confirm="onBind"
>
<slot>
<view class="bind-view" v-if="isInvitation">
<view class="bind-title">邀请码</view>
<view class="bind-subtitle">请输入好友的邀请码</view>
<view class="bind-input">
<input type="text" v-model="invitation" placeholder="输入邀请码">
</view>
</view>
<view class="bind-user" v-else>
<view class="bind-title">邀请用户</view>
<view class="bind-subtitle">请确认绑定关系用户信息</view>
<view class="bind-acitve">
<image :src="invitationUser.avatar" mode="aspectFill"></image>
</view>
<view class="bind-nickname">{{invitationUser.nickname}}</view>
<view class="bind-username">{{invitationUser.username}}</view>
</view>
</slot>
</u-modal>
</view>
</template>
<script>
import {
info,
chainSeed
} from '@/apis/interfaces/user';
import {
payPassword
} from '@/apis/interfaces/account.js'
import {
getVersions
} from '@/apis/interfaces/versions.js'
import { info, chainSeed, relationsBind, relationsVerify } from '@/apis/interfaces/user';
import { payPassword } from '@/apis/interfaces/account.js'
import { getVersions } from '@/apis/interfaces/versions.js'
export default {
data() {
return {
@@ -219,42 +274,119 @@
isWallet: false,
walletNum: 0,
// 数据看板权限
canSeeData: false
canSeeData: false,
messages:0,
wbtAccount:'',
wbtShow:false,
// 绑定关系
share : null,
showBind : false,
invitation : '',
isInvitation : true,
invitationUser : {},
collage_switch : false,
};
},
onShow() {
// if(uni.getStorageSync('isWalleNum') != '' && uni.getStorageSync('isWalleNum') === 1) this.isWallet = true
this.getInfo();
},
methods: {
methods: {
onWbt(){
if(this.wbtAccount === ''){
uni.showModal({
title:'温馨提示',
content:'当前账号没有绑定文版通账号,是否现在就去绑定',
confirmText:'立即绑定',
cancelText:'先不绑定',
success:(res) => {
if(res.confirm){
this.$Router.push({name:'WbtBind'})
}
}
})
}else{
this.wbtShow = true;
}
},
// 绑定分享关系
onShare(){
if(this.share != null){
return
}
this.showBind = true
},
// 绑定邀请码
onBind(){
// 检验邀请码
if(this.isInvitation){
if(this.invitation === ''){
uni.showToast({
title: '请输入邀请码',
icon : 'none'
})
return
}
relationsVerify(this.invitation).then(res => {
this.invitationUser = res
this.isInvitation = false
}).catch(err => {
uni.showToast({
title: err.message,
icon : 'none'
})
})
return
}
// 绑定关系
relationsBind(this.invitation).then(res => {
this.showBind = false
uni.showModal({
title : '提示',
content : '关系绑定成功',
showCancel : false,
success : res => {
this.getInfo()
}
})
}).catch(err => {
uni.showToast({
title: err.message,
icon : 'none'
})
})
},
// 用户信息
getInfo() {
if (this.$store.state.token === '') return;
info().then(res => {
uni.setNavigationBarTitle({
title: res.nickname
});
this.canSeeData = res.can_see_data
this.order = res.order
this.cardText = res.identity_array
this.userInfo = {
nickname: res.nickname,
addr: res.addr,
avatar: res.avatar,
isOpenVip: res.is_open_vip,
username: res.username
}
this.identity = res.identity
this.account = res.account
this.serial = res.serial
this.hasPassword = res.has_transfer_password
})
.catch(err => {
uni.showToast({
title: err.message,
icon: 'none'
});
});
info().then(res => {
uni.setNavigationBarTitle({
title: res.nickname
});
this.share = String(res.share) == '' ? null : res.share
this.canSeeData = res.can_see_data
this.order = res.order
this.cardText = res.identity_array
this.userInfo = {
nickname: res.nickname,
addr: res.addr,
avatar: res.avatar,
isOpenVip: res.is_open_vip,
username: res.username
}
this.identity = res.identity;
this.account = res.account;
this.serial = res.serial;
this.hasPassword = res.has_transfer_password;
this.messages = Number(res.messages);
this.wbtAccount = res.wbt_account;
this.collage_switch = res.collage_switch;
}).catch(err => {
uni.showToast({
title: err.message,
icon: 'none'
});
});
},
// 导出助记词
onMnemonic() {
@@ -312,7 +444,7 @@
})
},
// 按钮导航
onBtn(name, params) {
onBtn(name, params) {
this.$Router.push({
name,
params
@@ -361,13 +493,14 @@
}
},
// 复制助记词
copyWord() {
copyWord(type) {
uni.setClipboardData({
data: this.mnemonic,
data: type === 'zjc'?this.mnemonic:this.wbtAccount,
success: () => {
this.wordsShow = false
this.wordsShow = false
this.wbtShow = false
uni.showToast({
title: '助记词已复制',
title: type === 'zjc' ? '助记词已复制' : '文版通账号已复制',
icon: 'none',
mask: true
})
@@ -453,8 +586,82 @@
.content {
background: $window-color;
min-height: 100vh;
}
}
// 邀请码
.bind-view{
padding: 15rpx 30rpx;
width: 100%;
box-sizing: border-box;
.bind-title{
text-align: center;
font-size: 36rpx;
font-weight: bold;
}
.bind-subtitle{
line-height: 40rpx;
font-size: 28rpx;
color: gray;
padding-top: 15rpx;
text-align: center;
}
.bind-input{
padding-top: 30rpx;
input{
background: #f8f8f8;
width: 100%;
height: 80rpx;
padding: 0 30rpx;
border-radius: 40rpx;
text-align: center;
box-sizing: border-box;
font-size: 32rpx;
font-weight: bold;
}
}
}
// 确认绑定用户关系
.bind-user{
padding: 15rpx 30rpx;
width: 100%;
box-sizing: border-box;
.bind-title{
text-align: center;
font-size: 36rpx;
font-weight: bold;
}
.bind-subtitle{
line-height: 40rpx;
font-size: 28rpx;
color: gray;
padding-top: 15rpx;
text-align: center;
}
.bind-acitve{
text-align: center;
padding-top: 30rpx;
image{
width: 108rpx;
height: 108rpx;
background: #f8f8f8;
border-radius: 50%;
}
}
.bind-nickname{
text-align: center;
font-size: 32rpx;
color: #333;
font-weight: bold;
line-height: 40rpx;
padding-top: 20rpx;
}
.bind-username{
text-align: center;
font-weight: bold;
font-size: 28rpx;
color: gray;
}
}
// 版权信息
.footer-text {
text-align: center;
@@ -476,13 +683,29 @@
right: 0;
width: 100%;
height: 100%;
// z-index: 100;
}
.user-flex {
position: relative;
padding: $padding * 2 $padding ($padding * 2 + 60);
height: 128rpx;
height: 128rpx;
.news{
top: -30rpx;
right: -30rpx;
position: relative;
.bell_fill_dot{
position: absolute;
top: 24rpx;
right: 46rpx;
z-index: 1000;
}
.bell_fill{
position: absolute;
right: 50rpx;
top: 30rpx;
z-index: 10000000;
}
}
.cover {
position: absolute;

View File

@@ -0,0 +1,179 @@
<template>
<view class="my-card">
<view class="select">
{{listShowText}} <u-icon class='down' name="arrow-down-fill" size='11' color="#666" />
</view>
<block v-if="lists.length > 0">
<view class="card-item" v-for="item in lists" :key='item.card_id' @click="goShop(item.shop.shop_id)">
<image class="card-item-bg" :src="item.message.card_cover" mode="aspectFill" />
<view class="card-item-top">
<image class="avatar" :src="item.message.cover" mode="aspectFill" />
<view class="info">
<view class="title"> {{item.shop.name}}</view>
<view class="des"> NO.{{item.number}} | {{item.ended_at}} 到期</view>
</view>
</view>
<view class="tags">{{item.message.title}}</view>
</view>
</block>
<block v-else>
<view class="vertical pages-empty" style="padding-top: 180rpx;">
<u-empty icon="http://cdn.uviewui.com/uview/empty/list.png" textColor="#999" text="暂无卡包信息~" />
</view>
</block>
<!-- 筛选 -->
<!-- <u-action-sheet :actions="typeList" @select="selectClick" :show="show" cancelText='取消' @close='show = false' /> -->
</view>
</template>
<script>
import {
myCard
} from '@/apis/interfaces/user.js'
export default {
data() {
return {
page: 1,
has_more: true,
lists: [],
typeList: [{
name: '按照会员到期时间排序'
}],
show: false,
listShowText: '按照会员到期时间排序',
};
},
onLoad() {
this.getList();
},
onReachBottom() {
if (this.has_more) {
this.page = this.page + 1;
this.getList();
}else{
uni.showToast({
title:'没有更多~',
icon: "none",
mask: true
})
}
},
methods: {
goShop(id) {
uni.navigateTo({
url:'/pages/store/shop/shopDetail?ShopId=' + id
})
},
getList() {
if(this.page === 1){
this.lists = []
}
myCard({
page: this.page
}).then(res => {
this.lists = this.lists.concat(res.data);
this.has_more = res.page.has_more;
}).catch(err => {
uni.showToast({
title: err.message,
icon: "none",
mask: true
})
})
}
}
}
</script>
<style lang="scss">
.my-card{
padding-bottom: $padding;
}
.select {
display: flex;
flex-direction: row;
align-items: center;
justify-content: center;
box-sizing: border-box;
font-size: 28rpx;
color: #666;
padding: $padding;
.down {
padding-left: 10rpx;
}
}
.card-item {
height: 180rpx;
background-color: pink;
border-radius: 10rpx;
position: relative;
overflow: hidden;
box-sizing: border-box;
margin: 0 $margin;
margin-bottom: $margin - 10;
.tags {
position: absolute;
top: 22rpx;
color: #fff;
right: -46rpx;
background: rgba($color: #ffaa00, $alpha: 0.9);
font-size: 30rpx;
padding: 2rpx 50rpx;
text-align: center;
transform: rotate(45deg);
font-weight: bold;
letter-spacing:4rpx;
z-index: 10;
}
.card-item-bg {
position: absolute;
top: 1;
width: 100%;
z-index: 1;
}
.card-item-top {
background-color: rgba($color: #000000, $alpha:0.6);
width: 100%;
height: 180rpx;
position: absolute;
top: 0;
left: 0;
z-index: 2;
display: flex;
flex-direction: row;
align-items: center;
justify-content: flex-start;
box-sizing: border-box;
padding: 0 $padding;
.avatar {
width: 100rpx;
height: 100rpx;
border-radius: 50%;
border: solid 4rpx rgba($color: #fff, $alpha: 0.8);
}
.info {
flex: 1;
padding-left: $padding;
.title {
font-size: 34rpx;
font-weight: bold;
color: rgba($color: #fff, $alpha: 0.9);
}
.des {
padding-top: 6rpx;
font-size: 28rpx;
color: rgba($color: #fff, $alpha: 0.8);
}
}
}
}
</style>

View File

@@ -12,12 +12,8 @@
<view>
<view class="vip-lv">{{identity.identity_text}}</view>
<block>
<view class="vip-progress">
<view class="vip-progress-loding" :style="'width:' + firstRule.rate + '%'"></view>
</view>
<view class="vip-loding">
<view>{{firstRule.current}}/{{firstRule.need}}{{firstRule.title}}</view>
</view>
<view class="vip-progress"> <view class="vip-progress-loding" :style="'width:' + firstRule.rate + '%'"></view> </view>
<view class="vip-loding"> <view>{{firstRule.current}}/{{firstRule.need}}{{firstRule.title}}</view> </view>
</block>
</view>
<navigator class="vip-more" url="/pages/vip/agreement?id=2" hover-class="none">成长体系<uni-icons size="14" type="forward" color="#9f5529"></uni-icons></navigator>
@@ -28,7 +24,7 @@
<view class="vip-content-title">距离<text>{{nextIdentity.identity_text}}</text>还需条件</view>
<view class="vip-up-conditions">
<view class="vip-up-conditions-item"><text>10/10</text>家庭会员</view>
<view class="vip-up-conditions-item"><text>9/100</text>邀请家族会员</view>
<view class="vip-up-conditions-item"><text>9/100</text>邀请家族会员</view>
<view class="vip-up-conditions-item"><text>10/10000</text>伙伴</view>
</view>
</block>
@@ -67,6 +63,8 @@
</template>
<script>
var hmAppPay = uni.requireNativePlugin('TestModule');
import { vipHmPay } from '@/apis/interfaces/vip.js';
import { vip, vipPay, payInfo } from '@/apis/interfaces/vip.js'
export default {
data() {
@@ -102,11 +100,24 @@
need : '-',
current: '-',
rate: 0
}
},
// 河马付
orderId : '',
hmPayState: false
};
},
onShow() {
this.getVipInfo()
if(this.hmPayState){
this.$Router.replace({
name : 'hmState',
params : {
type : 'vip',
orderId : this.orderId
}
})
return
}
},
methods: {
// 获取会员信息
@@ -140,6 +151,18 @@
uni.showLoading({
title: '获取支付信息'
})
if(plus.runtime.isApplicationExist({
pname : 'com.eg.android.AlipayGphone',
action : 'alipay://'
})){
this.getHmPayInfo(res.id)
}else{
uni.showToast({
title: '支付失败,请安装支付宝',
icon : 'none'
})
}
return
this.wxPay(res.id)
}
}).catch(err => {
@@ -149,6 +172,26 @@
})
})
},
// 河马支付
getHmPayInfo(order_id){
this.orderId = order_id
vipHmPay(order_id).then(res => {
try{
hmAppPay.gotoNativePage(JSON.stringify(res))
this.hmPayState = true
}catch(e){
uni.showToast({
title: e
})
}
}).catch(err => {
console.log(err)
uni.showToast({
title: err.message,
icon : 'none'
})
})
},
// 微信支付
wxPay(orderId){
payInfo(orderId).then(orderInfo => {

BIN
static/.DS_Store vendored Normal file

Binary file not shown.

BIN
static/book/333.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 231 KiB

BIN
static/book/fire.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

BIN
static/book/pin.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 215 KiB

BIN
static/book/wen.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.4 KiB

BIN
static/chat/.DS_Store vendored Normal file

Binary file not shown.

BIN
static/icon/pay_alipay.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.3 KiB

BIN
static/icon/pay_wbt.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

BIN
static/icon/pay_wechat.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

BIN
static/mission/change.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.1 KiB

BIN
static/mission/diwen.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

BIN
static/mission/mission.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.5 KiB

BIN
static/mission/video.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.0 KiB

BIN
static/news/news.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.2 KiB

BIN
static/rank/mo-null.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

BIN
static/rank/mo.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

BIN
static/store/.DS_Store vendored Normal file

Binary file not shown.

BIN
static/store/fire.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

BIN
static/store/get-more.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 142 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 150 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 143 B

Some files were not shown because too many files have changed in this diff Show More