锶源昆仑会员+体验官

This commit is contained in:
2023-07-22 19:04:56 +08:00
commit 5a6b3517e6
439 changed files with 20654 additions and 0 deletions

31
.eslintrc.js Normal file
View File

@@ -0,0 +1,31 @@
/*
* Eslint config file
* Documentation: https://eslint.org/docs/user-guide/configuring/
* Install the Eslint extension before using this feature.
*/
module.exports = {
env: {
es6: true,
browser: true,
node: true,
},
ecmaFeatures: {
modules: true,
},
parserOptions: {
ecmaVersion: 2018,
sourceType: 'module',
},
globals: {
wx: true,
App: true,
Page: true,
getCurrentPages: true,
getApp: true,
Component: true,
requirePlugin: true,
requireMiniProgram: true,
},
// extends: 'eslint:recommended',
rules: {},
}

3
.vscode/settings.json vendored Normal file
View File

@@ -0,0 +1,3 @@
{
"git.ignoreLimitWarning": true
}

54
api/err.js Normal file
View File

@@ -0,0 +1,54 @@
/**
* 处理错误信息
* @property {Object} errInfo
*/
const errInfo = (obj) =>{
if(obj.status_code == 401){
wx.showModal({
title : "登录提示",
content : "长时间未操作,登录已过期,请重新登录",
showCancel : false,
confirmColor: "#0b0041",
confirmText : "确定",
success : ()=>{
// 清理客户端登录缓存
wx.removeStorageSync("token")
// 返回首页
wx.redirectTo({
url: "/pages/login/index",
})
}
})
}else if(obj.status_code == 422){
wx.showToast({
title: obj.message,
icon : "none"
})
}else if(obj.status_code == 400 || obj.status_code == 0){
wx.showToast({
title: obj.message,
icon : "none"
})
}else if(obj.status_code == 404){
wx.showToast({
title: "接口地址不存在,请联系系统管理员",
icon : "none"
})
}else if(obj.status_code == 500){
wx.showToast({
title: "服务端:" + obj.message,
icon : "none"
})
}else {
wx.showToast({
title: "code:" + obj.status_code + ", msg:" + obj.message,
icon : "none"
})
}
}
module.exports = {
errInfo
}

35
api/index.js Normal file
View File

@@ -0,0 +1,35 @@
/*
* 手太欠
* 愿这世界都如故事里一样 美好而动人~
*/
// 体验官
import index from "./interfaces/index"
// 商城
import mall from "./interfaces/mall"
// 锶人中心
import user from "./interfaces/user"
// 授权登录
import auth from "./interfaces/auth"
// 图片上传
import file from "./interfaces/file"
// 库存
import stock from "./interfaces/stock"
// 档案
import member from "./interfaces/member"
export default{
index,
mall,
user,
auth,
file,
stock,
member
}

21
api/interfaces/auth.js Normal file
View File

@@ -0,0 +1,21 @@
/*
* 手太欠
* 愿这世界都如故事里一样 美好而动人~
*/
import {req} from "../request"
//验证码登录
const smsAuth = data => req({url: "user/auth/sms", method: "POST", data: data})
//获取验证码
const getSms = data => req({url: "user/auth/verify", method: "POST", data: data})
//隐私+协议
const registeragree = (website) => req({url: "cms/pages/" + website})
export default({
smsAuth,
getSms,
registeragree
})

11
api/interfaces/file.js Normal file
View File

@@ -0,0 +1,11 @@
/*
* 图图片上传公用接口
*/
import {upload} from "../request"
//图上传
const uploadImg = (imgPaht, data) => upload({url: "storage/upload", method: "POST", key: "upload", path: imgPaht, data: data})
export default({
uploadImg
})

45
api/interfaces/index.js Normal file
View File

@@ -0,0 +1,45 @@
/*
* 手太欠
* 愿这世界都如故事里一样 美好而动人~
*/
import {req} from "../request"
//首页
const home = () => req({url: "gout"})
//商品详情
const goods = (activity_id) => req({url: "mall/activities/" + activity_id})
//打卡海报背景
const poster = () => req({url: "user/sign/backgrounds"})
//喝水打卡
const sign = () => req({url: "user/sign", method: 'POST'})
//喝水补卡
const replenish = (data) => req({url: "user/sign/replenish", method: 'POST', data: data})
//喝水打卡日历
const calendar = () => req({url: "user/sign"})
//反馈列表
const surveys = (data) => req({url: "gout/surveys", data: data})
//反馈列表
const surveysForm = (data) => req({url: "gout/surveys", method: 'POST', data: data})
//我的反馈前置
const feedback = () => req({url: "gout/result/" + user_case_id + "/logs"})
export default({
home,
goods,
poster,
sign,
replenish,
calendar,
surveys,
surveysForm,
feedback
})

49
api/interfaces/mall.js Normal file
View File

@@ -0,0 +1,49 @@
/*
* 手太欠
* 愿这世界都如故事里一样 美好而动人~
*/
import {req} from "../request"
//商城首页
const index = () => req({url: "mall"})
//商品详情
const goodsShow = (goods) => req({url: "mall/goods/" + goods})
//创建订单
const foundOrder = (data) => req({url: "mall/buy/goods", data: data})
//确认订单
const affirmOrder = (data) => req({url: "mall/buy/goods", method: 'POST', data: data})
//水滴支付
const affirmPay = (order_no) => req({url: "mall/pay/" + order_no + "/score", method: 'POST'})
//文章详情
const articlesSee = (article_id) => req({url: "cms/articles/" + article_id})
// //文章列表
const articlesList = (data) => req({url: "cms/articles", data: data})
//收藏
const favorite = (article_id) => req({url: "cms/articles/favorite/" + article_id})
//点赞
const subscribe = (article_id) => req({url: "cms/articles/subscribe/" + article_id})
//文章列表-全部分类
const classifysAll = () => req({url: "cms/categories"})
//文章列表-全部
const favorites = (data) => req({url: "cms/articles", data: data})
export default({
index,
goodsShow,
foundOrder,
affirmOrder,
affirmPay,
articlesSee,
articlesList,
favorite,
subscribe,
classifysAll,
favorites
})

61
api/interfaces/member.js Normal file
View File

@@ -0,0 +1,61 @@
/*
* 手太欠
* 愿这世界都如故事里一样 美好而动人~
*/
import {req} from "../request"
//添加病例-前置
const goutCreate = () => req({url: "gout/result/create"})
//添加病例
const goutAdd = (data) => req({url: "gout/result", method: 'POST', data: data})
// 查看病例
const goutSee = () => req({url: "gout/result"})
// 添加报告
const AddlastLog = (user_case_id, data) => req({url: "gout/result/" + user_case_id + "/logs", method: 'POST', data: data})
// 报告记录
const ListLog = (user_case_id, data) => req({url: "gout/result/" + user_case_id + "/logs", data: data})
// 健康记录时间轴
const timelSee = (data) => req({url: "gout/result/timelines", data: data})
// 会员权益信息
const identitySee = (identity) => req({url: "user/identities/" + identity})
// 确认开通身份
const identityOpen = (identity_id) => req({url: "user/identities/create/" + identity_id, method: 'POST'})
// 确认开通身份
const identityPay = (order_id, data) => req({url: "user/identities/pay/" + order_id + "/wechat", data: data})
// 激活码支付
const codePay = (order_id, data) => req({url: "user/identities/pay/" + order_id + "/invite", method: 'POST', data: data})
// 体检报告数据
const lastLog = (order_id, data) => req({url: "gout/result/last_log"})
// 开通会员身份
const openIndex = (identity_id, data) => req({url: "user/identities/create/" + identity_id, method: 'POST', data: data})
// 获取小程序openid
const openid = (data) => req({url: "user/auth/mini_openid", data: data})
export default({
goutCreate,
goutAdd,
goutSee,
AddlastLog,
ListLog,
timelSee,
identitySee,
identityOpen,
identityPay,
codePay,
lastLog,
openIndex,
openid
})

42
api/interfaces/stock.js Normal file
View File

@@ -0,0 +1,42 @@
/*
* 手太欠
* 愿这世界都如故事里一样 美好而动人~
* 库存
*/
import {req} from "../request"
//提货前置
const pick = () => req({url: "user/stock/pick"})
//提货列表-记录
const list = (data) => req({url: "user/stock", data: data})
//账变记录
const logs = (data) => req({url: "user/stock/logs", data: data})
//提货提交
const pickTake = (data) => req({url: "user/stock/pick", method: 'POST', data: data})
//省市区-获取
const create = (data) => req({url: "mall/addresses/create", data: data})
//新增地址
const siteAdd = (data) => req({url: "mall/addresses", method: 'POST', data: data})
//地址列表
const siteList = () => req({url: "mall/addresses"})
// 删除地址
const siteDel = (address) => req({url: "mall/addresses/" + address, method: 'DELETE'})
export default({
pick,
list,
logs,
pickTake,
create,
siteAdd,
siteList,
siteDel
})

149
api/interfaces/user.js Normal file
View File

@@ -0,0 +1,149 @@
/*
* 手太欠
* 愿这世界都如故事里一样 美好而动人~
*/
import {req} from "../request"
//首页
const userIndex = () => req({url: "user"})
//订单
const orders = (data) => req({url: "mall/orders", data: data})
//订单详情
const goodsDet = (order_no) => req({url: "mall/orders/" + order_no})
//订单签收
const goodsSign = (order_no) => req({url: "mall/orders/" + order_no + "/sign", method: 'PUT'})
//我的抵值券
const coupon = (data) => req({url: "coupons/user/coupons", data: data})
//我的抵值券列表
const couponList = (coupon_id, data) => req({url: "coupons/user/coupons/" + coupon_id + "/list", data: data})
//现金账户
const account = (data) => req({url: "user/account/balance", data: data})
//我的提现记录
const bankList = (data) => req({url: "withdraws/index", data: data})
//提现前置
const createUser = () => req({url: "withdraws/index/create"})
//提现提交
const bankCash = (data) => req({url: "withdraws/index",method: 'POST', data: data})
//添加账户前置
const create = () => req({url: "withdraws/accounts/create"})
//添加账户
const createAdd = (data) => req({url: "withdraws/accounts", method: 'POST', data: data})
//账户编辑提交
const bankPut = (bank_account_id,data) => req({url: "withdraws/accounts/" + bank_account_id, method: 'PUT', data: data})
//我的银行卡列表
const createList = (data) => req({url: "withdraws/accounts", data: data})
//我的银行卡账户编辑
const bankEdit = (bank_account_id) => req({url: "withdraws/accounts/" + bank_account_id + "/edit"})
//删除银行卡
const bankDel = (bank_account_id) => req({url: "withdraws/accounts/" + bank_account_id, method: 'DELETE'})
//我的伙伴
const relations = (data) => req({url: "user/relations", data: data})
//消息
const notice = () => req({url: "notifications"})
//消息列表
const noticeList = (type,data) => req({url: "notifications/" + type + "/list", data: data})
//消息详情
const noticeShow = (notification_id) => req({url: "notifications/" + notification_id})
//上传头像
const setting = (key,data) => req({url: "user/setting/" + key, method: 'PUT', data: data})
//我的推广码
const invite = () => req({url: "user/invite"})
//水滴账户
const score = (data) => req({url: "user/account/score", data: data})
//激活码管理
const invites = (data) => req({url: "user/invites", data: data})
//微信授权
const authFollow = (data) => req({url: "user/auth/get_auth_url", data: data})
//小程序入库用户数据(微信授权)
const wechatMini = (data) => req({url: "user/socialite/login/wechat/mini/add", method: 'POST', data: data})
//我的推广码
const invitesCode = () => req({url: "user/invite"})
//小开通前置
const identitiesee = (identity_id) => req({url: "user/identities/create/" + identity_id})
//小程序码
const miniShare = (data) => req({url: "user/mini_share", data: data})
//我的收藏
const favorites = (data) => req({url: "user/favorites", data: data})
//产品中心-分类
const mallCategories = (data) => req({url: "mall/categories", data: data})
//产品中心-列表
const mallGoods = (data) => req({url: "mall/goods", data: data})
//任务分类
const taskIndex = () => req({url: "tasks/categories"})
//任务列表
const taskList = (data) => req({url: "tasks", data: data})
//微信运动
const wechatStep = (data) => req({url: "tasks/wechat_step", data: data})
export default({
userIndex,
orders,
goodsDet,
goodsSign,
coupon,
couponList,
account,
bankList,
createUser,
bankCash,
create,
createAdd,
bankPut,
createList,
bankEdit,
bankDel,
relations,
notice,
noticeList,
noticeShow,
setting,
invite,
score,
invites,
authFollow,
wechatMini,
invitesCode,
identitiesee,
miniShare,
favorites,
mallCategories,
mallGoods,
taskIndex,
taskList,
wechatStep
})

136
api/request.js Normal file
View File

@@ -0,0 +1,136 @@
/*
* 手太欠
* 愿这世界都如故事里一样 美好而动人~
*/
import {errInfo} from './err'
import {updToken} from './updateToken'
// 请求方式配置
// https://api.water.shangkelian.cn //测试地址
// https://api.siyuankunlun.com //正式地址
// wxecf8786d25af47b3 正式appid
const api = "https://api.siyuankunlun.com/api/"
const header = {
"Accept" : "application/json"
}
let isToken = true
/**
* 请求
* @property {Object} req
*/
const req = (obj, noToken) => {
// 检查是否无需要token
if(noToken != undefined){
isToken = noToken
}
// header
if(obj.token){
header.Authorization = obj.token || ''
} else {
header.Authorization = wx.getStorageSync("token") || ""
}
// 处理请求信息
return new Promise((resolve, reject) => {
// 组合header
obj.header = {
"Accept" : "application/json",
"Authorization" : wx.getStorageSync("token") || ""
}
if(!isToken){
obj.header.Authorization = ''
}
wx.request({
url : api + obj.url,
header : obj.header || {},
method : obj.method || 'GET',
data : obj.data || {},
success : res => {
// 更新token
if (res.header.Authorization) updToken(res.header.Authorization)
// 处理信息
if (res.data.status_code == 200) {
resolve(res.data)
} else {
if (res.data.status_code == 401 || res.data.status_code == 400) {
reject({
login : false,
codeBeen: false
})
}
errInfo(res.data)
}
},
fail: err => {
wx.showToast({
title : err.errMsg,
icon : "none"
})
reject(err)
},
complete(){
if(!isToken) isToken = true
}
})
})
}
/**
* 上传
* @property {Object} upload
*/
const upload = (obj) => {
// header
header.Authorization = wx.getStorageSync("token") || ""
// 处理上传信息
return new Promise((resolve, reject) => {
wx.showLoading({
title: "上传中..",
mask: true
})
wx.uploadFile({
url : api + obj.url,
header : header,
name : obj.key || "",
filePath: obj.path || "",
formData: obj.data || {},
success : res=>{
wx.hideLoading();
// 处理返回值
let jsonData = JSON.parse(res.data)
// 更新token
if (res.header.Authorization) updToken(res.header.Authorization)
// 处理信息
if (jsonData.status_code == 200) {
resolve(jsonData.data)
} else {
if (jsonData.status_code == 401) {
reject({
login: false
})
}
errInfo(jsonData)
}
},
fail : err=>{
wx.showToast({
title : err.errMsg,
icon : "none"
})
reject(err)
}
})
})
}
module.exports = {
req,
upload
}

21
api/updateToken.js Normal file
View File

@@ -0,0 +1,21 @@
/*
* 手太欠
* 愿这世界都如故事里一样 美好而动人~
*/
/**
* 更新token
* @property {String} updToken
*/
const updToken = (token) =>{
// 更新全局存储器
getApp().globalData.token = token
// 更新客户端登录缓存
wx.setStorageSync('token', token)
}
module.exports = {
updToken
}

106
app.js Normal file
View File

@@ -0,0 +1,106 @@
/*
* 手太欠
* 愿这世界都如故事里一样 美好而动人~
*/
import api from "api/index"
App({
onLaunch(e) {
let { scene } = e
// 检查入口场景值
if(scene === 1011 || scene === 1047 || scene === 1124 || scene === 1089 || scene === 1038){
this.globalData.isOfficial = true
}
// 检查用户登录状态
const token = wx.getStorageSync("token")
if(token){
this.globalData.isUser = true
}
// 检查系统更新
const updateManager = wx.getUpdateManager()
updateManager.onUpdateReady(function () {
wx.showModal({
title : '更新提示',
content : '新版本已经准备好,是否重启应用?',
cancelColor: '#666',
confirmColor: '#e50d01',
success : res=> {
if (res.confirm) {
updateManager.applyUpdate()
}
}
})
})
updateManager.onUpdateFailed(function(){
wx.showModal({
title : '更新提示',
content : '版本更新下载失败,请检查您的网络稍后重试',
showCancel: false,
confirmColor: '#e50d01'
})
})
// 获取系统信息
wx.getSystemInfo({
success: res=>{
this.globalData.systInfo = {
statusBarHeight: res.statusBarHeight,
safeArea : res.safeArea
}
}
})
// 挂载api
wx.$api = api
if(wx.getStorageSync("token")){
wx.$api.user.invite().then(res => {
this.globalData.systInfo = {
invite: res.data.invite
}
}).catch(err => {})
}
// 获取分享
// this.overShare()
// 获取微信步数-云开发
wx.cloud.init({
traceUser: true,
})
},
// 统一分享
overShare () {
//监听路由切换
wx.onAppRoute(() =>{
let pages = getCurrentPages(),
view = pages[pages.length - 1]
if (view) {
wx.showShareMenu({
withShareTicket: true,
menus: ['shareAppMessage', 'shareTimeline'],
})
view.onShareAppMessage = function () {
return {
title: '分享标题',
imageUrl: "https://api.siyuankunlun.com/storage/materials/2022/09/14/code.jpg",
path: '/pages/index/index?invite=' + this.globalData.systInfo.invite
};
}
}
})
},
globalData: {
systInfo : '',
isUser : false,
token : "",
isOfficial : false,
invite : "",
safeArea : '',
statusBarHeight: wx.getSystemInfoSync().statusBarHeight,
jiaonangheight: wx.getMenuButtonBoundingClientRect().height
}
})

100
app.json Normal file
View File

@@ -0,0 +1,100 @@
{
"pages": [
"pages/mall/index/index",
"pages/mall/buy/index",
"pages/index/index",
"pages/user/index",
"pages/login/index",
"pages/webView/index",
"pages/record/index/index",
"pages/record/report/index",
"pages/record/list/index",
"pages/record/healthy/index",
"pages/order/list/index",
"pages/order/details/index",
"pages/stock/index/index",
"pages/stock/site/index",
"pages/stock/addSite/index",
"pages/stock/take/index",
"pages/stock/list/index",
"pages/coupons/list/index",
"pages/coupons/organize/index",
"pages/account/index/index",
"pages/account/withdraw/index",
"pages/account/withdrawList/index",
"pages/account/bankList/index",
"pages/account/bankAdd/index",
"pages/code/index",
"pages/recommend/index",
"pages/news/list/index",
"pages/news/details/index",
"pages/news/classify/index",
"pages/about/index",
"pages/stock/detailed/index",
"pages/stock/examine/index",
"pages/account/tips/index",
"pages/member/index/index",
"pages/member/look/index",
"pages/member/rights/index",
"pages/member/open/index",
"pages/mall/submit/index",
"pages/mall/mallOrder/index",
"pages/mall/details/index",
"pages/login/agreement/index",
"pages/water/index",
"pages/bond/index",
"pages/bond/tips/index",
"pages/sign/index",
"pages/index/write/index",
"pages/index/feeling/index",
"pages/record/reportSee/index",
"pages/bond/activation/index",
"pages/memberOpen/index",
"pages/mall/article/articleList/index",
"pages/mall/article/articleInfo/index",
"pages/mall/exhibition/index",
"pages/user/collect/index",
"pages/user/goods/index",
"pages/mall/article/articleAll/index"
],
"window": {
"backgroundTextStyle": "light",
"navigationBarBackgroundColor": "#fff",
"navigationBarTitleText": "锶源昆仑",
"navigationBarTextStyle": "black"
},
"tabBar": {
"list": [
{
"pagePath": "pages/mall/index/index",
"text": "水滴商城",
"iconPath": "/static/tabBarIcon/00.png",
"selectedIconPath": "/static/tabBarIcon/00_active.png"
},
{
"pagePath": "pages/index/index",
"text": "体验官",
"iconPath": "/static/tabBarIcon/02.png",
"selectedIconPath": "/static/tabBarIcon/02_active.png"
},
{
"pagePath": "pages/memberOpen/index",
"text": "开通会员",
"iconPath": "/static/tabBarIcon/03.png",
"selectedIconPath": "/static/tabBarIcon/03_active.png"
},
{
"pagePath": "pages/user/index",
"text": "锶人中心",
"iconPath": "/static/tabBarIcon/01.png",
"selectedIconPath": "/static/tabBarIcon/01_active.png"
}
],
"color": "#b6b9bb",
"selectedColor": "#6c78f8",
"borderStyle": "white"
},
"style": "v2",
"sitemapLocation": "sitemap.json",
"lazyCodeLoading": "requiredComponents"
}

79
app.wxss Normal file
View File

@@ -0,0 +1,79 @@
/**app.wxss**/
.container {
height: 100%;
display: flex;
flex-direction: column;
align-items: center;
justify-content: space-between;
padding: 200rpx 0;
box-sizing: border-box;
}
/* 上拉加载 */
.pagesLoding {
text-align: center;
line-height: 90rpx;
color: gray;
font-size: 28rpx;
}
.pagesLoding-icon {
width: 28rpx;
height: 28rpx;
vertical-align: middle;
margin-right: 10rpx;
margin-bottom: 3rpx;
}
/*
* 文字截取
*/
.nowrap {
max-width: 100%;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
.nowrap-multi {
display: -webkit-box;
overflow: hidden;
text-overflow: ellipsis;
-webkit-box-orient: vertical;
-webkit-line-clamp: 2;
}
/*
* 水平居中
*/
.pack-center {
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-box-pack: center;
position: absolute;
left: 0;
right: 0;
top: 0;
bottom: 0;
z-index: -1;
}
/*
* 页面信息提醒
*/
.pages-hint {
text-align: center;
color: #747788;
font-size: 28rpx;
background: white;
}
.pages-hint image {
width: 188rpx;
height: 188rpx;
}

28
pages/about/index.js Normal file
View File

@@ -0,0 +1,28 @@
/*
* 手太欠
* 愿这世界都如故事里一样 美好而动人~
*/
Page({
/**
* 页面的初始数据
*/
data: {
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
},
})

4
pages/about/index.json Normal file
View File

@@ -0,0 +1,4 @@
{
"usingComponents": {},
"navigationBarTitleText": "锶源昆仑"
}

1
pages/about/index.wxml Normal file
View File

@@ -0,0 +1 @@
<image class="product" src="http://api.siyuankunlun.com/storage/materials/2022/09/05/productimg.jpg" mode="widthFix"></image>

3
pages/about/index.wxss Normal file
View File

@@ -0,0 +1,3 @@
.product {
width: 100%;
}

View File

@@ -0,0 +1,99 @@
/*
* 手太欠
* 愿这世界都如故事里一样 美好而动人~
*/
Page({
/**
* 页面的初始数据
*/
data: {
banksArr : [], //银行列表
banksIndex: 0, //银行列表下标
banksId : '', //银行列表id
disabled : false ,// 提交按钮状态
bankData : '', //编辑信息
ediStatet : '', //是否为编辑
bankId : '',
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
if (options) {
this.setData({
ediStatet: options.edistatet,
bankId : options.bankid
})
}
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
// 获取账户前置
this.createInfo();
// 获取编辑信息前置
if( this.data.ediStatet == 'compile') {
this.createEdit();
}
},
/**
* 账户前置
*/
createInfo() {
wx.$api.user.create().then(res => {
this.setData({
banksArr: res.data.banks
})
}).catch(err => {})
},
/**
* 选择银行
*/
banksBind(e) {
this.setData({
banksIndex: e.detail.value
})
},
/**
* 编辑信息前置
*/
createEdit() {
wx.$api.user.bankEdit(this.data.bankId).then(res => {
let areasValue = res.data.banks.findIndex(val=> val.name == res.data.info.bank.name)
this.setData({
banksIndex: areasValue,
bankData : res.data.info
})
}).catch(err => {})
},
// 添加账户
banksForm(e) {
let value = e.detail.value
let bankId = this.data.banksArr[this.data.banksIndex].id
let data = {
bank_id : bankId,
name : value.name,
mobile : value.mobile,
no : value.no
}
let urlData = wx.$api.user.createAdd(data)
// 编辑账户
if(this.data.ediStatet == 'compile') urlData = wx.$api.user.bankPut(this.data.bankId,data)
urlData.then(res => {
this.setData({
disabled: true
})
wx.navigateBack()
}).catch(err => {})
},
})

View File

@@ -0,0 +1,4 @@
{
"usingComponents": {},
"navigationBarTitleText": "添加银行卡"
}

View File

@@ -0,0 +1,28 @@
<form class="issue-form" bindsubmit="banksForm">
<view class="issue-block">
<view class="issue-inputs">
<label class="issue-input-label">支行名称</label>
<picker class="issue-inputs-input" bindchange="banksBind" value="{{banksIndex}}" range="{{banksArr}}" range-key="name">
<view class="tabs-text">
{{banksArr[banksIndex].name}}
</view>
</picker>
<image class="issue-input-arrow" src="/static/icons/userLogin_icon.png"></image>
</view>
<view class="issue-inputs">
<label class="issue-input-label">收款人</label>
<input class="issue-inputs-input" maxlength="4" placeholder="输入收款人姓名" name="name" type="text" value="{{bankData.name}}"></input>
</view>
<view class="issue-inputs">
<label class="issue-input-label">手机号</label>
<input class="issue-inputs-input" maxlength="11" placeholder="输入收款人手机号" name="mobile" type="number" value="{{bankData.mobile}}"></input>
</view>
<view class="issue-inputs">
<label class="issue-input-label">银行卡号</label>
<input class="issue-inputs-input" placeholder="输入银行卡号" name="no" type="number" value="{{bankData.no}}"></input>
</view>
</view>
<view class="userdata-btn">
<button class="issue-btn" form-type="submit" disabled="{{disabled}}">立即保存</button>
</view>
</form>

View File

@@ -0,0 +1,88 @@
page {
background: #f3f4f6;
}
.case {
border-bottom: 160rpx solid transparent;
}
.issue-title {
padding: 30rpx;
font-weight: 600;
}
.issue-block {
background: white;
margin-bottom: 20rpx;
}
.issue-inputs {
position: relative;
height: 110rpx;
line-height: 110rpx;
padding: 0 30rpx;
box-sizing: border-box;
border-bottom: 2rpx solid #f2f2f2;
display: flex;
}
.issue-input-arrow {
width: 32rpx;
height: 32rpx;
position: absolute;
top: 32rpx;
right: 20rpx;
}
.issue-input-label {
width: 170rpx;
}
.issue-inputs-input {
padding-left: 40rpx;
box-sizing: border-box;
line-height: 110rpx;
height: 110rpx;
width: 100%;
}
.uni-input-img {
width: 32rpx;
height: 32rpx;
position: absolute;
right: 0;
top: 30rpx;
}
/* 按钮 */
.userdata-btn {
width: 100%;
box-sizing: border-box;
padding: 30rpx;
position: fixed;
bottom: 0;
left: 0;
z-index: 99;
right: 0;
background: white;
}
.issue-btn {
background: #1d37e2;
text-align: center;
color: white;
height: 90rpx;
line-height: 90rpx;
font-size: 34rpx;
font-weight: normal;
width: 100% !important;
margin: 0;
padding: 0;
border-radius: 10rpx;
}
.issue-btn[disabled] {
background: #1d37e2 !important;
color: #fff !important;
}

View File

@@ -0,0 +1,115 @@
/*
* 手太欠
* 愿这世界都如故事里一样 美好而动人~
*/
Page({
/**
* 页面的初始数据
*/
data: {
createArr : [] , //列表
page : {}, //分页信息
type : '', //类型
lodingStats : false, //加载状态
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
this.setData({
type: options.type
})
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
// 获取我的账户
this.createInfo();
},
// 我的银行卡
createInfo(page){
wx.$api.user.createList({page : page || 1}).then(res => {
let listArr = this.data.createArr,
newData = []
if(page == 1 || page == undefined) listArr = []
newData = listArr.concat(res.data.data)
this.setData({
createArr : newData,
page : res.data.page,
lodingStats : false
})
wx.stopPullDownRefresh()
}).catch(err => {})
},
// 删除地址
bankRemove(e){
let newid = e.currentTarget.dataset.id
let list = this.data.createArr
wx.showModal({
title : '提示',
content : '是否删除银行卡',
success : res=> {
if (res.confirm) {
wx.showLoading({
title: '删除中',
})
wx.$api.user.bankDel(newid).then(res=>{
this.setData({
createArr: list
})
wx.showToast({
title: res.data,
icon : "none"
})
wx.hideLoading()
// 获取我的账户
this.createInfo();
})
}
}
})
},
/**
* 选择地址
*/
BankClick(e){
let atAdds = this.data.createArr[e.currentTarget.dataset.index]
let pages = getCurrentPages(),
prepage = pages[pages.length-2]
prepage.setData({
accounts: atAdds
})
wx.navigateBack()
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
// 获取我的账户
this.createInfo();
},
/**
* 上拉加载
*/
onReachBottom(){
this.setData({
lodingStats: true
})
let pageNumber = this.data.page.current
if(this.data.page.has_more){
pageNumber++
// 获取我的账户
this.createInfo(pageNumber);
}
}
})

View File

@@ -0,0 +1,3 @@
{
"usingComponents": {}
}

View File

@@ -0,0 +1,55 @@
<view class="title">
<view class="title-name">
我的卡<text>(共{{createArr.length}}张)</text>
</view>
<navigator hover-class="none" url="../bankAdd/index" class="title-add">
<image src="/static/icons/bank_add.png"></image>添加银行卡
</navigator>
</view>
<view class="list" wx:if="{{createArr.length > 0}}">
<view class="item" wx:for="{{createArr}}" wx:key="createArr">
<view class="item-logo">
<image src="{{item.bank.cover}}"></image>
</view>
<view class="item-text">
<view class="item-top">
<view class="item-title">
{{item.bank.name}}
</view>
<view class="item-name">
{{item.name}}
</view>
</view>
<view class="item-number">
{{item.no}}
</view>
</view>
<view class="item-tool">
<view class="item-left" wx:if="{{type == 'selectBank'}}">
<view class="item-tool-btn" bindtap="BankClick" data-index="{{index}}">
选择此账户
</view>
</view>
<view class="item-btn">
<navigator hover-class="none" url="../bankAdd/index?edistatet=compile&bankid={{item.bank_account_id}}" class="item-tool-btn">
<image src="/static/icons/bank_edit.png"></image>编辑
</navigator>
<view class="item-tool-btn" bindtap="bankRemove" data-index="{{index}}" data-id="{{item.bank_account_id}}">
<image src="/static/icons/bank_del.png"></image>删除
</view>
</view>
</view>
</view>
<view class="pagesLoding" wx:if="{{lodingStats}}">
<block wx:if="{{page.has_more}}">
<image class="pagesLoding-icon" src="/static/icon/refresh_loding.gif" mode="widthFix"></image>加载中...
</block>
<block wx:else>
没有更多了~
</block>
</view>
</view>
<view class="pack-center pages-hint" wx:else>
<image src="/static/imgs/coupon_null.png"></image>
<view>暂无数据</view>
</view>

View File

@@ -0,0 +1,130 @@
page {
background: #f4f5f9;
padding: 30rpx;
box-sizing: border-box;
}
.title {
display: flex;
margin-bottom: 30rpx;
line-height: 54rpx;
}
.title-name {
flex: 1;
font-weight: 600;
}
.title-name text {
color: #9d9d9d;
font-weight: normal;
}
.title-add {
background-color: #e2ecff;
display: inline-block;
font-size: 28rpx;
line-height: 54rpx;
padding: 0 15rpx;
border-radius: 50rpx;
}
.title-add image {
width: 34rpx;
height: 34rpx;
vertical-align: middle;
margin-right: 6rpx;
}
.item {
background-image: linear-gradient(to top left, #3b61ce, #3f8ad4);
border-radius: 30rpx;
margin-bottom: 30rpx;
position: relative;
padding: 30rpx;
box-sizing: border-box;
}
.item:nth-child(even) {
background-image: linear-gradient(to top left, #e7796e, #e35d65);
}
.item-logo {
width: 100rpx;
height: 100rpx;
border-radius: 50%;
overflow: hidden;
background-color: #ffffff;
padding: 20rpx;
box-sizing: border-box;
}
.item-logo image {
width: 100%;
height: 100%;
}
.item-text {
position: absolute;
left: 0;
top: 0;
width: 100%;
padding: 30rpx 30rpx 30rpx 160rpx;
box-sizing: border-box;
}
.item-top {
display: flex;
color: #ffffff;
font-size: 34rpx;
line-height: 50rpx;
}
.item-title {
flex: 1;
margin-bottom: 5rpx;
}
.item-name {
font-size: 32rpx;
}
.item-number {
color: #e9f3ff;
}
.item-tool {
display: flex;
margin-top: 40rpx;
}
.item-left {
flex: 1;
}
.item-btn {
text-align: right;
}
.item-tool-btn {
margin-left: 30rpx;
}
.item-tool-btn {
background-color: rgba(255, 255, 255, .4);
color: #ffffff;
border-radius: 6rpx;
height: 48rpx;
display: inline-block;
line-height: 48rpx;
font-size: 26rpx;
padding: 0 20rpx;
}
.item-tool-btn image {
width: 26rpx;
height: 26rpx;
vertical-align: -2rpx;
margin-right: 5rpx;
}

View File

@@ -0,0 +1,97 @@
/*
* 手太欠
* 愿这世界都如故事里一样 美好而动人~
*/
Page({
/**
* 页面的初始数据
*/
data: {
accounts : '', //数额
logsArr : [], // 提货列表数据
listType : 'income', //列表分类
page : {}, //分页信息
lodingStats : false, //加载状态
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
// 获取账户信息
this.accountInfo()
},
/**
* 账户信息
*/
accountInfo(page){
let urlPage = wx.$api.user.account
if(this.data.listType == 'withdrawal'){
urlPage = wx.$api.user.bankList
}
urlPage({
page : page || 1
}).then(res => {
let listArr = this.data.logsArr,
newData = [],
newPage = ''
if(page == 1 || page == undefined) listArr = []
newData = listArr.concat(res.data.logs.data)
newPage = res.data.logs.page
if(this.data.listType == 'withdrawal'){
newData = listArr.concat(res.data.lists.data)
newPage = res.data.lists.page
}
this.setData({
accounts : res.data.account,
logsArr : newData,
page : newPage,
lodingStats : false
})
wx.stopPullDownRefresh()
}).catch(err => {})
},
/**
* 状态筛选
*/
onTabs(val){
if(this.data.listType === val.currentTarget.dataset.type) return
this.setData({
listType: val.currentTarget.dataset.type
})
// 获取账户信息
this.accountInfo();
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
// 获取账户信息
this.accountInfo();
},
/**
* 上拉加载
*/
onReachBottom(){
this.setData({
lodingStats: true
})
let pageNumber = this.data.page.current
if(this.data.page.has_more){
pageNumber++
// 获取账户信息
this.accountInfo(pageNumber);
}
}
})

View File

@@ -0,0 +1,4 @@
{
"usingComponents": {},
"navigationBarTitleText": "现金账户"
}

View File

@@ -0,0 +1,62 @@
<view class="cashBack">
<image class="cashBack-img" src="http://api.siyuankunlun.com/storage/materials/2022/09/14/cash_back.png" mode="aspectFill"></image>
<view class="cashBack-text">
<view class="cashBack-total">
<view class="cashBack-item">
账户总金额(元)
<text>{{accounts.balance}}</text>
</view>
<navigator hover-class="none" url="../withdraw/index" class="cashBack-btn">
提现到银行卡
</navigator>
</view>
<view class="cashBack-top">
<view class="cashBack-item">
昨日收益金额(元)
<text>{{accounts.yesterday}}</text>
</view>
<view class="cashBack-item">
提现金额(元)
<text>{{accounts.withdraw}}</text>
</view>
</view>
</view>
</view>
<view class="record">
<view class="title">
<text class="{{listType == 'income' ? 'active' : ''}}" bindtap="onTabs" data-type="income">账变记录</text>
<text class="{{listType == 'withdrawal' ? 'active' : ''}}" bindtap="onTabs" data-type="withdrawal">提现记录</text>
</view>
<view class="list" wx:if="{{logsArr.length > 0}}">
<view class="item" wx:for="{{logsArr}}" wx:key="logsArr">
<view class="top">
<view class="name">
{{listType == 'income' ? item.remark : item.way}}
<block wx:if="{{item.status}}">
<view class="state {{item.status.status == 2 ? 'red' : ''}}" wx:if="{{listType == 'withdrawal'}}">
{{item.status.status_text}}
</view>
</block>
</view>
<view class="time">
{{listType == 'income' ? item.created_at : item.create_at}}
</view>
</view>
<view class="number">
{{item.amount}}
</view>
</view>
<view class="pagesLoding" wx:if="{{lodingStats}}">
<block wx:if="{{page.has_more}}">
<image class="pagesLoding-icon" src="/static/icon/refresh_loding.gif" mode="widthFix"></image>加载中...
</block>
<block wx:else>
没有更多了~
</block>
</view>
</view>
<view class="pages-no" wx:else>
<image src="/static/imgs/record_null.png" mode="widthFix"></image>
<view>~暂无数据哦~</view>
</view>
</view>

View File

@@ -0,0 +1,171 @@
page {
padding: 30rpx;
box-sizing: border-box;
}
.cashBack {
width: 100%;
border-radius: 10rpx;
padding-top: 50%;
position: relative;
overflow: hidden;
box-shadow: 0 4rpx 10rpx 6rpx #f5d473;
}
.cashBack-img {
position: absolute;
width: 100%;
height: 100%;
top: 0;
left: 0;
}
.cashBack-text {
position: absolute;
width: 100%;
height: 100%;
top: 0;
left: 0;
z-index: 9;
padding: 40rpx;
box-sizing: border-box;
}
.cashBack-total {
margin-bottom: 40rpx;
font-size: 30rpx;
position: relative;
}
.cashBack-total text {
display: block;
font-size: 56rpx;
margin-top: 10rpx;
font-weight: 600;
}
.cashBack-btn {
position: absolute;
top: 20rpx;
right: 0;
background-color: #000000;
color: #ffffff;
border-radius: 70rpx;
line-height: 80rpx;
padding: 0 35rpx;
}
.cashBack-top {
margin-bottom: 30rpx;
display: flex;
}
.cashBack-item {
flex: 2;
font-size: 30rpx;
}
.cashBack-item text {
display: block;
font-weight: 600;
font-size: 42rpx;
margin-top: 10rpx;
}
.record {
margin-top: 30rpx;
}
.title {
display: flex;
font-size: 34rpx;
}
.title text {
display: block;
flex: 2;
text-align: center;
line-height: 90rpx;
color: #9d9d9d;
position: relative;
}
.title text::after {
position: absolute;
content: '';
left: calc(50% - 25rpx);
bottom: 0;
width: 50rpx;
height: 6rpx;
background-color: #000000;
display: none;
}
.title text.active {
color: #000000;
}
.title text.active::after {
display: block;
}
.list {
margin-top: 40rpx;
}
.item {
margin-bottom: 30rpx;
padding-bottom: 30rpx;
border-bottom: 2rpx solid #f2f2f2;
display: flex;
}
.top {
flex: 1;
}
.name {
margin-bottom: 10rpx;
display: flex;
}
.state {
font-size: 26rpx;
border: 2rpx solid green;
color: green;
border-radius: 10rpx;
margin-left: 20rpx;
padding: 0 10rpx;
height: 36rpx;
line-height: 36rpx;
margin-top: 2rpx;
}
.state.red {
color: red;
border-color: red;
}
.time {
font-size: 26rpx;
color: #9d9d9d;
}
.number {
line-height: 92rpx;
text-align: right;
font-size: 34rpx;
font-weight: 600;
}
.pages-no {
text-align: center;
padding: 180rpx 0 30rpx;
color: #9d9d9d;
font-size: 28rpx;
}
.pages-no image {
width: 180rpx;
padding-bottom: 20rpx;
}

View File

@@ -0,0 +1,30 @@
/*
* 手太欠
* 愿这世界都如故事里一样 美好而动人~
*/
Page({
/**
* 页面的初始数据
*/
data: {
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
},
})

View File

@@ -0,0 +1,3 @@
{
"usingComponents": {}
}

View File

@@ -0,0 +1,9 @@
<view class="examine">
<image src="http://api.siyuankunlun.com/storage/materials/2022/09/14/examine.png" mode="widthFix"></image>
<view class="text">
<view class="title">提交成功</view>
<view class="time">预计审核时间1个工作日</view>
<view class="time">申请提现成功,等待管理员审核</view>
</view>
<navigator hover-class="none" open-type="navigateBack" class="return">返回</navigator>
</view>

View File

@@ -0,0 +1,33 @@
.examine {
padding: 240rpx 0 30rpx;
box-sizing: border-box;
text-align: center;
}
.examine image {
width: 35%;
margin: 0 auto 30rpx;
}
.title {
font-weight: 600;
font-size: 42rpx;
margin-bottom: 30rpx;
}
.time {
color: #999999;
line-height: 50rpx;
}
.return {
display: inline-block;
margin-top: 80rpx;
background-color: #1d37e2;
padding: 0 180rpx;
height: 90rpx;
line-height: 90rpx;
border-radius: 10rpx;
box-shadow: 0 3rpx 6rpx 4rpx rgba(6, 34, 214, .6);
color: #FFFFFF;
}

View File

@@ -0,0 +1,102 @@
/*
* 手太欠
* 愿这世界都如故事里一样 美好而动人~
*/
Page({
/**
* 页面的初始数据
*/
data: {
balance : '', //金额
accounts : '', //账户列表
amount : '', //提现金额
disabled : false ,// 提交按钮状态
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
// 获取账户前置
this.createInfo();
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {},
/**
* 账户前置
*/
createInfo() {
wx.$api.user.createUser().then(res => {
this.setData({
balance : res.data.balance,
accounts : res.data.bank_account
})
}).catch(err => {})
},
/**
* 输入商品数量
*/
goodsNumberInput(e) {
let goodsNum = (e.detail.value.match(/^\d*(\.?\d{0,2})/g)[0])
if (goodsNum > 0) {
if(parseFloat(goodsNum) > parseFloat(this.data.balance)){
wx.showToast({
title: '提现金额不能大于总金额',
icon: 'none'
});
return
}
this.setData({
amount: goodsNum
})
} else {
uni.showToast({
title: '商品数量不能小于1',
icon: 'none'
});
this.setData({
amount: 1
})
}
},
/**
* 全部提现
*/
allCash() {
this.setData({
amount: this.data.balance
})
},
//提现
banksForm() {
let data = {
bank_account_id : this.data.accounts.bank_account_id,
amount : this.data.amount,
type : 1
}
wx.$api.user.bankCash(data).then(() => {
this.setData({
disabled: true
})
// 跳到审核页面
wx.redirectTo({
url: "../tips/index"
})
}).catch(err => {
uni.showToast({
title: err.message,
icon : 'none'
})
})
}
})

View File

@@ -0,0 +1,4 @@
{
"usingComponents": {},
"navigationBarTitleText": "提现银行卡"
}

View File

@@ -0,0 +1,39 @@
<view class="money">
<navigator hover-class="none" url="../withdrawList/index" class="money-logs">
提现记录
</navigator>
<view class="money-tips">当前余额(元)</view>
<view class="money-number">{{balance}}</view>
</view>
<form class="issue-form" bindsubmit="banksForm">
<navigator hover-class="none" url="../bankList/index?type=selectBank" class="issue-pay" wx:if="{{accounts}}">
<view class="name">
到账方式
</view>
<view class="bank">
<image src="{{accounts.bank.cover}}" mode="aspectFill"></image> {{accounts.bank.name}}
</view>
<image class="issue-input-arrow" src="/static/icons/userLogin_icon.png"></image>
</navigator>
<navigator hover-class="none" url="../bankList/index" class="issue-add" wx:else>
<image src="/static/icons/banks.png" mode=""></image>添加银行账户
</navigator>
<view class="issue-cash">
<view class="title">提现金额</view>
<view class="entry">
<view class="entry-price">
<text>¥</text>
<input bindblur="goodsNumberInput" type="text" placeholder="0.00" value="{{amount}}"></input>
</view>
<view class="entry-all" bindtap="allCash">
全部
</view>
</view>
<view class="tips">
输入的金额不能大于{{balance}}
</view>
</view>
<view class="userdata-btn">
<button class="issue-btn" form-type="submit" disabled="{{disabled}}">立即提现</button>
</view>
</form>

View File

@@ -0,0 +1,155 @@
page {
background-color: #f2f2f2;
}
.money {
background-image: linear-gradient(to bottom right, #1c37e2, #6a91dd);
text-align: center;
color: #ffffff;
padding: 30rpx 30rpx 50rpx;
box-sizing: border-box;
}
.money-logs {
text-align: right;
margin-bottom: 30rpx;
}
.money-tips {
opacity: .8;
}
.money-number {
line-height: 110rpx;
font-size: 56rpx;
font-weight: 600;
}
.issue-form {
padding: 30rpx;
box-sizing: border-box;
display: block;
}
.issue-pay {
background-color: #fff;
padding: 0 30rpx;
box-sizing: border-box;
border-radius: 10rpx;
display: flex;
line-height: 110rpx;
position: relative;
}
.name {
flex: 1;
color: #1e2540;
}
.bank {
padding-right: 20rpx;
display: flex;
}
.bank image {
width: 34rpx;
height: 34rpx;
border-radius: 50%;
margin: 40rpx 10rpx 0 0;
}
.issue-input-arrow {
width: 30rpx;
height: 30rpx;
position: absolute;
top: 42rpx;
right: 20rpx;
}
.issue-add {
background-color: #fff;
border-radius: 10rpx;
line-height: 110rpx;
text-align: center;
}
.issue-add image {
width: 34rpx;
height: 34rpx;
vertical-align: -6rpx;
padding-right: 10rpx;
}
.issue-cash {
margin: 30rpx 0;
background-color: #fff;
padding: 30rpx;
box-sizing: border-box;
border-radius: 10rpx;
}
.title {
color: #1e2540;
}
.entry {
margin: 10rpx 0 20rpx;
border-bottom: 2rpx solid #d9dbe4;
display: flex;
line-height: 110rpx;
}
.entry-price {
flex: 1;
font-weight: 600;
font-size: 56rpx;
color: #1e2540;
display: flex;
}
.entry-price input {
height: 110rpx;
line-height: 110rpx;
font-size: 56rpx;
}
.entry-price text {
font-size: 46rpx;
padding-right: 10rpx;
}
.entry-all {
color: #2858d0;
font-size: 30rpx;
}
.tips {
color: #c64a52;
font-size: 30rpx;
}
/* 按钮 */
.userdata-btn {
width: 100%;
background: white;
margin-top: 90rpx;
}
.issue-btn {
background: #1d37e2;
text-align: center;
color: white;
height: 90rpx;
line-height: 90rpx;
font-size: 34rpx;
font-weight: normal;
width: 100% !important;
margin: 0;
padding: 0;
border-radius: 10rpx;
}
.issue-btn[disabled] {
background: #1d37e2 !important;
color: #fff !important;
}

View File

@@ -0,0 +1,74 @@
/*
* 手太欠
* 愿这世界都如故事里一样 美好而动人~
*/
Page({
/**
* 页面的初始数据
*/
data: {
logsArr : [], // 提货列表数据
score : '', //总数量
page : {}, //分页信息
lodingStats : false, //加载状态
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
// 获取提现记录
this.accountInfo();
},
/**
* 提现记录
*/
accountInfo (page){
wx.$api.user.bankList({
page: page
}).then(res => {
let listArr = this.data.logsArr,
newData = []
if(page == 1 || page == undefined) listArr = []
newData = listArr.concat(res.data.lists.data)
this.setData({
logsArr : newData,
page : res.data.lists.page,
lodingStats : false
})
wx.stopPullDownRefresh()
}).catch(err => { })
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
// 获取提现记录
this.accountInfo();
},
/**
* 上拉加载
*/
onReachBottom(){
this.setData({
lodingStats: true
})
let pageNumber = this.data.page.current
if(this.data.page.has_more){
pageNumber++
// 获取提现记录
this.accountInfo(pageNumber);
}
}
})

View File

@@ -0,0 +1,4 @@
{
"usingComponents": {},
"navigationBarTitleText": "提现记录"
}

View File

@@ -0,0 +1,35 @@
<view class="list" wx:if="{{logsArr.length > 0}}">
<view class="item" wx:for="{{logsArr}}" wx:key="index">
<view class="top">
<view class="name">
{{item.way}}
</view>
<view class="time">
{{item.create_at}}
</view>
</view>
<block wx:if="{{item.status}}">
<view class="state {{item.status.status == 1 ? 'green' : ''}}" wx:if="{{item.status.status == 1}}">
{{item.status.status_text}}
</view>
<view class="state {{item.status.status == 2 ? 'red' : ''}}" wx:else>
{{item.status.status_text}}
</view>
</block>
<view class="number">
{{item.amount}}
</view>
</view>
<view class="pagesLoding" wx:if="{{lodingStats}}">
<block wx:if="{{page.has_more}}">
<image class="pagesLoding-icon" src="/static/icon/refresh_loding.gif" mode="widthFix"></image>加载中...
</block>
<block wx:else>
没有更多了~
</block>
</view>
</view>
<view class="pack-center pages-hint" wx:else>
<image src="/static/imgs/record_null.png" mode="widthFix"></image>
<view>~暂无数据哦~</view>
</view>

View File

@@ -0,0 +1,52 @@
page {
padding: 30rpx;
box-sizing: border-box;
}
.item {
margin-bottom: 30rpx;
padding-bottom: 30rpx;
border-bottom: 2rpx solid #f2f2f2;
display: flex;
}
.top {
width: 45%;
}
.name {
margin-bottom: 10rpx;
}
.time {
font-size: 26rpx;
color: #9d9d9d;
}
.state {
width: 30%;
text-align: center;
line-height: 92rpx;
font-size: 30rpx;
color: #949494;
}
.state.green {
color: green;
}
.state.red {
color: red;
}
.number {
width: 25%;
line-height: 92rpx;
text-align: right;
font-size: 34rpx;
font-weight: 600;
}
.number.active {
color: green;
}

View File

@@ -0,0 +1,95 @@
/*
* 手太欠
* 愿这世界都如故事里一样 美好而动人~
*/
Page({
/**
* 页面的初始数据
*/
data: {
invitesArr : [], //记录列表
page : {}, //分页信息
lodingStats : false, //加载状态
status : 2 //状态
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
// 获取激活码数据
this.invitesInfo();
},
// 激活码数据
invitesInfo(page) {
wx.$api.user.invites({
status: this.data.status,
page : page || 1
}).then(res => {
let listArr = this.data.invitesArr,
newData = []
if(page == 1 || page == undefined) listArr = []
newData = listArr.concat(res.data.data)
this.setData({
invitesArr : newData,
page : res.data.page,
lodingStats: false
})
wx.stopPullDownRefresh()
}).catch(err => {})
},
// 状态筛选
onTabs(val){
if(this.data.status === val.currentTarget.dataset.type) return
this.setData({
status: val.currentTarget.dataset.type,
page : {}
})
// 获取激活码数据
this.invitesInfo();
},
// 复制激活码
copyClick(val) {
wx.setClipboardData({
data: val.currentTarget.dataset.code,
success: () => {
wx.showToast({
title: "复制成功",
icon : "none"
})
}
})
},
// 页面相关事件处理函数--监听用户下拉动作
onPullDownRefresh() {
// 获取激活码数据
this.invitesInfo();
},
// 上拉加载
onReachBottom(){
this.setData({
lodingStats: true
})
let pageNumber = this.data.page.current
if(this.data.page.has_more){
pageNumber++
// 商品列表数据
this.lastInfo(pageNumber);
}
}
})

View File

@@ -0,0 +1,4 @@
{
"usingComponents": {},
"navigationBarTitleText": "激活码管理"
}

View File

@@ -0,0 +1,42 @@
<view class="tabs">
<view class="tabs-item {{status == 2 ? 'show' : ''}}" bindtap="onTabs" data-type="2">未使用</view>
<view class="tabs-item {{status == 3 ? 'show' : ''}}" bindtap="onTabs" data-type="3">已使用</view>
</view>
<view class="list" wx:if="{{invitesArr.length > 0}}">
<view class="item" wx:for="{{invitesArr}}" wx:key="invitesArr">
<view class="top">
<view class="code">{{item.code}}</view>
<view class="copy" bindtap="copyClick" data-code="{{item.code}}">复制激活码</view>
</view>
<view class="label" wx:if="{{item.activeUser}}">
<view class="label-item">
<view class="label-name">
用户手机号
</view>
<view class="label-text">
{{item.user.username}}
</view>
</view>
<view class="label-item">
<view class="label-name">
使用时间
</view>
<view class="label-text">
{{item.actived_at}}
</view>
</view>
</view>
</view>
<view class="pagesLoding" wx:if="{{lodingStats}}">
<block wx:if="{{page.has_more}}">
<image class="pagesLodingIcon" src="/static/icons/refresh_loding.gif" mode="widthFix"></image>加载中...
</block>
<block wx:else>
没有更多了~
</block>
</view>
</view>
<view class="pack-center pages-hint" wx:else>
<image src="/static/imgs/coupon_null.png"></image>
<view>暂无数据</view>
</view>

View File

@@ -0,0 +1,110 @@
page {
background-color: #f4f4f4;
}
.tabs {
position: fixed;
top: 0;
left: 0;
right: 0;
z-index: 99;
display: flex;
background-color: #ffffff;
}
.tabs-item {
flex: 2;
text-align: center;
height: 90rpx;
line-height: 90rpx;
position: relative;
}
.tabs-item::after {
position: absolute;
width: 12%;
background-color: #1d37e2;
height: 6rpx;
border-radius: 60rpx;
content: '';
left: 44%;
bottom: 0;
display: none;
}
.tabs-item.show::after {
display: block;
}
.tabs-item.show {
color: #1d37e2;
font-weight: 600;
}
.list {
margin-top: 100rpx;
padding: 30rpx;
box-sizing: border-box;
}
.item {
background-color: #ffffff;
border-radius: 30rpx;
margin-bottom: 30rpx;
box-shadow: 0 0 5rpx rgba(0, 0, 0, .05);
}
.top {
padding: 0 30rpx;
box-sizing: border-box;
line-height: 110rpx;
border-bottom: 2rpx solid #eeeef0;
display: flex;
}
.code {
flex: 1;
font-weight: 600;
position: relative;
padding-left: 30rpx;
}
.code::after {
position: absolute;
content: '';
left: 0;
top: calc(50% - 7rpx);
width: 14rpx;
height: 14rpx;
border-radius: 50%;
background-color: #53c41a;
}
.copy {
border: 2rpx solid #1d37e2;
color: #1d37e2;
border-radius: 10rpx;
font-size: 28rpx;
height: 64rpx;
line-height: 62rpx;
padding: 0 20rpx;
box-sizing: border-box;
margin-top: 26rpx;
}
.label {
padding: 30rpx;
box-sizing: border-box;
display: flex;
}
.label-item {
flex: 2;
}
.label-name {
font-size: 30rpx;
color: #9d9d9d;
margin-bottom: 10rpx;
}

157
pages/bond/index.js Normal file
View File

@@ -0,0 +1,157 @@
/*
* 手太欠
* 愿这世界都如故事里一样 美好而动人~
*/
Page({
/**
* 页面的初始数据
*/
data: {
orderId : '',
identityid : '',
items : [{
value : 'wechat',
name : '微信支付',
cover : '/static/icons/payIcon_00.png',
checked: 'true'
},
{
value : 'code',
name : '激活码支付',
cover : '/static/icons/payIcon_01.png'
}
],
current : 0,
payState : false, //支付选择弹出
writeState : false, //激活码弹出
disabled : false, //按钮状态
payType : 'wechat' //支付类型 wechat微信 code激活码
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
this.setData({
identityid: options.identityid
})
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
// 获取身份信息
this.identityInfo();
},
/**
* 身份信息
*/
identityInfo() {
wx.$api.member.identityOpen(this.data.identityid).then(res => {
this.setData({
// orderId: res.data.order
orderId: res.data.order_id
})
}).catch(err => {})
},
/**
* 选择支付
*/
payChange(e) {
this.setData({
payType: e.detail.value
})
},
/**
* 显示支付选择弹出
*/
payShow() {
this.setData({
payState: !this.data.payState
})
},
// 微信支付
payment() {
// 隐藏支付选择弹出
this.setData({
payState: false
})
if(this.data.payType == 'code') {
// 弹出激活码填写表单
this.setData({
writeState: !this.data.writeState
})
return
}
// 微信支付
wx.login({
success: res => {
wx.$api.member.openid(res).then(openidRes => {
wx.$api.member.identityPay(this.data.orderId, {
channel: 'miniapp',
openid : openidRes.data
}).then(PayRes => {
let payInfo = JSON.parse(PayRes.data.wechat)
wx.requestPayment({
timeStamp: payInfo.timeStamp,
nonceStr : payInfo.nonceStr,
package : payInfo.package,
paySign : payInfo.paySign,
signType : payInfo.signType,
success : payInfoRes=>{
if(payInfoRes.errMsg == "requestPayment:ok"){
wx.showToast({
title: '支付成功',
icon : 'success'
})
setTimeout(()=>{
wx.navigateTo({
url: './tips/index'
})
},3000)
}
},
fail : res=>{
wx.showToast({
title: '取消支付',
icon: 'none'
})
}
})
}).catch(err => {})
}).catch(err => {})
}
})
},
// 激活码支付
writePayment(e) {
let newCode = e.detail.value.code
wx.$api.member.codePay(this.data.orderId, {
code: newCode
}).then(res => {
this.setData({
disabled: true
})
// 返回上一页
wx.navigateBack();
}).catch(err => {})
},
/**
* 关闭激活码填写
*/
writeHide(){
this.setData({
writeState: false
})
},
})

4
pages/bond/index.json Normal file
View File

@@ -0,0 +1,4 @@
{
"usingComponents": {},
"navigationBarTitleText": "保证金"
}

43
pages/bond/index.wxml Normal file
View File

@@ -0,0 +1,43 @@
<image class="temporary" src="http://api.siyuankunlun.com/storage/materials/2022/09/21/bzj.jpg" mode="widthFix"></image>
<view class="member-btn">
<view class="btnGo" bindtap="payShow" disabled="{{disabled}}">
保证金支付
</view>
</view>
<!-- 支付弹出 -->
<view class="payPop {{payState ? 'active' : ''}}"></view>
<view class="payCont {{payState ? 'active' : ''}}">
<view class="payCont-close">
<image src="/static/icons/uricacidClose.png" mode="" bindtap="payShow"></image>
</view>
<radio-group bindchange="payChange">
<label class="uni-list-cell uni-list-cell-pd payCont-radio" wx:for="{{items}}" wx:key="items">
<view class="payCont-name">
<image src="{{item.cover}}" mode=""></image>{{item.name}}
</view>
<view>
<radio value="{{item.value}}" checked="current" color="#e8c198" checked="{{index === current}}" />
</view>
</label>
</radio-group>
<view class="payCont-btn" bindtap="payment">
立即支付
</view>
</view>
<!-- 填写表单 -->
<view class="writePop {{writeState ? 'active' : ''}}"></view>
<view class="writeCont {{writeState ? 'active' : ''}}">
<form bindsubmit="writePayment">
<view class="writeCont-close">
<image src="/static/icons/uricacidClose.png" mode="" bindtap="writeHide"></image>
</view>
<view class="writePop-input">
<input type="text" name="code" placeholder="请输入激活码" />
</view>
<button class="writeCont-btn" form-type="submit" disabled="{{disabled}}">
立即激活
</button>
</form>
</view>

187
pages/bond/index.wxss Normal file
View File

@@ -0,0 +1,187 @@
.temporary {
width: 100%;
}
.member-btn {
position: fixed;
left: 0;
bottom: 0;
width: 100%;
padding: 30rpx;
box-sizing: border-box;
z-index: 9;
}
.btnGo {
padding: 0 30rpx;
line-height: 90rpx;
font-size: 36rpx;
box-sizing: border-box;
background-image: linear-gradient(to right, #fce9cf, #dfac80);
box-shadow: 0 4rpx 4rpx 3rpx rgba(175, 136, 88, 1);
border-radius: 50rpx;
color: #633a25;
font-weight: 600;
text-align: center;
}
.btnGo.active {
background-image: linear-gradient(to right, #d4d4d4, #e0e0e0);
box-shadow: 0 2px 2px 1px #b7b7b7;
color: #656565
}
/* 支付弹出 */
.payPop {
position: fixed;
width: 100%;
height: 100%;
left: 0;
top: 0;
background-color: rgba(0, 0, 0, .4);
z-index: 999;
display: none;
}
.payPop.active {
display: block;
}
.payCont {
position: fixed;
width: 100%;
box-sizing: border-box;
bottom: 0;
left: 0;
background-color: #ffffff;
z-index: 1000;
border-radius: 90rpx 90rpx 0 0;
padding: 30rpx 40rpx;
display: none;
}
.payCont.active {
display: block;
}
.payCont-close {
text-align: right;
margin-bottom: 40rpx;
padding-right: 10rpx;
box-sizing: border-box;
}
.payCont-close image {
width: 40rpx;
height: 40rpx;
}
.payCont-radio {
display: flex;
line-height: 100rpx;
}
.payCont-name {
flex: 1;
font-weight: 600;
display: flex;
}
.payCont-name image {
width: 48rpx;
height: 48rpx;
margin-right: 20rpx;
margin-top: 26rpx;
}
.payCont-radio radio {
transform: scale(.9);
}
.payCont-btn {
margin: 60rpx 0 20rpx;
width: 100%;
background-color: #e8c198;
line-height: 90rpx;
color: #442b11;
text-align: center;
border-radius: 10rpx;
}
/* 填写激活码弹出 */
.writePop {
position: fixed;
width: 100%;
height: 100%;
left: 0;
top: 0;
background-color: rgba(0, 0, 0, .4);
z-index: 999;
display: none;
}
.writePop.active {
display: block;
}
.writeCont {
position: fixed;
width: 100%;
box-sizing: border-box;
bottom: 0;
left: 0;
background-color: #ffffff;
z-index: 1000;
border-radius: 90rpx 90rpx 0 0;
padding: 30rpx 40rpx;
display: none;
}
.writeCont.active {
display: block;
}
.writeCont-close {
text-align: right;
margin-bottom: 40rpx;
padding-right: 10rpx;
box-sizing: border-box;
}
.writeCont-close image {
width: 40rpx;
height: 40rpx;
}
.writePop-input {
background-color: #f5f5f5;
height: 90rpx;
border-radius: 10rpx;
padding: 0 30rpx;
box-sizing: border-box;
}
.writePop-input input {
background-color: transparent;
border: none;
height: 100%;
line-height: 90rpx;
}
.writeCont-btn {
margin: 60rpx 0 20rpx;
width: 100% !important;
padding: 0;
background-color: #e8c198 !important;
line-height: 90rpx;
color: #442b11 !important;
font-size: 32rpx;
text-align: center;
border-radius: 10rpx;
border: none;
box-shadow: none;
}
.writeCont-btn::after {
display: none;
}

28
pages/bond/tips/index.js Normal file
View File

@@ -0,0 +1,28 @@
/*
* 手太欠
* 愿这世界都如故事里一样 美好而动人~
*/
Page({
/**
* 页面的初始数据
*/
data: {
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
},
})

View File

@@ -0,0 +1,3 @@
{
"usingComponents": {}
}

View File

@@ -0,0 +1,7 @@
<view class="examine">
<image src="/static/imgs/payImg.jpg" mode="widthFix"></image>
<view class="text">
<view class="title">支付成功</view>
</view>
<navigator hover-class="none" open-type="navigateBack" class="return">知道了</navigator>
</view>

View File

@@ -0,0 +1,34 @@
.examine {
padding: 240rpx 0 30rpx;
box-sizing: border-box;
text-align: center;
}
.examine image {
width: 45%;
margin: 0 auto 30rpx;
}
.text .title {
font-weight: 600;
font-size: 42rpx;
margin-bottom: 30rpx;
}
.text .time {
color: #999999;
line-height: 50rpx;
}
.return {
display: inline-block;
margin-top: 80rpx;
background-color: #1d37e2;
padding: 0 180rpx;
height: 90rpx;
line-height: 90rpx;
border-radius: 10rpx;
box-shadow: 0 3rpx 6rpx 4rpx rgba(6, 34, 214, .6);
color: #FFFFFF;
font-size: 34rpx;
}

268
pages/code/index.js Normal file
View File

@@ -0,0 +1,268 @@
/*
* 手太欠
* 愿这世界都如故事里一样 美好而动人~
*/
Page({
/**
* 页面的初始数据
*/
data: {
shareSee : false, //分享弹出
identity : 1, //1为普通2为上师版 3为何院士
userInfo : '', //用户信息
inviteText: '', //邀请码
invite : '' //二维码
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
// 获取推广码
this.inviteInfo();
// 获取小程序码
this.ShareInfo();
},
/**
* 推广码
*/
inviteInfo() {
wx.$api.user.invite().then(res => {
this.setData({
identity : res.data.user_info.tag,
userInfo : res.data.user_info,
inviteText : res.data.invite
})
}).catch(err => {})
},
/**
* 小程序码
*/
ShareInfo() {
wx.$api.user.miniShare({
url: '/pages/login/index'
}).then(res => {
this.setData({
invite: res.data.qrcode
})
}).catch(err => {})
},
/**
* 分享弹出
*/
shareTap() {
this.setData({
shareSee: !this.data.shareSee
})
},
/**
* 第一种海报样式 保存图片到本地
*/
saveImg(){
this.dowImg();
this.setData({
shareSee: false
})
},
/**
* 第二种海报样式 保存图片到本地
*/
TwoImg(){
this.TwoSaveImg();
this.setData({
shareSee: false
})
},
/**
* 第一种海报样式
*/
dowImg(){
wx.showLoading({
title: '生成中',
mask : true
})
// 下载背景素材
let codeImg = new Promise(success => {
wx.getImageInfo({
src : this.data.invite,
success : res => {
success(res.path)
}
})
})
// 下载背景素材
let backUrl
if (this.data.identity == 1) {
backUrl = "https://api.siyuankunlun.com/storage/materials/2022/09/14/code.jpg"
} else if (this.data.identity == 2) {
backUrl = "https://api.siyuankunlun.com/storage/materials/2022/09/14/code_01.png"
}
Promise.all([codeImg]).then(res => {
wx.getImageInfo({
src : backUrl,
success : networkImg => {
// 绘制海报
const ctx = wx.createCanvasContext('qrcodeCard')
ctx.save()
// 绘制背景
ctx.drawImage(networkImg.path, 0, 0, 375, 800)
// 绘制二维码背景
ctx.drawImage("/static/imgs/codeshart_back.png", 137, 532, 100, 100)
// 绘制二维码
ctx.drawImage(res[0], 145, 540, 85, 85)
// 文字
ctx.setFontSize(12)
ctx.setFillStyle("#eadbc8")
ctx.setTextAlign('center')
ctx.fillText("扫描二维码了解更多", 188, 650 , 270)
// 保存图片
ctx.draw(true, () => {
wx.hideLoading()
wx.canvasToTempFilePath({
canvasId: 'qrcodeCard',
x: 0,
y: 0,
success: keepRes => {
wx.saveImageToPhotosAlbum({
filePath: keepRes.tempFilePath,
success : ()=>{
wx.showToast({
title: '分享海报已保存至相册',
icon : 'none'
})
},
fail : err=>{
wx.showModal({
title : '提示',
content : '暂未授权小程序写入您的相册,无法存储二维码海报',
confirmColor: '#d82526',
confirmText : '去设置',
success : info=>{
if (info.confirm){
wx.openSetting()
}
}
})
},
complete: e => {}
})
}
})
})
}
})
}).catch(err=>{})
},
/**
* 第二种海报样式
*/
TwoSaveImg() {
wx.showLoading({
title: '加载中',
})
// 下载背景素材
let codeImg = new Promise(success => {
wx.getImageInfo({
src : this.data.invite,
success : res => {
success(res.path)
}
})
})
Promise.all([codeImg]).then(res => {
wx.getImageInfo({
src: "https://api.siyuankunlun.com/storage/materials/2022/09/14/code_02.png",
success : networkImg => {
// 绘制海报
const ctx = wx.createCanvasContext('qrcodeCard')
ctx.save()
// 绘制背景
ctx.drawImage(networkImg.path, 0, 0, 375, 800)
// 绘制二维码背景
ctx.drawImage("/static/imgs/codeshart_back_02.png", 60, 550, 246, 94)
// 绘制二维码
ctx.drawImage(res[0], 215, 562, 70, 70)
// 绘制标题
ctx.drawImage("/static/imgs/codeShart_title1.png", 80, 570, 120, 56)
// 保存图片
ctx.draw(true, () => {
wx.hideLoading()
wx.canvasToTempFilePath({
canvasId: 'qrcodeCard',
x: 0,
y: 0,
success: keepRes => {
wx.saveImageToPhotosAlbum({
filePath: keepRes.tempFilePath,
success : ()=>{
wx.showToast({
title: '分享海报已保存至相册',
icon : 'none'
})
},
fail : err=>{
wx.showModal({
title : '提示',
content : '暂未授权小程序写入您的相册,无法存储二维码海报',
confirmColor: '#d82526',
confirmText : '去设置',
success : info=>{
if (info.confirm){
wx.openSetting()
}
}
})
},
complete: e => {}
})
}
})
})
}
})
}).catch(err=>{})
},
/**
* 微信分享
*/
onShareAppMessage(){
return {
title : this.data.userInfo.nickname + '邀请您了解锶源昆仑',
path : "/pages/login/index?invite=" + this.data.inviteText,
imageUrl: "https://api.siyuankunlun.com/storage/materials/2022/09/14/code.jpg"
}
}
})

4
pages/code/index.json Normal file
View File

@@ -0,0 +1,4 @@
{
"usingComponents": {},
"navigationBarTitleText": "邀请码"
}

45
pages/code/index.wxml Normal file
View File

@@ -0,0 +1,45 @@
<view class="code">
<image src="http://api.siyuankunlun.com/storage/materials/2022/09/14/code.jpg" class="code-back" wx:if="{{identity == 1}}"></image>
<image src="http://api.siyuankunlun.com/storage/materials/2022/09/14/code_01.png" class="code-back" wx:elif="{{identity == 2}}"></image>
<image src="http://api.siyuankunlun.com/storage/materials/2022/09/14/code_02.png" class="code-back" wx:else></image>
<view class="newCode-cont" wx:if="{{identity == 3}}">
<view class="newCode-img">
<view class="newCode-img-title">
<image src="http://api.siyuankunlun.com/storage/materials/2022/09/14/codeShart_title1.png" mode="widthFix"></image>
</view>
<image class="newCode-img-code" src="{{invite}}"></image>
</view>
</view>
<view class="code-cont" wx:else>
<view class="code-img">
<image src="{{invite}}" mode="widthFix"></image>
</view>
<view class="code-text"><text>扫描二维码了解更多</text></view>
</view>
<view class="code-share" bindtap="shareTap">
<image src="/static/icons/share.png"></image>
<view class="code-share-name">分享</view>
</view>
</view>
<!-- 海报canvas -->
<canvas class="canvasImg" canvas-id="qrcodeCard"></canvas>
<!-- 分享弹出 -->
<view class="sharePop {{shareSee ? 'active' : ''}}">
<view class="shareCont">
<button class="shareCont-label codeShare-button" open-type="share" hover-class="none">
<image src="https://card.ysd-bs.com/storage/materials/2021/09/01/code_icon_00.png"></image>
微信好友
</button>
<view class="shareCont-label" bindtap="TwoImg" wx:if="{{identity == 3}}">
<image src="https://card.ysd-bs.com/storage/materials/2021/09/01/code_icon_02.png"></image>
保存二维码
</view>
<view class="shareCont-label" bindtap="saveImg" wx:else>
<image src="https://card.ysd-bs.com/storage/materials/2021/09/01/code_icon_02.png"></image>
保存二维码
</view>
</view>
<view class="shareCancel" bindtap="shareTap">取消</view>
</view>

164
pages/code/index.wxss Normal file
View File

@@ -0,0 +1,164 @@
.code {
width: 100vw;
height: 100vh;
position: relative;
}
.code-back {
position: absolute;
left: 0;
top: 0;
width: 100%;
height: 100%;
}
.code-cont {
width: 100%;
position: absolute;
z-index: 9;
text-align: center;
left: 0;
bottom: 19%;
}
.code-img{
margin: 0 auto 20rpx;
overflow: hidden;
border-radius: 30rpx;
width: 190rpx;
height: 190rpx;
border: 4rpx solid #be9768;
background-color: #ffffff;
}
.code-img image {
width: 100%;
}
.code-text {
background: linear-gradient(to right, #aa957b, #ffeeda, #aa957b);
-webkit-background-clip: text;
background-clip: text;
color: transparent;
font-size: 26rpx;
}
.code-share {
position: absolute;
z-index: 10;
left: 0;
bottom: 24%;
background: linear-gradient(to right, #aa957b, #ffeeda);
width: 50rpx;
text-align: center;
border-radius: 0 20rpx 20rpx 0;
padding: 20rpx 0;
}
.code-share-name {
writing-mode:vertical-rl;
font-size: 28rpx;
padding-left: 4rpx;
color: #4d2a00;
}
.code-share image {
width: 30rpx;
height: 30rpx;
margin-bottom: 5rpx;
}
.sharePop {
position: fixed;
width: 100%;
z-index: 99;
left: 0;
bottom: 0;
background-color: #0a1930;
display: none;
}
.sharePop.active {
display: block;
}
.shareCont-label image {
width: 60rpx;
height: 60rpx;
display: block;
margin: 0 auto 10rpx;
}
.shareCancel {
border-top: 2rpx solid #0e2c58;
color: #ffffff;
width: 100%;
text-align: center;
line-height: 100rpx;
}
.shareCont{
display: flex;
padding: 30rpx 0;
}
.shareCont-label {
color: #ffffff;
flex: 2;
text-align: center;
font-size: 28rpx;
}
.codeShare-button {
background-color: transparent;
padding: 0;
font-weight: normal;
}
/* canvas */
.canvasImg {
position: absolute;
left: -1000%;
height: 800px;
width: 375px;
}
/* 何院士样式 */
.newCode-cont {
width: 70%;
height: 200rpx;
position: absolute;
z-index: 9;
text-align: center;
left: 15%;
bottom: 19.5%;
background: linear-gradient(to top, #a09084, #a58367);
padding: 15rpx;
box-sizing: border-box;
border-radius: 30rpx;
}
.newCode-img {
height: 170rpx;
margin: 0 auto;
background: linear-gradient(to top, #e9d1bd, #c49b7a);
border: 4rpx solid #f3c49d;
border-radius: 30rpx;
display: flex;
padding: 10rpx 30rpx 10rpx 10rpx;
box-sizing: border-box;
}
.newCode-img-title {
width: calc(100% - 140rpx);
}
.newCode-img-title image {
width: 80%;
margin-top: 15rpx;
}
.newCode-img-code {
width: 140rpx;
height: 140rpx;
}

View File

@@ -0,0 +1,74 @@
/*
* 手太欠
* 愿这世界都如故事里一样 美好而动人~
*/
Page({
/**
* 页面的初始数据
*/
data: {
couponArr : [], //抵值券
page : {}, //下一页
lodingStats : false, //加载状态
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
this.setData({
couponId: options.couponid
})
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
// 获取我的抵值券
this.couponInfo();
},
// 我的抵值券
couponInfo(page){
wx.$api.user.couponList(this.data.couponId,{
page : page || 1
}).then(res => {
let listArr = this.data.couponArr,
newData = []
if(page == 1 || page == undefined) listArr = []
newData = listArr.concat(res.data.data)
this.setData({
couponArr : newData,
page : res.data.page,
lodingStats : false
})
wx.stopPullDownRefresh()
}).catch(err => {})
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
// 获取我的抵值券
this.couponInfo();
},
/**
* 上拉加载
*/
onReachBottom(){
this.setData({
lodingStats: true
})
let pageNumber = this.data.page.current
if(this.data.page.has_more){
pageNumber++
// 获取我的抵值券
this.couponInfo(pageNumber);
}
}
})

View File

@@ -0,0 +1,4 @@
{
"usingComponents": {},
"navigationBarTitleText": "抵值券"
}

View File

@@ -0,0 +1,50 @@
<view class="list" wx:if="{{couponArr.length > 0}}">
<view class="item" wx:for="{{couponArr}}" wx:key="index">
<view class="item-label {{item.status.status != 1 ? 'active' : ''}}" wx:if="{{item.status}}">
<image class="tipsImg {{item.status.status != 1 ? 'active' : ''}}" src="http://api.siyuankunlun.com/storage/materials/2022/09/14/coupons_tips.png" mode="widthFix"></image>
<view class="top">
<view class="left">
<view class="name">
{{item.title}}
</view>
<view class="time {{item.status.status != 1 ? 'active' : ''}}">
{{item.time.end_at}} 到期
</view>
</view>
<view class="right {{item.status.status != 1 ? 'active' : ''}}">
<view class="right-prop">
<text>¥</text>{{item.price}}
</view>
<view class="right-tips">
{{item.price_text}}
</view>
</view>
</view>
<view class="bottom {{item.status.status != 1 ? 'active' : ''}}">
<view class="tips {{item.status.status != 1 ? 'active' : ''}}">
开通季卡会员可低值
</view>
<block wx:if="{{item.status}}">
<navigator hover-class="none" url="/pages/member/index/index" class="btn" wx:if="{{item.status.status == 1}}">
立即使用
</navigator>
<view class="btn active" wx:if="{{item.status.status == 2}}">
{{item.status.text}}
</view>
</block>
</view>
</view>
</view>
<view class="pagesLoding" wx:if="{{lodingStats}}">
<block wx:if="{{page.has_more}}">
<image class="pagesLoding-icon" src="/static/icon/refresh_loding.gif" mode="widthFix"></image>加载中...
</block>
<block wx:else>
没有更多了~
</block>
</view>
</view>
<view class="pack-center pages-hint" wx:else>
<image src="/static/imgs/coupon_null.png"></image>
<view>暂无数据</view>
</view>

View File

@@ -0,0 +1,150 @@
page {
padding: 30rpx;
box-sizing: border-box;
background-color: #f5f5f5;
}
.item-label {
border-radius: 30rpx;
padding: 50rpx 40rpx 20rpx;
box-sizing: border-box;
margin-bottom: 40rpx;
position: relative;
box-shadow: 0 0 6rpx 2rpx rgba(0, 0, 0, .1);
background-image: linear-gradient(to top right, #f9e3b4, #ecc685);
}
.item-label.active {
background-image: linear-gradient(to top right, #c9c9c9, #b5b5b5);
}
.item-label::after,
.item-label::before {
position: absolute;
content: '';
background-color: #f5f5f5;
width: 30rpx;
height: 30rpx;
bottom: 84rpx;
border-radius: 50%;
}
.item-label::after {
left: -15rpx;
}
.item-label::before {
right: -15rpx;
}
.tipsImg {
position: absolute;
top: 0;
left: 30rpx;
width: 170rpx;
}
.tipsImg.active {
-webkit-filter: grayscale(100%);
-moz-filter: grayscale(100%);
-ms-filter: grayscale(100%);
-o-filter: grayscale(100%);
filter: grayscale(100%);
filter: gray;
}
.top {
margin-bottom: 20rpx;
display: flex;
}
.left {
flex: 1;
font-weight: 600;
}
.name {
margin-bottom: 15rpx;
font-size: 34rpx;
margin-top: 10rpx;
}
.time {
background-color: #f6d4a6;
font-size: 26rpx;
display: inline-block;
color: #eb5941;
line-height: 48rpx;
padding: 0 10rpx;
border-radius: 10rpx;
}
.time.active {
background-color: #b1b1b1;
color: #464646;
}
.right {
color: #835529;
}
.right-prop {
font-size: 52rpx;
font-weight: 600;
display: flex;
}
.right-prop text {
font-size: 28rpx;
margin-top: 10rpx;
padding-right: 6rpx;
}
.right-tips {
font-size: 26rpx;
text-align: center;
}
.right.active {
color: #464646;
}
.bottom {
border-top: 2rpx dashed #dfc796;
display: flex;
font-size: 28rpx;
padding-top: 20rpx;
margin-top: 30rpx;
}
.bottom.active {
border-color: #adadad;
}
.tips {
color: #b18c5d;
line-height: 58rpx;
flex: 1;
}
.tips.active {
color: #464646;
}
.btn {
background-image: linear-gradient(to right, #d8a76a, #b37a3e);
border-radius: 70rpx;
color: #ffffff;
padding: 0 30rpx;
height: 58rpx;
line-height: 58rpx;
font-weight: 600;
border: 2rpx solid #c38d4c;
}
.btn.active {
background-image: linear-gradient(to right, #8f8f8f, #a7a7a7);
color: #000;
border-color: #a7a7a7;
}

View File

@@ -0,0 +1,72 @@
/*
* 手太欠
* 愿这世界都如故事里一样 美好而动人~
*/
Page({
/**
* 页面的初始数据
*/
data: {
couponArr : [], //抵值券
page : {}, //下一页
lodingStats : false, //加载状态
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
// 获取我的抵值券
this.couponInfo();
},
/**
* 我的抵值券
*/
couponInfo(page){
wx.$api.user.coupon({
page : page || 1
}).then(res => {
let listArr = this.data.couponArr,
newData = []
if(page == 1 || page == undefined) listArr = []
newData = listArr.concat(res.data.lists)
this.setData({
couponArr : newData,
page : res.data.page,
lodingStats : false
})
wx.stopPullDownRefresh()
}).catch(err => {})
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
// 获取我的抵值券
this.couponInfo();
},
/**
* 上拉加载
*/
onReachBottom(){
this.setData({
lodingStats: true
})
let pageNumber = this.data.page.current
if(this.data.page.has_more){
pageNumber++
// 获取我的抵值券
this.couponInfo(pageNumber);
}
}
})

View File

@@ -0,0 +1,4 @@
{
"usingComponents": {},
"navigationBarTitleText": "抵值券"
}

View File

@@ -0,0 +1,41 @@
<view class="list" wx:if="{{couponArr.length > 0}}">
<view class="item" wx:for="{{couponArr}}" wx:key="couponArr">
<image class="tipsImg" src="http://api.siyuankunlun.com/storage/materials/2022/09/14/coupons_tips.png" mode="widthFix"></image>
<view class="top">
<view class="left">
<view class="name">
{{item.title}}
</view>
<view class="time" wx:if="{{item.time}}">
{{item.time.interval}}
</view>
</view>
<view class="right">
<view class="right-prop">
<text>¥</text>{{item.price}}
</view>
<view class="right-tips">
{{item.price_text}}
</view>
</view>
</view>
<navigator hover-class="none" url="../list/index?couponid={{item.coupon_id}}" class="bottom">
<view class="tips">
共<text>{{item.coupon_count}}</text>张{{item.title}}
</view>
<image class="arrow" src="/static/icons/coupons_arrow.png"></image>
</navigator>
</view>
<view class="pagesLoding" wx:if="{{lodingStats}}">
<block wx:if="{{page.has_more}}">
<image class="pagesLoding-icon" src="/static/icon/refresh_loding.gif" mode="widthFix"></image>加载中...
</block>
<block wx:else>
没有更多了~
</block>
</view>
</view>
<view class="pack-center pages-hint" wx:else>
<image src="/static/imgs/coupon_null.png"></image>
<view>暂无数据</view>
</view>

View File

@@ -0,0 +1,114 @@
page {
padding: 30rpx;
box-sizing: border-box;
background-color: #f5f5f5;
}
.item {
border-radius: 30rpx;
padding: 50rpx 40rpx 10rpx;
box-sizing: border-box;
margin-bottom: 40rpx;
position: relative;
box-shadow: 0 0 6rpx 2rpx rgba(0, 0, 0, .1);
background-image: linear-gradient(to top right, #f9e3b4, #ecc685);
}
.item::after,
.item::before {
position: absolute;
content: '';
background-color: #f5f5f5;
width: 30rpx;
height: 30rpx;
bottom: 84rpx;
border-radius: 50%;
}
.item::after {
left: -15rpx;
}
.item::before {
right: -15rpx;
}
.tipsImg {
position: absolute;
top: 0;
left: 30rpx;
width: 170rpx;
}
.top {
margin-bottom: 20rpx;
display: flex;
}
.left {
flex: 1;
font-weight: 600;
}
.name {
margin-bottom: 15rpx;
font-size: 34rpx;
margin-top: 10rpx;
}
.time {
background-color: #f6d4a6;
font-size: 26rpx;
display: inline-block;
color: #eb5941;
line-height: 48rpx;
padding: 0 10rpx;
border-radius: 10rpx;
}
.right {
color: #835529;
}
.right-prop {
font-size: 50rpx;
font-weight: 600;
display: flex;
}
.right-prop text {
font-size: 28rpx;
margin-top: 10rpx;
padding-right: 6rpx;
}
.right-tips {
font-size: 26rpx;
text-align: center;
}
.bottom {
border-top: 2rpx dashed #dfc796;
display: flex;
font-size: 28rpx;
padding-top: 20rpx;
margin-top: 30rpx;
}
.tips {
color: #b18c5d;
line-height: 58rpx;
flex: 1;
}
.tips text {
font-weight: 600;
padding: 0 5rpx;
}
.arrow {
width: 32rpx;
height: 32rpx;
margin-top: 10rpx;
}

136
pages/index/carry/index.js Normal file
View File

@@ -0,0 +1,136 @@
/*
* 手太欠
* 愿这世界都如故事里一样 美好而动人~
*/
Page({
/**
* 页面的初始数据
*/
data: {
num : 1, //数量默认1
address : '', //地址
stockData : '', //数据
isExperience : '', //身份
disabled : false
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
// 获取提货前置
this.pickInfo();
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
},
/**
* 提货前置
*/
pickInfo (){
wx.$api.stock.pick().then(res => {
this.setData({
address : res.data.address,
stockData : res.data.stockData,
isExperience : res.data.dientity.is_experience
})
}).catch(err => {})
},
/**
* 商品数量加减
*/
goodsNumber(e){
let num = this.data.num,
val = e.currentTarget.dataset.type
if (val == 'plus'){
num ++;
if(num > this.data.stockData.stock ){
wx.showToast({
title: '商品数量不能大于库存量',
icon: 'none'
});
num = this.data.stockData.stock
}
}else{
if (num > 1){
num --;
}else{
wx.showToast({
title : '商品数量不能小于1',
icon : 'none'
})
}
this.setData({
num: num
})
}
this.setData({
num: num
})
},
/**
* 输入商品数量
*/
goodsNumberInput(e) {
let goodsNum = e.detail.value;
if (goodsNum > 0) {
if(goodsNum > this.data.stockData.stock ){
wx.showToast({
title: '商品数量不能大于库存量',
icon: 'none'
});
this.setData({
num: this.data.stockData.stock
})
return
}
this.setData({
num: goodsNum
})
} else {
wx.showToast({
title: '商品数量不能小于1',
icon: 'none'
});
this.setData({
num: 1
})
}
},
/**
* 申请提货
*/
stockForm(e) {
let newQty = this.data.num
if(this.data.isExperience) {
newQty = this.data.stockData.stock
}
let data = {
remark : e.detail.value.remark,
qty : newQty,
address_id : this.data.address.address_id
}
wx.$api.stock.pickTake(data).then(res => {
this.setData({
disabled: true
})
// 跳到审核页面
wx.redirectTo({
url: '../examine/index'
})
}).catch(err => {})
}
})

View File

@@ -0,0 +1,4 @@
{
"usingComponents": {},
"navigationBarTitleText": "申请提货"
}

View File

@@ -0,0 +1,63 @@
<form bindsubmit="stockForm" class="take">
<view class="take">
<view class="take-label" wx:if="{{isExperience}}">
<view class="reminder">
<view class="reminder-tips">
<image src="/static/icons/reminder_tips.png"></image>温馨提示
</view>
<text>收货地址只限制广东省深圳市地区</text>
</view>
</view>
<view class="take-label">
<view class="item" wx:if="{{isExperience}}">
<view class="name">
<image src="/static/icons/takeIcon_01.png" mode="widthFix"></image>提货数量
</view>
<view class="time stock">
{{stockData.stock}}<text>箱</text>
</view>
</view>
<view class="item" wx:else>
<view class="name">
<image src="/static/icons/takeIcon_01.png" mode="widthFix"></image>提货数量
</view>
<view class="number">
<view class="btn" bindtap="goodsNumber" data-type="remove">-</view>
<input bindblur="goodsNumberInput" class="see" type="text" value="{{num}}" />
<view class="btn" bindtap="goodsNumber" data-type="plus">+</view>
</view>
</view>
<view class="item">
<view class="name">
<image src="/static/icons/takeIcon_02.png" mode="widthFix"></image>备注信息
</view>
<textarea class="remarks" name="remark" placeholder="请输入备注信息~" />
</view>
</view>
<view class="take-label">
<view class="item site {{address == '' ? 'active' : ''}}">
<block wx:if="{{address}}">
<view class="site-title">
{{address.name}}<text>{{address.mobile}}</text>
</view>
<view class="site-text">
{{address.full_address}}
</view>
<navigator hover-class="none" url="/pages/stock/site/index?type=selectAddress&experience=isExperience" class="site-change">
更改地址
</navigator>
</block>
<view class="edit-no" wx:else>
<image src="/static/imgs/site_no_add.png"></image>
<navigator hover-class="none" class="site-change" url="/pages/stock/site/index?type=selectAddress&experience=isExperience">
新增地址
</navigator>
</view>
</view>
</view>
</view>
<view class="site-btn">
<button form-type="submit" disabled="{{disabled}}">提交申请</button>
</view>
</form>

View File

@@ -0,0 +1,197 @@
page {
background-color: #f4f4f4;
}
.take {
border-bottom: 180rpx solid transparent;
}
.take-label {
padding: 30rpx 30rpx 0;
box-sizing: border-box;
}
.item {
padding: 30rpx;
box-sizing: border-box;
background-color: #FFFFFF;
border-bottom: 2rpx solid #f3f3f3;
position: relative;
font-size: 30rpx;
}
.name {
display: flex;
flex: 1;
}
.name image {
width: 44rpx;
height: 44rpx;
margin-right: 15rpx;
}
.time {
color: #565656;
position: absolute;
right: 30rpx;
top: 30rpx;
}
.stock {
font-weight: 600;
}
.stock text {
padding-left: 5rpx;
}
.number {
display: flex;
position: absolute;
right: 30rpx;
top: 30rpx;
}
.btn {
width: 40rpx;
height: 40rpx;
line-height: 34rpx;
font-weight: 600;
border-radius: 50%;
color: #1d37e2;
border: #1d37e2 2rpx solid;
text-align: center;
}
.see {
width: 60rpx;
text-align: center;
padding: 0 20rpx;
line-height: 42rpx;
font-size: 30rpx;
display: inline-block;
}
.remarks {
margin-top: 30rpx;
background-color: #f4f4f4;
font-size: 30rpx;
padding: 20rpx 30rpx;
box-sizing: border-box;
border-radius: 26rpx;
color: #9d9d9d;
width: 100%;
}
.site {
padding: 30rpx 30rpx 30rpx 90rpx;
position: relative;
}
.site::after {
position: absolute;
content: '';
left: 40rpx;
top: 60rpx;
background-color: #FFFFFF;
border: #e64248 solid 6rpx;
width: 12rpx;
height: 12rpx;
border-radius: 50%;
}
.site.active::after {
display: none;
}
.site-title {
margin-bottom: 10rpx;
font-weight: 600;
font-size: 30rpx;
}
.site-title text {
padding-left: 10rpx;
}
.site-text {
color: #565656;
}
.site-change {
border: 2rpx solid #e64248;
text-align: center;
line-height: 74rpx;
color: #e64248;
border-radius: 10rpx;
margin-top: 30rpx;
}
/* 按钮 */
.site-btn {
width: 100%;
box-sizing: border-box;
padding: 30rpx;
position: fixed;
bottom: 0;
left: 0;
z-index: 99;
right: 0;
background: white;
}
.site-btn button {
background: #1d37e2;
text-align: center;
color: white;
height: 88rpx;
line-height: 88rpx;
font-size: 30rpx;
font-weight: normal;
width: 100%;
margin: 0;
padding: 0;
border-radius: 10rpx;
}
.site-btn button[disabled] {
background: #7789ff !important;
color: #fff !important;
}
.edit-no {
text-align: center;
color: #9d9d99;
}
.edit-no image {
width: 240rpx;
height: 240rpx;
}
/* 温馨提示 */
.reminder {
background-color: #eef0ff;
color: #001bca;
padding: 30rpx;
box-sizing: border-box;
}
.reminder text {
font-size: 30rpx;
padding-left: 44rpx;
}
.reminder-tips {
font-weight: 600;
margin-bottom: 10rpx;
display: flex;
line-height: 34rpx;
}
.reminder-tips image {
width: 34rpx;
height: 34rpx;
margin-right: 10rpx;
}

View File

@@ -0,0 +1,88 @@
/*
* 手太欠
* 愿这世界都如故事里一样 美好而动人~
*/
Page({
/**
* 页面的初始数据
*/
data: {
userData : '', //用户信息
surveyArr : [], //反馈列表
page : {}, //分页信息
lodingStats : false, //加载状态
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
// 获取反馈列表
this.surveysInfo();
},
/**
* 反馈列表
*/
surveysInfo(page) {
wx.$api.index.surveys({
page : page
}).then(res => {
let listArr = this.data.surveyArr,
newData = []
if(page == 1 || page == undefined) listArr = []
newData = listArr.concat(res.data.data)
this.setData({
surveyArr : newData,
page : res.data.page,
lodingStats : false
})
wx.stopPullDownRefresh()
}).catch(err => {})
},
// 图片预览
openImg(e){
let imgs = [],
index = e.currentTarget.dataset.index
for (let img of e.currentTarget.dataset.imgs){
imgs.push(img)
}
wx.previewImage({
urls : imgs,
current : imgs[index]
})
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
// 获取反馈列表
this.surveysInfo();
},
/**
* 上拉加载
*/
onReachBottom(){
this.setData({
lodingStats: true
})
let pageNumber = this.data.page.current
if(this.data.page.has_more){
pageNumber++
// 获取反馈列表
this.surveysInfo(pageNumber);
}
}
})

View File

@@ -0,0 +1,4 @@
{
"usingComponents": {},
"navigationBarTitleText": "效果反馈"
}

View File

@@ -0,0 +1,45 @@
<view class="lists" wx:if="{{surveyArr.length > 0}}">
<view class="lists-item" wx:for="{{surveyArr}}" wx:key="surveyArr">
<view class="lists-top">
<image class="lists-head" src="{{item.user.avatar}}" mode="aspectFill"></image>
<view class="lists-cont">
<view class="lists-name">
{{item.user.nickname}}
</view>
<image wx:if="{{item.user.identity.order == '1'}}" class="lists-identity" src="/static/icons/member_01.png" mode="widthFix"></image>
<image wx:elif="{{item.user.identity.order == '2'}}" class="lists-identity" src="/static/icons/member_02.png" mode="widthFix"></image>
<image wx:elif="{{item.user.identity.order == '3'}}" class="lists-identity" src="/static/icons/member_03.png" mode="widthFix"></image>
<image wx:elif="{{item.user.identity.order == '4'}}" class="lists-identity" src="/static/icons/member_04.png" mode="widthFix"></image>
<image wx:elif="{{item.user.identity.order == '5'}}" class="lists-identity" src="/static/icons/member_05.png" mode="widthFix"></image>
<image wx:else src="/static/icons/member_06.png" class="lists-identity" mode="widthFix"></image>
</view>
</view>
<view class="lists-text">
<text>{{item.content}}</text>
</view>
<view class="lists-img" wx:if="{{item.pictures.length > 0}}">
<block wx:if="{{item.pictures.length >= 3}}">
<view class="lists-label lists-three" wx:for="{{item.pictures}}" wx:key="picturesItems" wx:for-item="items">
<image src="{{items}}" mode="aspectFill" bindtap="openImg" data-imgs="{{item.pictures}}" data-index="{{index}}"></image>
</view>
</block>
<block wx:elif="{{item.pictures.length == 1}}">
<view class="lists-label lists-one" wx:for="{{item.pictures}}" wx:key="picturesItems" wx:for-item="items">
<image src="{{items}}" mode="aspectFill" bindtap="openImg" data-imgs="{{item.pictures}}" data-index="{{index}}"></image>
</view>
</block>
<block wx:else>
<view class="lists-label lists-two" wx:for="{{item.pictures}}" wx:key="picturesItems" wx:for-item="items">>
<image src="{{items}}" mode="aspectFill" bindtap="openImg" data-imgs="{{item.pictures}}" data-index="{{index}}"></image>
</view>
</block>
</view>
</view>
</view>
<view class="pack-center pages-hint" wx:else>
<image src="/static/imgs/coupon_null.png"></image>
<view>暂无数据</view>
</view>
<navigator hover-class="none" url="/pages/index/write/index" class="write">
<image src="/static/icons/white.png"></image>
</navigator>

View File

@@ -0,0 +1,105 @@
page {
background-color: #f5f5f5;
}
/* 列表 */
.lists {
padding: 30rpx;
box-sizing: border-box;
}
.lists-item {
padding: 30rpx 30rpx 20rpx;
box-sizing: border-box;
margin-bottom: 30rpx;
border-radius: 30rpx;
background-color: #ffffff;
box-shadow: 0 0 6rpx rgb(232, 232, 232);
}
.lists-top {
position: relative;
}
.lists-head {
width: 120rpx;
height: 120rpx;
border-radius: 50%;
}
.lists-cont {
position: absolute;
top: 0;
left: 0;
width: 100%;
box-sizing: border-box;
padding-left: 140rpx;
}
.lists-name {
font-weight: 600;
margin: 15rpx 0;
}
.lists-identity {
width: 130rpx;
}
.lists-text {
font-size: 28rpx;
padding: 20rpx 0 10rpx;
line-height: 42rpx;
color: #383838;
box-sizing: border-box;
}
.lists-img {
margin: 0 -10rpx;
}
.lists-label {
display: inline-block;
width: calc(100% - 20rpx);
margin: 10rpx;
padding-top: calc(100% - 20rpx);
position: relative;
border-radius: 4rpx;
overflow: hidden;
}
.lists-label.lists-two {
width: calc(50% - 20rpx);
padding-top: calc(50% - 20rpx);
}
.lists-label.lists-three {
width: calc(33.33% - 20rpx);
padding-top: calc(33.33% - 20rpx);
}
.lists-label image {
position: absolute;
left: 0;
top: 0;
width: 100%;
height: 100%;
}
.write {
position: fixed;
right: 30rpx;
bottom: 100rpx;
z-index: 1000;
background-color: #ffffff;
width: 90rpx;
height: 90rpx;
border-radius: 50%;
box-shadow: 0 2rpx 10rpx rgba(98, 112, 255, .4);
padding: 20rpx;
box-sizing: border-box;
}
.write image {
width: 100%;
height: 100%;
}

189
pages/index/index.js Normal file
View File

@@ -0,0 +1,189 @@
/*
* 手太欠
* 愿这世界都如故事里一样 美好而动人~
*/
const app = getApp();
Page({
/**
* 页面的初始数据
*/
data: {
//任务列表
case : '',
case_log : '',
experience : '',
order : '',
payment : '',
register : '',
stepsSign : '',
subscribe : '',
loginCode : '',
code : '', //公众号二维码
showSymptom : '', //是否显示报告列表
max : '',
min : '',
goutCaseId : '', //档案id
count : '', //数量
sign : '', //签到
nowStatus : '', //流程判断
popStatus : false, //流程判断弹出层状态
authState : false,
applyState : false, //申请体验馆状态
hasCase : '',
userLogin : '', //登录状态
detailsImg : '',
offsetStatus: false , //抵值券弹出
identityId : '' , //身份
symptomsArr: '' , //报告列表
isOfficial : app.globalData.isOfficial, //公众号-场景值
followState: false //公众号弹出
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
wx.login({
success: res => {
this.setData({
loginCode: res.code
})
}
})
// 商品详情数据
wx.$api.index.goods(1).then(res => {
this.setData({
detailsImg: res.data.content.replace(/\<img/gi, '<img style="max-width:100%;height:auto;display:block;"')
})
}).catch(err => {})
// 获取登录状态
if(wx.getStorageSync("token")){
this.setData({
userLogin: true
})
// 获取用户信息
this.userInfo();
// 获取公众号二维码
wx.$api.user.invitesCode().then(res => {
this.setData({
code: res.data.code
})
}).catch(err => {})
}
// 获取首页数据
this.mallData();
},
/**
* 首页数据
*/
mallData() {
wx.$api.index.home().then(res => {
this.setData({
case : res.data.steps.lists.case,
case_log : res.data.steps.lists.case_log,
experience : res.data.steps.lists.experience,
order : res.data.steps.lists.order,
payment : res.data.steps.lists.payment,
register : res.data.steps.lists.register,
stepsSign : res.data.steps.lists.sign,
subscribe : res.data.steps.lists.subscribe,
showSymptom : res.data.showSymptoms,
max : res.data.steps.max,
min : res.data.steps.min,
count : res.data.count,
hasCase : res.data.hasCase,
sign : res.data.user.sign
})
if(res.data.case != '') {
this.setData({
symptomsArr: res.data.case.all_symptoms,
goutCaseId : res.data.case.gout_case_id
})
}
if(res.data.user.identity) {
this.setData({
identityId: res.data.identity.order
})
}
}).catch(err => {})
},
/**
* 用户信息
*/
userInfo() {
wx.$api.user.userIndex().then(res => {
this.setData({
nowStatus : res.data.nowStatus
})
}).catch(err => {})
},
/**
* 申请体验馆状态隐藏
*/
applySee() {
this.setData({
applyState: false
})
},
/**
* 获取code
*/
followCode() {
wx.getUserProfile({
desc : "获取你的昵称、头像、地区及性别",
success : e => {
if(e.errMsg == "getUserProfile:ok"){
wx.$api.user.wechatMini({
code :this.data.loginCode,
iv : e.iv,
encryptedData: e.encryptedData
}).then(res => {
// subscribe == 0未关注公众号
if (res.data.subscribe == 0) {
this.setData({
followState: true
})
return
}
// 获取首页数据 subscribe == 1已 关注公众号
this.mallData();
}).catch(err => {})
}
},
fail: err => {
return;
}
})
},
/**
* 公众号弹出
*/
followHide() {
this.setData({
followState: !this.data.followState
})
}
})

5
pages/index/index.json Normal file
View File

@@ -0,0 +1,5 @@
{
"usingComponents": {},
"navigationStyle": "custom",
"navigationBarTextStyle": "white"
}

254
pages/index/index.wxml Normal file
View File

@@ -0,0 +1,254 @@
<view class="exhibition" wx:if="{{applyState}}">
<view class="exhibition-img">
<rich-text nodes="{{detailsImg}}"></rich-text>
</view>
<view class="exhibition-btn" bindtap="applySee">
<view class="exhibition-btn-go">点击参与活动</view>
</view>
</view>
<block wx:if="{{!applyState}}">
<!-- 近期报告 -->
<image class="banner" src="/static/imgs/banner.png" mode="widthFix"></image>
<!-- 效果反馈入口 -->
<block wx:if="{{!applyState}}">
<view class="drift" wx:if="{{showSymptom}}">
<navigator hover-class="none" url="./feeling/index" class="drift-brief" wx:if="{{identityId != 1}}">
效果反馈
</navigator>
</view>
</block>
<block wx:if="{{userLogin}}">
<!-- 水宣传图 -->
<view class="report" wx:if="{{showSymptom}}">
<!-- 有数据 -->
<scroll-view scroll-x class="report-flex" scroll-with-animation>
<view class="report-item" wx:for="{{symptomsArr}}" wx:key="symptomsArr">
<view class="report-name">
<text>{{item.title}}</text>
<view class="report-date">{{item.created_at ? item.created_at : '--'}}</view>
</view>
<image class="report-img" wx:if="{{item.name == 'hypertension'}}" src="/static/imgs/reportImg_00.png" mode="widthFix"></image>
<image class="report-img" wx:elif="{{item.name == 'hyperglycemia'}}" src="/static/imgs/reportImg_01.png" mode="widthFix"></image>
<image class="report-img" wx:elif="{{item.name == 'hyperlipidemia'}}" src="/static/imgs/reportImg_03.png" mode="widthFix"></image>
<image class="report-img" wx:else src="/static/imgs/reportImg_02.png" mode="widthFix"></image>
<view class="report-number">
<block wx:if="{{item.isChose}}">
<view class="report-number-last">{{item.name == 'hypertension' ? '高 ~ 低' : '数值'}}</view>
{{item.name == 'hypertension' ? item.high + '~' : ''}}{{item.low}}
<text>{{item.unit}}</text>
</block>
<view class="healthy" wx:else>
<view class="report-number-last"></view>
<view wx:if="{{item.name == 'hypertension'}}" class="report-see red">健康</view>
<view wx:elif="{{item.name == 'hyperglycemia'}}" class="report-see yellow">健康</view>
<view wx:elif="{{item.name == 'hyperlipidemia'}}" class="report-see peony">健康</view>
<view wx:else class="report-see purple">健康</view>
</view>
</view>
</view>
</scroll-view>
</view>
<!-- 未有数据 -->
<view class="npReport" wx:else>
<view class="npReport-tits">针对亚健康人群的一次喝水体验活动</view>
</view>
</block>
<!-- 未有数据 -->
<view class="npReport" wx:else>
<view class="npReport-tits">针对亚健康人群的一次喝水体验活动</view>
</view>
<!-- 任务流程 -->
<view class="task">
<view class="white">
<view class="task-title">
<view class="task-title-name">
参与活动流程
</view>
<view class="task-title-number">
已完成 {{min}}/{{max}}
</view>
</view>
<view class="task-list">
<view class="item {{register.status == 2 ? 'active' : ''}}">
<view class="name">
<view class="title">
<view class="circular {{register.status == 2 ? 'active' : ''}}">1</view>
<text>{{register.name}}</text>
</view>
<view class="tips">手机号+验证码</view>
</view>
<!-- register.status 0为待完成 1位去完成 2位已完成 -->
<view class="btn" wx:if="{{register.status == 0}}">
<text>{{register.buttonText}}</text>
</view>
<view class="btn active" wx:elif="{{register.status == 1}}">
<navigator hover-class="none" url="/pages/login/index">{{register.buttonText}}</navigator>
</view>
<view class="btn complete" wx:else>
<text>{{register.buttonText}}</text>
</view>
</view>
<view class="item {{case.status == 2 ? 'active' : ''}}">
<view class="name">
<view class="title">
<view class="circular {{case.status == 2 ? 'active' : ''}}">2</view>
<text>{{case.name}}</text>
</view>
<view class="tips">姓名、性别、年龄、身高、体重</view>
</view>
<!-- case.status 0为待完成 1位去完成 2位已完成 -->
<view class="btn" wx:if="{{case.status == 0}}">
<text>{{case.buttonText}}</text>
</view>
<view class="btn active" wx:elif="{{case.status == 1}}">
<navigator hover-class="none" url="/pages/record/index/index?experience=1">{{case.buttonText}}</navigator>
</view>
<view class="btn complete" wx:else>
<text>{{case.buttonText}}</text>
</view>
</view>
<view class="item {{experience.status == 2 ? 'active' : ''}}">
<view class="name">
<view class="title">
<view class="circular {{experience.status == 2 ? 'active' : ''}}">3</view>
<text>{{experience.name}}({{experience.identity.count}}/{{experience.identity.max}})</text>
</view>
<view class="tips">亚健康报告、限深圳、1000名额</view>
</view>
<!-- experience.status 0为待完成 1位去完成 2位已完成 -->
<view class="btn" wx:if="{{experience.status == 0}}">
<text>{{experience.buttonText}}</text>
</view>
<view class="btn active" wx:elif="{{experience.status == 1}}">
<navigator hover-class="none" url="/pages/stock/examine/index" wx:if="{{experience.view}}">{{experience.buttonText}}</navigator>
<navigator hover-class="none" url="/pages/record/report/index?caseid={{goutCaseId}}&number=first" wx:else>{{experience.buttonText}}</navigator>
</view>
<view class="btn complete" wx:else>
<text>{{experience.buttonText}}</text>
</view>
</view>
<view class="item {{subscribe.status == 2 ? 'active' : ''}}">
<view class="name">
<view class="title">
<view class="circular {{subscribe.status == 2 ? 'active' : ''}}">4</view>
<text>{{subscribe.name}}</text>
</view>
<view class="tips">接收打卡和发货的消息提醒</view>
</view>
<!-- subscribe.status 0为待完成 1位去完成 2位已完成 -->
<view class="btn" wx:if="{{subscribe.status == 0}}">
<text>{{subscribe.buttonText}}</text>
</view>
<view class="btn active" wx:elif="{{subscribe.status == 1}}">
<text bindtap="followCode">{{subscribe.buttonText}}</text>
</view>
<view class="btn complete" wx:else>
<text>{{subscribe.buttonText}}</text>
</view>
</view>
<view class="item {{payment.status == 2 ? 'active' : ''}}">
<view class="name">
<view class="title">
<view class="circular {{payment.status == 2 ? 'active' : ''}}">5</view>
<text>{{payment.name}}</text>
</view>
<view class="tips">成为锶享体验官</view>
</view>
<!-- payment.status 0为待完成 1位去完成 2位已完成 -->
<view class="btn" wx:if="{{payment.status == 0}}">
<text>{{payment.buttonText}}</text>
</view>
<view class="btn active" wx:elif="{{payment.status == 1}}">
<navigator hover-class="none" url="/pages/bond/index?identityid={{payment.identity_id}}">{{payment.buttonText}}</navigator>
</view>
<view class="btn complete" wx:else>
<text>{{payment.buttonText}}</text>
</view>
</view>
<view class="item {{order.status == 2 ? 'active' : ''}}">
<view class="name">
<view class="title">
<view class="circular {{order.status == 2 ? 'active' : ''}}">6</view>
<text>{{order.name}}</text>
</view>
<view class="tips">申请提货+确定签收</view>
</view>
<!-- stockCarry.status 0为待完成 1位去完成 2位已完成 -->
<view class="btn" wx:if="{{order.status == 0}}">
<text>{{order.buttonText}}</text>
</view>
<view class="btn active" wx:elif="{{order.status == 1}}">
<navigator hover-class="none" url="/pages/order/details/index?orderNo={{order.order_no}}" wx:if="{{order.order_no}}">{{order.buttonText}}</navigator>
<navigator hover-class="none" url="/pages/stock/take/index" wx:else>{{order.buttonText}}</navigator>
</view>
<view class="btn complete" wx:else>
<text>{{order.buttonText}}</text>
</view>
</view>
<view class="item {{stepsSign.status == 2 ? 'active' : ''}}">
<view class="name">
<view class="title">
<view class="circular {{stepsSign.status == 2 ? 'active' : ''}}">7</view>
<text>{{stepsSign.name}}</text>
</view>
<view class="tips">每日4瓶连续30天喝水打卡</view>
<view class="tips">建议水温加热至40到50度效果最佳</view>
<view class="number">{{stepsSign.sign.continue}}/{{stepsSign.sign.all}}天</view>
</view>
<!-- sign.status 0为待完成 1位去完成 2位已完成 -->
<view class="btn" wx:if="{{stepsSign.status == 0}}">
<text>{{stepsSign.buttonText}}</text>
</view>
<view class="btn active" wx:elif="{{stepsSign.status == 1}}">
<navigator hover-class="none" url="/pages/sign/index">{{stepsSign.buttonText}}</navigator>
</view>
<view class="btn complete" wx:else>
<text>{{stepsSign.buttonText}}</text>
</view>
</view>
<view class="item {{case_log.has_log ? 'active' : ''}}">
<view class="name">
<view class="title">
<view class="circular {{case_log.has_log ? 'active' : ''}}">8</view>
<text>{{case_log.name}}</text>
</view>
<view class="tips">近期亚健康体检报告信息</view>
<navigator hover-class="none" url="/pages/record/reportSee/index" wx:if="{{case_log.status == 2}}" class="see">
查看报告
</navigator>
</view>
<!-- case_log.status 0为待完成 1位去完成 2位已完成 -->
<view class="btn" wx:if="{{case_log.status == 0}}">
<text>{{case_log.buttonText}}</text>
</view>
<view class="btn active" wx:elif="{{case_log.status == 1}}">
<navigator hover-class="none" url="/pages/record/healthy/index" wx:if="{{case_log.has_log}}">{{case_log.buttonText}}</navigator>
<navigator hover-class="none" url="/pages/record/report/index?caseid={{goutCaseId}}&number=second" wx:else>{{case_log.buttonText}}</navigator>
</view>
<view class="btn complete" wx:else>
<text>{{case_log.buttonText}}</text>
</view>
</view>
</view>
</view>
</view>
</block>
<!-- 公众号弹出 -->
<view class="followPop {{followState ? 'active' : ''}}"></view>
<view class="followCont {{followState ? 'active' : ''}}">
<view class="followText">
<!-- <block wx:if="{{isOfficial}}">
<view class="weChat-title">关注公众号</view>
<image class="weChat-close" src="/static/icons/uricacidClose.png" bindtap="followHide"></image>
<official-account style="position:absolute;top:90rpx;left:0;width:50%;height:168rpx;" bindload="load" binderror="err"></official-account>
</block> -->
<view class="weChat-title">关注公众号</view>
<image class="weChat-close" src="/static/icons/uricacidClose.png" bindtap="followHide"></image>
<image class="weChat-img" src="/static/imgs/weChat_code.png" mode="widthFix"></image>
<view class="weChat-text">截图扫码,关注公众号</view>
</view>
</view>

435
pages/index/index.wxss Normal file
View File

@@ -0,0 +1,435 @@
/* 申请体验馆 */
.exhibition-img {
width: 100%;
border-bottom: 90rpx solid transparent;
}
.exhibition-btn {
position: fixed;
bottom: 0;
left: 0;
z-index: 99;
width: 100%;
text-align: center;
padding: 30rpx;
box-sizing: border-box;
}
.exhibition-btn-go {
background-color: #e8c198;
color: #442b11;
border-radius: 50rpx;
height: 90rpx;
line-height: 90rpx;
}
.banner {
width: 100%;
}
/* 近期报告 */
.report {
box-sizing: border-box;
position: relative;
top: -130rpx;
left: 0;
}
.report-flex {
white-space: nowrap;
flex-direction: row;
align-items: center;
justify-content: space-around;
width: 100%;
box-sizing: border-box;
}
.report-item {
border-radius: 30rpx;
width: 39%;
padding: 20rpx;
box-sizing: border-box;
display: inline-block;
margin-left: 25rpx;
background-color: white;
}
.report-item:last-child {
margin-right: 25rpx;
}
.report-name {
margin-bottom: 15rpx;
display: flex;
line-height: 40rpx;
}
.report-name text {
font-weight: 600;
font-size: 32rpx;
display: inline-block;
flex: 1;
}
.report-date {
font-size: 28rpx;
color: #9d9d9d;
}
.report-img {
width: 100%;
padding: 10rpx 0 0;
}
.report-number {
font-size: 32rpx;
font-weight: 600;
height: 74rpx;
overflow: hidden;
}
.report-number text {
font-size: 26rpx;
color: #9d9d9d;
padding-left: 8rpx;
font-weight: normal;
}
.healthy {
font-size: 30rpx;
text-align: center;
}
.report-see.red {
color: #608ee4;
}
.report-see.yellow {
color: #f4951a;
}
.report-see.purple {
color: #a843fc;
}
.report-see.peony {
color: #d30047;
}
.report-number-last {
font-size: 26rpx;
color: #ff7894;
height: 30rpx;
line-height: 30rpx;
}
/* 未有数据 */
.npReport {
position: relative;
top: -90rpx;
left: 0;
padding: 30rpx 20rpx;
box-sizing: border-box;
text-align: center;
}
.npReport-tits {
font-size: 34rpx;
background-color: #ffffff;
border-radius: 30rpx;
padding: 30rpx;
box-sizing: border-box;
font-weight: 600;
color: #6774ff;
}
/* 任务流程 */
.task {
margin-top: -130rpx;
padding: 30rpx 25rpx;
box-sizing: border-box;
}
.white {
background-color: #FFFFFF;
border-radius: 30rpx;
padding: 0 30rpx;
box-sizing: border-box;
}
.task-title {
line-height: 40rpx;
display: flex;
padding: 30rpx 0 10rpx;
}
.task-title-name {
font-weight: 600;
flex: 1;
position: relative;
padding-left: 62rpx;
}
.task-title-name::after {
position: absolute;
content: '';
width: 16rpx;
height: 16rpx;
border-radius: 50%;
border: 4rpx solid #ffb8b2;
left: 10rpx;
top: calc(50% - 12rpx);
background-color: #ff321f;
}
.task-title-number {
font-size: 28rpx;
color: #9d9d9d;
}
.task-list {
padding-bottom: 30rpx;
box-sizing: border-box;
}
.item {
padding: 30rpx 0;
position: relative;
}
.item:last-child {
padding-bottom: 0;
margin-bottom: 0;
}
.item::before {
position: absolute;
content: '';
height: 2rpx;
width: calc(100% - 62rpx);
left: 62rpx;
bottom: 0;
background-color: #ecf4f6;
}
.item::after {
position: absolute;
content: '';
height: 100%;
width: 0;
border-left: 2rpx #b4baf7 dashed;
left: 20rpx;
top: 40rpx;
}
.item.active::after {
border-left: 2rpx #2e40f7 dashed;
}
.item:last-child::after {
height: calc(100% - 40rpx);
}
.item:last-child::before {
display: none;
}
.name {
position: relative;
}
.title {
font-size: 28rpx;
color: #000000;
display: flex;
line-height: 42rpx;
position: relative;
}
.title text {
display: flex;
width: 100%;
padding-left: 62rpx;
}
.circular {
background-color: #b4baf7;
border: 6rpx solid #dee1ff;
width: 30rpx;
height: 30rpx;
line-height: 30rpx;
text-align: center;
border-radius: 50%;
font-size: 24rpx;
color: #FFFFFF;
position: absolute;
z-index: 9;
}
.circular.active {
background-color: #2e40f7;
border: 6rpx solid #b4baf7;
}
.tips {
color: #9d9d9d;
font-size: 26rpx;
line-height: 48rpx;
padding-left: 62rpx;
box-sizing: border-box;
}
.see {
display: inline-block;
padding-left: 10rpx;
color: #6774ff;
padding-left: 62rpx;
font-size: 28rpx;
}
.number {
color: #9d9d9d;
padding-left: 62rpx;
font-size: 28rpx;
margin-top: 6rpx;
}
.number.active {
color: #fcb338;
font-weight: 600;
}
.btn {
position: absolute;
right: 0;
top: 40rpx;
background-color: #efeff7;
color: #7b8199;
font-size: 28rpx;
border-radius: 90rpx;
width: 130rpx;
text-align: center;
height: 58rpx;
line-height: 58rpx;
}
.btn.active {
background-color: #6774ff;
color: #FFFFFF;
}
.btn.complete {
background-color: #fe321f;
color: #ffffff;
}
.btn text {
display: block;
}
/* 浮动入口 */
.drift {
position: absolute;
top: 200rpx;
right: 0;
z-index: 999;
}
.drift-brief {
background: rgba(35, 45, 85, .6);
color: #FFFFFF;
font-size: 26rpx;
padding: 0 20rpx 0 25rpx;
line-height: 60rpx;
border-radius: 60rpx 0 0 60rpx;
}
.drift-card {
margin: 30rpx 20rpx;
width: 80rpx;
height: 80rpx;
float: right;
}
/* 公众号关注 */
.followPop {
position: fixed;
width: 100%;
height: 100%;
left: 0;
top: 0;
z-index: 99;
background-color: rgba(0, 0, 0, .4);
display: none;
}
.followPop.active{
display: block;
}
.followCont {
width: 100%;
height: 100%;
left: 0;
top: 0;
position: fixed;
z-index: 100;
display: none;
}
.followCont.active{
display: block;
}
.followText {
position: absolute;
left: 50%;
top: 50%;
width: 500rpx;
margin-left: -250rpx;
margin-top: -260rpx;
border-radius: 20rpx;
overflow: hidden;
background-color: #ffffff;
text-align: center;
}
.followText.active {
width: 300px;
height: 250rpx;
margin-top: -130rpx;
margin-left: -150px;
}
.weChat-close {
position: absolute;
right: 30rpx;
top: 25rpx;
width: 38rpx;
height: 38rpx;
}
.weChat-img {
width: 60%;
margin: 30rpx auto 0;
}
.weChat-title {
height: 90rpx;
line-height: 90rpx;
border-bottom: 2rpx dashed rgb(236, 236, 236);
font-weight: 600;
}
.weChat-text {
font-size: 28rpx;
color: #9d9d9d;
line-height: 60rpx;
padding-bottom: 30rpx;
}
.weChat-tips {
width: 300px;
height: 84px;
}

128
pages/index/write/index.js Normal file
View File

@@ -0,0 +1,128 @@
/*
* 手太欠
* 愿这世界都如故事里一样 美好而动人~
*/
Page({
/**
* 页面的初始数据
*/
data: {
score : '', //水滴值
albumArr : [], //图片
disabled : false, //按钮状态
popStatus: false, //获得水滴弹出层状态
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
},
// 上传商品封面图片
addAlbum(key){
wx.chooseMedia({
success : res => {
let path = res.tempFiles.map((val, index) => {
return {
name: 'uploads' + index,
uri : val.tempFilePath
}
})
for (let i = 0; i < path.length; i++){
wx.$api.file.uploadImg(path[i].uri, {}).then(updRes => {
let albumArr = this.data.albumArr
albumArr.push({
path: updRes.path,
showpath: updRes.url
})
this.setData({
albumArr
})
}).catch(err => {})
}
}
})
},
// 图片预览
openImg(index){
let paths = this.data.albumArr.map(val => {
return val.showpath
})
wx.previewImage({
urls : paths,
current : index,
indicator: 'number'
})
},
// 删除图片
removeImg(e){
wx.showLoading({
title: '加载中'
})
let index = e.currentTarget.dataset.index,
atalbum = this.data.albumArr
wx.showToast({
title: '删除成功',
icon : 'none'
})
atalbum.splice(index,1)
this.setData({
albumArr : atalbum
})
},
// 发布反馈
writeform(e) {
let newPictures = this.data.albumArr.map(val => {
return val.path
})
if(this.data.albumArr.length <= 0) {
wx.showToast({
title: '缺少反馈图片',
icon : 'none'
})
return
}
let data = {
content : e.detail.value.content,
pictures : newPictures
}
wx.$api.index.surveysForm(data).then(res => {
this.setData({
disabled: true
})
if(res.data.score > 0) {
this.setData({
score : res.data.score,
popStatus: true
})
return
}
wx.redirectTo({
url: "/pages/index/feeling/index"
})
}).catch(err => {})
},
// 我知道了
knowClick() {
this.setData({
popStatus: false
})
wx.redirectTo({
url: "/pages/index/feeling/index"
})
}
})

View File

@@ -0,0 +1,4 @@
{
"usingComponents": {},
"navigationBarTitleText": "效果反馈"
}

View File

@@ -0,0 +1,40 @@
<form bindsubmit="writeform" class="site-form">
<view class="issue-block">
<view class="issue-textarea">
<textarea placeholder="请输入您要发布的内容~" name="content"></textarea>
</view>
<view class="album-list">
<view class="album-list-li" wx:for="{{albumArr}}" wx:key="albumArr">
<image class="album-list-img" src="{{item.showpath}}" mode="aspectFill" bindtap="openImg" data-index="{{index}}"></image>
<view class="album-remove" bindtap="removeImg" data-index="{{index}}">删除</view>
</view>
<view class="album-list-li">
<view class="album-list-li-add" bindtap="addAlbum">
<image class="album-list-add-icon" src="/static/icons/circle_add.png"></image>
<view>添加</view>
</view>
</view>
</view>
</view>
<view class="site-btn">
<button form-type="submit" size="mini" disabled="{{disabled}}">立即发布</button>
</view>
</form>
<!-- 提示弹出框 start -->
<view class="publicBack {{popStatus ? 'active' : ''}}"></view>
<view class="publicPop {{popStatus ? 'active' : ''}}">
<view class="publicPop-cont">
<image class="publicPop-img" src="/static/imgs/Water_drop.png" mode="widthFix"></image>
<view class="publicPop-text">
<view class="number">+{{score}}</view>
<text>水滴</text>
</view>
<image class="publicPop-left publicPop-right" src="/static/imgs/Water_img.png" mode="widthFix"></image>
<view class="publicPop-tips">
<image src="/static/imgs/Water_icon.png" mode="widthFix"></image>水滴已发放!
</view>
<image class="publicPop-left" src="/static/imgs/Water_img.png" mode="widthFix"></image>
</view>
<image src="/static/icons/waterPop_close.png" mode="widthFix" class="publicPop-close" bindtap="knowClick"></image>
</view>

View File

@@ -0,0 +1,192 @@
page {
background-color: #f5f5f5;
padding: 30rpx;
box-sizing: border-box;
}
.issue-block {
background: white;
padding: 30rpx;
box-sizing: border-box;
border-radius: 10rpx;
}
.issue-textarea textarea {
width: 100%;
height: 200rpx;
}
.album-list {
display: flex;
flex-wrap: wrap;
}
.album-list-li {
margin-right: 10rpx;
position: relative;
width: calc(25% - 10rpx);
padding-top: calc(25% - 10rpx);
box-sizing: border-box;
}
.album-list-li:last-child {
margin: 0;
}
.album-list-img,
.album-list-li-add {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: #f5f5f5;
border-radius: 6rpx;
}
.album-list-li-add {
text-align: center;
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-box-pack: center;
color: #666;
font-size: 26rpx;
}
.album-list-add-icon {
width: 34rpx;
height: 34rpx;
}
.album-remove {
position: absolute;
right: 0;
bottom: 0;
background: rgba(0, 0, 0, .5);
color: white;
font-size: 28rpx;
text-align: center;
line-height: 50rpx;
width: 100%;
z-index: 9;
}
.site-btn {
margin-top: 120rpx;
}
.site-btn button[size="mini"] {
width: 100%;
background: #1d37e2;
height: 88rpx;
line-height: 88rpx;
font-size: 30rpx;
color: white;
padding: 0;
}
.site-btn button[disabled] {
background: #7789ff !important;
color: #fff !important;
}
/* 获得水滴弹出层提示 */
.publicBack {
position: fixed;
width: 100vw;
height: 100vh;
left: 0;
top: 0;
background-color: rgba(0, 0, 0, .5);
z-index: 99;
display: none;
}
.publicBack.active {
display: block;
}
.publicPop {
left: 50%;
top: 50%;
width: 440rpx;
height: 300rpx;
margin-left: -220rpx;
margin-top: -200rpx;
position: fixed;
z-index: 100;
background-color: #ffffff;
border-radius: 30rpx;
text-align: center;
display: none;
}
.publicBack.active {
display: block;
}
.publicPop-close {
position: absolute;
top: -20rpx;
right: -20rpx;
z-index: 102;
width: 54rpx;
height: 54rpx;
}
.publicPop-img {
width: 70%;
margin: -30rpx auto 0;
}
.publicPop-text {
padding-bottom: 20rpx;
box-sizing: border-box;
font-weight: 600;
color: #e56653;
padding-top: 40rpx;
}
.number {
font-size: 72rpx;
display: inline-block;
padding-right: 10rpx;
}
.publicPop-text text {
font-size: 36rpx;
display: inline-block;
line-height: 86rpx;
vertical-align: bottom;
}
.publicPop-tips {
position: absolute;
bottom: 0;
left: 0;
width: 100%;
background-color: #fdfae7;
color: #e6a950;
line-height: 80rpx;
font-weight: 600;
border-top: 2rpx solid #f6ede6;
border-radius: 0 0 30rpx 30rpx;
}
.publicPop-tips image {
width: 54rpx;
height: 54rpx;
vertical-align: -14rpx;
}
.publicPop-left {
width: 90rpx;
position: absolute;
top: 46%;
right: 2rpx;
}
.publicPop-right {
transform: rotate(180deg);
left: 2rpx;
}

View File

@@ -0,0 +1,31 @@
/*
* 手太欠
* 愿这世界都如故事里一样 美好而动人~
*/
Page({
/**
* 页面的初始数据
*/
data: {
content: ''
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
// 获取用户协议
wx.$api.auth.registeragree(options.type).then(res => {
this.setData({
content: res.data.content
})
}).catch(err => {})
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {},
})

View File

@@ -0,0 +1,3 @@
{
"usingComponents": {}
}

View File

@@ -0,0 +1,3 @@
<view class="agreement-content">
<rich-text nodes="{{content}}"></rich-text>
</view>

View File

@@ -0,0 +1,5 @@
.agreement-content{
padding: 30rpx;
box-sizing: border-box;
font-size: 32rpx;
}

162
pages/login/index.js Normal file
View File

@@ -0,0 +1,162 @@
/*
* 手太欠
* 愿这世界都如故事里一样 美好而动人~
*/
Page({
/**
* 页面的初始数据
*/
data: {
phone : "",
code : "",
parentId: "", //邀请码
newUser : '', //是否为新用户
checked : false, //勾选协议
codename: '获取验证码',
getSms : false
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
// 是否有邀请码
if(options) {
this.setData({
parentId : options.invite || '',
channelId : options.channel || ''
})
}
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
},
/**
* 手机号码
*/
bindInput(e) {
this.setData({
phone: e.detail.value
})
},
/**
* 短信验证码
*/
bindCode(e) {
this.setData({
code: e.detail.value
})
},
/**
* 获取短信验证码
*/
getPhoneCode(e) {
let mobile = this.data.phone,
myreg = /^(14[0-9]|13[0-9]|15[0-9]|17[0-9]|18[0-9])\d{8}$$/
var _this = this
if (mobile == "") {
wx.showToast({
title : '手机号不能为空',
icon : 'none',
duration : 1000
})
return false;
}else if (!myreg.test(mobile)) {
wx.showToast({
title : '请输入正确的手机号',
icon : 'none',
duration : 1000
})
return false;
}else{
wx.$api.auth.getSms({
mobileNo: mobile
}).then(res=>{
_this.setData({
newUser : res.data.new,
getSms : true
})
wx.showToast({
title : '发送成功',
icon : 'success',
duration: 2000
})
var num = 60;
var timer = setInterval(function () {
num--;
if (num <= 0) {
clearInterval(timer);
_this.setData({
codename : '重新发送',
getSms : false
})
} else {
_this.setData({
codename : num + "s后重新获取",
getSms : true
})
}
}, 1000)
}).catch(err=>{})
}
},
/**
* 邀请码
*/
parentInput(e) {
this.setData({
parentId: e.detail.value
})
},
/**
* 用户登录
*/
login() {
if(this.data.checked) {
wx.$api.auth.smsAuth({
mobileNo : this.data.phone,
code : this.data.code,
invite : this.data.parentId,
channel : this.data.channelId
}).then(res=>{
// 写入缓存
wx.setStorage({
key : 'token',
data : res.data.token_type + ' ' + res.data.access_token
})
// 回到首页
wx.switchTab({
url: '/pages/mall/index/index'
})
}).catch(err=>{})
} else {
wx.showToast({
title: '请勾选用户隐私和服务协议',
icon: "none"
})
}
},
// 勾选协议
radioChange() {
this.setData({
checked: !this.data.checked
})
}
})

4
pages/login/index.json Normal file
View File

@@ -0,0 +1,4 @@
{
"usingComponents": {},
"navigationBarTitleText": "锶源昆仑"
}

28
pages/login/index.wxml Normal file
View File

@@ -0,0 +1,28 @@
<view class="login-top">
<view class="top-logo-content">
手机号快捷登录
</view>
未注册的手机号码将自动注册
</view>
<!-- 输入手机号相关 -->
<view class="inputs phone">
<label class="label">+86</label>
<input type="number" placeholder="输入您的手机号码" maxlength="11" name="phone" bindinput="bindInput" class="inputs-phone" />
</view>
<view class="inputs sms">
<input type="number" placeholder="输入短信验证码" maxlength="4" name="code" class="inputs-sms" bindinput="bindCode" />
<button class="sms-btn" type="default" size="mini" disabled="{{phone == '' || getSms}}" bindtap="getPhoneCode">{{codename}}</button>
</view>
<view class="inputs" wx:if="{{newUser}}">
<input placeholder="邀请码 (选填)" maxlength="10" value="{{parentId}}" bindinput="parentInput" />
</view>
<button class="btn" type="default" disabled="{{phone == '' || code == ''}}" bindtap="login">登录</button>
<!-- 用户登录注册协议 -->
<view class="agreement">
<checkbox-group bindchange="radioChange">
<checkbox color="#4490ff" checked="{{checked}}" size='10' class="radioGroup" />
</checkbox-group>
<view class="agreement-text">
登录即表示同意用户<navigator hover-class="none" url="./agreement/index?type=secret">《隐私协议》</navigator>和<navigator hover-class="none" url="./agreement/index?type=protocol">《服务协议》</navigator>
</view>
</view>

164
pages/login/index.wxss Normal file
View File

@@ -0,0 +1,164 @@
page {
height: 100vh;
width: 100vw;
padding: 90rpx 60rpx;
box-sizing: border-box;
background: white;
}
.login-top {
height: 17vh;
width: 100%;
flex-direction: row;
align-items: flex-end;
justify-content: center;
box-sizing: border-box;
position: relative;
color: #919191;
}
.top-bg {
position: absolute;
bottom: 30rpx;
z-index: 2;
width: 740rpx;
}
.top-logo-content {
box-sizing: border-box;
color: #000;
font-weight: 600;
font-size: 40rpx;
margin-bottom: 10rpx;
}
.top-logo {
margin-bottom: 20rpx;
width: 146rpx;
height: 146rpx;
}
.inputs {
background: rgba(68, 144, 255, 0.05);
border: solid 1rpx #f2f2f2;
position: relative;
margin-top: 30rpx;
height: 80rpx;
line-height: 80rpx;
}
.inputs input {
width: 100%;
height: 80rpx;
line-height: 80rpx;
padding: 0 30rpx;
border: none;
box-sizing: border-box;
font-size: 30rpx;
}
input.inputs-phone {
padding-left: 150rpx;
}
input.inputs-sms {
padding-right: 200rpx;
}
.label {
position: absolute;
left: 0;
top: 0;
width: 120rpx;
text-align: center;
border-right: solid 1rpx #f2f2f2;
font-size: 30rpx;
}
.sms-btn[size='mini'] {
font-weight: normal;
height: 77rpx;
line-height: 77rpx;
position: absolute;
top: 1rpx;
right: 1rpx;
padding: 0 20rpx;
margin: 0;
border-radius: 0;
border-left: solid 1rpx #f2f2f2;
color: #4490ff !important;
font-size: 30rpx;
background-color: transparent !important;
}
.sms-btn::after {
border: none;
}
.sms-btn[disabled] {
color: rgba(68, 144, 255, .6) !important;
}
.title {
text-align: center;
font-size: 38rpx;
font-weight: bold;
color: #2a2a2a;
margin-bottom: 100rpx;
}
.btn {
background: #4490ff !important;
width: 100% !important;
color: white !important;
border-radius: 0;
margin-top: 30rpx;
font-size: 32rpx;
line-height: 90rpx;
height: 90rpx;
font-weight: bold;
padding: 0;
}
.btn::after {
border: none;
}
.btn[disabled] {
background: rgba(68, 144, 255, .6) !important;
}
.beianNo {
font-size: 26rpx;
color: #9d9d9d;
text-align: center;
padding-top: 60rpx;
position: fixed;
width: 100%;
left: 0;
bottom: 50rpx;
}
/* 协议 */
.agreement {
font-size: 26rpx;
color: #9d9d9d;
margin-top: 20rpx;
display: flex;
}
.radioGroup {
transform: scale(.6);
width: 55rpx;
text-align: left;
}
.agreement-text {
width: calc(100% - 55rpx);
line-height: 48rpx;
}
.agreement-text navigator {
color: #000;
display: inline-block;
}

View File

@@ -0,0 +1,107 @@
/*
* 手太欠
* 愿这世界都如故事里一样 美好而动人~
*/
Page({
/**
* 页面的初始数据
*/
data: {
categoriesArr: '', //分类
articlesArr : [] , //列表
page : {}, //分页信息
listType : 0, //类型
name : '', //名称
lodingStats : false, //加载状态
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
// 获取分类
this.classifysInfo();
// 获取列表
this.articlesInfo();
},
// 分类
classifysInfo(){
wx.$api.mall.classifysAll().then(res => {
let Arr = res.data
let valueFirst = {
category_id: 0,
slug : "ALL",
title : "全部"
}
Arr.unshift(valueFirst)
this.setData({
categoriesArr : Arr
})
}).catch(err => {})
},
// 列表
articlesInfo(page){
wx.$api.mall.favorites({
category_id : this.data.listType,
page : page || 1
}).then(res => {
let listArr = this.data.articlesArr,
newData = []
if(page == 1 || page == undefined) listArr = []
newData = listArr.concat(res.data.data)
this.setData({
articlesArr : newData,
page : res.data.page,
lodingStats : false
})
wx.stopPullDownRefresh()
}).catch(err => {})
},
/**
* 状态筛选
*/
onTabs(val){
console.log(val)
if(this.data.listType === val) return
this.setData({
listType: val.currentTarget.dataset.type
})
// 商品详情数据
this.articlesInfo();
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
// 获取列表
this.articlesInfo();
},
/**
* 上拉加载
*/
onReachBottom(){
this.setData({
lodingStats: true
})
let pageNumber = this.data.page.current
if(this.data.page.has_more){
pageNumber++
// 获取列表
this.articlesInfo(pageNumber);
}
}
})

View File

@@ -0,0 +1,4 @@
{
"usingComponents": {},
"navigationBarTitleText": "文章列表"
}

View File

@@ -0,0 +1,31 @@
<view class="header">
<view class="tabs">
<view wx:for="{{categoriesArr}}" wx:key="categoriesArr" class="tabs-item {{listType == item.category_id ? 'show' : ''}}" bindtap="onTabs" data-type="{{item.category_id}}">{{item.title}}</view>
</view>
</view>
<view class="list" wx:if="{{articlesArr.length > 0}}">
<navigator hover-class="none" url="/pages/mall/article/articleInfo/index?id={{item.article_id}}&type={{name}}" class="item" wx:for="{{articlesArr}}" wx:key="articlesArr">
<view class="itemCont">
<view class="nowrap itemCont-name"><text>{{item.categories[0].slug}}</text> | {{item.title}}</view>
<view class="nowrap itemCont-text">{{item.description}}</view>
<view class="itemCont-see">
<view class="itemCont-icon"><image src="https://api.siyuankunlun.com/storage/materials/2022/10/11/articleIcon_00.png"></image> {{item.clicks}}</view>
<view class="itemCont-icon"><image src="https://api.siyuankunlun.com/storage/materials/2022/10/11/articleIcon_01.png"></image>{{item.subscribes}}</view>
</view>
</view>
<image class="itemImg" mode="aspectFill" src="{{item.cover}}"></image>
</navigator>
<view class="pagesLoding" wx:if="{{lodingStats}}">
<block wx:if="{{page.has_more}}">
<image class="pagesLoding-icon" src="/static/icon/refresh_loding.gif" mode="widthFix"></image>加载中...
</block>
<block wx:else>
没有更多了~
</block>
</view>
</view>
<view class="pack-center pages-hint" wx:else>
<image src="/static/imgs/coupon_null.png"></image>
<view>暂无数据</view>
</view>

View File

@@ -0,0 +1,99 @@
page {
padding: 30rpx;
box-sizing: border-box;
background-color: #f6f6f6;
}
/* tabs */
.header {
position: fixed;
top: 0;
left: 0;
right: 0;
z-index: 99;
}
.tabs {
display: flex;
justify-content: space-around;
background: white;
padding: 15rpx 0;
font-size: 30rpx;
color: #9d9d9d;
}
.tabs-item {
height: 60rpx;
line-height: 60rpx;
}
.tabs-item.show {
color: #1d37e2;
border-bottom: solid 4rpx #1d37e2;
}
.list {
margin-top: 90rpx;
}
.item {
position: relative;
background-color: #ffffff;
border-radius: 10rpx;
height: 200rpx;
margin-bottom: 30rpx;
}
.itemImg {
position: absolute;
right: 0;
top: 0;
width: 200rpx;
height: 200rpx;
border-radius: 10rpx;
overflow: hidden;
}
.itemCont {
position: absolute;
left: 0;
top: 0;
padding: 25rpx 230rpx 0 30rpx;
box-sizing: border-box;
width: 100%;
}
.itemCont-name {
font-size: 30rpx;
}
.itemCont-name text {
text-transform: uppercase;
}
.itemCont-text {
color: #999;
font-size: 26rpx;
margin: 15rpx 0 30rpx;
font-weight: 200;
}
.itemCont-see {
color: #999;
display: flex;
font-size: 26rpx;
font-weight: 200;
}
.itemCont-icon {
display: flex;
margin-right: 50rpx;
line-height: 26rpx;
}
.itemCont-icon image {
width: 26rpx;
height: 26rpx;
margin-right: 10rpx;
}

View File

@@ -0,0 +1,137 @@
/*
* 手太欠
* 愿这世界都如故事里一样 美好而动人~
*/
Page({
/**
* 页面的初始数据
*/
data: {
id : '', //文章id
indexShow : '', //内容
mallContent : '', //简介
favoritesSee : '', //收藏状态
favoritesNumber : '', //收藏数量
subscribesSee : '', //点赞状态
subscribesNumber: '', //点赞数量
inviteText : '', //邀请码
isFixedTop : 0,
barHeight : getApp().globalData.statusBarHeight // 状态栏高度
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
this.setData({
id: options.id
})
if (options.type == 'memory') {
wx.setNavigationBarTitle({
title: '锶源昆仑·记忆'
})
} else if (options.type == 'wiki') {
wx.setNavigationBarTitle({
title: '锶源昆仑·健康百科'
})
}
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
// 获取详情数据
this.indexInfo();
// 获取登录状态
if(wx.getStorageSync("token")){
// 获取推广码
this.inviteInfo();
}
},
/**
* 推广码
*/
inviteInfo() {
wx.$api.user.invite().then(res => {
this.setData({
inviteText : res.data.invite
})
}).catch(err => {})
},
/**
* 详情数据
*/
indexInfo () {
wx.$api.mall.articlesSee(this.data.id).then(res => {
this.setData({
indexShow : res.data,
favoritesSee : res.data.isFavorite,
subscribesSee : res.data.isSubscribed,
favoritesNumber : res.data.favorites,
subscribesNumber: res.data.subscribes,
mallContent : res.data.content.replace(/\<img/gi, '<img style="max-width:100%;height:auto;display:block;"')
})
}).catch(err => {})
},
// 操作按钮
toolTap(e) {
let newName = e.currentTarget.dataset.name
// 收藏
if(newName == 'favorites') {
wx.$api.mall.favorite(this.data.id).then(res => {
this.setData({
favoritesSee : res.data.favorite,
favoritesNumber: res.data.count
})
}).catch(err => {})
return
}
// 点赞
wx.$api.mall.subscribe(this.data.id).then(res => {
this.setData({
subscribesSee : res.data.subscribed,
subscribesNumber: res.data.count
})
}).catch(err => {})
},
/**
* 微信分享
*/
onShareAppMessage(){
return {
title : this.data.indexShow.title,
imageUrl: this.data.indexShow.cover
}
},
// 返回上一页
returnGo() {
wx.navigateBack({
delta: 1
})
},
returnHome() {
wx.switchTab({
url: '/pages/mall/index/index'
})
},
/**
* 监听页面滑动事件
*/
onPageScroll(e) {
this.setData({
isFixedTop: parseInt(e.scrollTop)
});
},
})

View File

@@ -0,0 +1,5 @@
{
"usingComponents": {},
"navigationStyle": "custom",
"navigationBarTextStyle": "white"
}

View File

@@ -0,0 +1,40 @@
<view class="navigation {{isFixedTop > 0 ? 'active' : ''}}" style="padding-top:{{barHeight}}px;">
<image bindtap="returnGo" class="navigation-arrow" src="{{isFixedTop > 0 ? '/static/icons/arrowBlack.png' : '/static/icons/arrowWrite.png'}}"></image>
<image bindtap="returnHome" class="navigation-arrow" src="{{isFixedTop > 0 ? '/static/icons/homeBlack.png' : '/static/icons/homeWrite.png'}}"></image>
</view>
<image class="articleImg" src="{{indexShow.cover}}" mode="widthFix"></image>
<view class="articleCont">
<view class="articleTop">
<view class="articleName">
<text>{{indexShow.categories[0].slug}}</text> | {{indexShow.title}}
</view>
<view class="articleTool">
<text>{{indexShow.created_at}}</text>
<text>浏览 {{indexShow.clicks}}</text>
</view>
</view>
<view class="articleBanner">
<image mode="widthFix" src="https://api.siyuankunlun.com/storage/materials/2022/10/11/articleBanner.jpg"></image>
</view>
<view class="articleText">
<rich-text nodes="{{mallContent}}"></rich-text>
</view>
</view>
<view class="tool">
<view class="toolCont">
<button class="toolCont-label" open-type="share" hover-class="none">
<image class="toolCont-label-icon" src="/static/icons/articleIcon_01.png"></image>
<text>转发</text>
</button>
<view class="toolCont-label" bindtap="toolTap" data-name="favorites">
<image class="toolCont-label-icon" src="{{!favoritesSee ? '/static/icons/articleIcon_02.png' : '/static/icons/articleIcon_02_active.png'}}"></image>
<text>{{favoritesNumber}}</text>
</view>
<view class="toolCont-label" bindtap="toolTap" data-name="subscribes">
<image class="toolCont-label-icon" src="{{!subscribesSee ? '/static/icons/articleIcon_03.png' : '/static/icons/articleIcon_03_active.png'}}"></image>
<text>{{subscribesNumber}}</text>
</view>
</view>
</view>

View File

@@ -0,0 +1,102 @@
page {
background-color: #ffffff;
}
.articleImg {
width: 100%;
display: inline-block;
}
.articleCont {
padding: 30rpx;
box-sizing: border-box;
border-bottom: 160rpx transparent solid;
}
.articleName {
font-size: 36rpx;
margin-top: 20rpx;
}
.articleName text {
text-transform: uppercase;
}
.articleTool {
color: #666666;
font-size: 26rpx;
margin-top: 15rpx;
}
.articleTool text {
padding-right: 30rpx;
font-weight: 200;
}
.articleBanner {
text-align: center;
margin: 60rpx 0;
}
.articleBanner image {
width: 100%;
}
.tool {
position: fixed;
width: 100%;
height: 90rpx;
line-height: 90rpx;
left: 0;
bottom: 60rpx;
z-index: 99;
padding: 0 30rpx;
box-sizing: border-box;
}
.toolCont {
background-color: #ffffff;
display: flex;
box-shadow: 0 0 10rpx rgba(0, 0, 0, .1);
border-radius: 80rpx;
}
.toolCont-label {
flex: 3;
text-align: center;
color: #999;
font-size: 30rpx;
background-color: transparent;
padding: 0;
margin: 0;
line-height: 100rpx;
font-weight: 200;
}
.toolCont-label-icon {
width: 36rpx;
height: 36rpx;
margin-right: 10rpx;
vertical-align: -4rpx;
}
.navigation{
position: fixed;
top: 0;
left: 0;
z-index: 99;
width: 100%;
height: 90rpx;
background-color: transparent;
transition: .2s;
}
.navigation.active {
background-color: #ffffff;
}
.navigation-arrow {
width: 44rpx;
height: 44rpx;
margin: 20rpx 15rpx 0 20rpx;
}

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