no message
Showing
96 changed files
with
1515 additions
and
418 deletions
| ... | @@ -11,7 +11,7 @@ module.exports = { | ... | @@ -11,7 +11,7 @@ module.exports = { |
| 11 | "enabledQcloud": false, //是否开启腾讯云COS 上传功能 | 11 | "enabledQcloud": false, //是否开启腾讯云COS 上传功能 |
| 12 | // 腾讯云COS 上传功能配置表 | 12 | // 腾讯云COS 上传功能配置表 |
| 13 | "qcloud": { | 13 | "qcloud": { |
| 14 | "appid": "1111111", | 14 | "appid": "wx7122e6d18bb8f6ea", |
| 15 | "secretId": "xxx", | 15 | "secretId": "xxx", |
| 16 | "secretKey": "xxxxx", | 16 | "secretKey": "xxxxx", |
| 17 | "bucket": "xxxx", | 17 | "bucket": "xxxx", | ... | ... |
| ... | @@ -8,7 +8,7 @@ | ... | @@ -8,7 +8,7 @@ |
| 8 | "minified": true, | 8 | "minified": true, |
| 9 | "newFeature": true | 9 | "newFeature": true |
| 10 | }, | 10 | }, |
| 11 | "appid": "wxc57ed87f2569f701", | 11 | "appid": "wx7122e6d18bb8f6ea", |
| 12 | "projectname": "gulp-example", | 12 | "projectname": "gulp-example", |
| 13 | "condition": {} | 13 | "condition": {} |
| 14 | } | 14 | } | ... | ... |
| ... | @@ -8,18 +8,74 @@ let store = require('./utils/stroage'); | ... | @@ -8,18 +8,74 @@ let store = require('./utils/stroage'); |
| 8 | require('./http/mock-data'); | 8 | require('./http/mock-data'); |
| 9 | 9 | ||
| 10 | App({ | 10 | App({ |
| 11 | get: fetchApi.fetch, | 11 | get: fetchApi.fetch, |
| 12 | post: (params) => { | 12 | post: (params) => { |
| 13 | params.method = 'post'; | 13 | params.method = 'post'; |
| 14 | return fetchApi.fetch(params); | 14 | return fetchApi.fetch(params); |
| 15 | }, | 15 | }, |
| 16 | api: api, | 16 | api: api, |
| 17 | config: config, | 17 | config: config, |
| 18 | router: router, | 18 | router: router, |
| 19 | store: store, | 19 | store: store, |
| 20 | onLaunch: function () {}, | 20 | onLaunch: function () { |
| 21 | globalData: { | 21 | this.share() |
| 22 | indexInfo: null, | 22 | }, |
| 23 | userInfo: null | 23 | globalData: { |
| 24 | } | 24 | indexInfo: null, |
| 25 | userInfo: null, | ||
| 26 | wxcode: store.getItem("wxcode"), | ||
| 27 | tlMemberCode: "", | ||
| 28 | }, | ||
| 29 | //重写分享方法 | ||
| 30 | share: function () { | ||
| 31 | //监听路由切换 | ||
| 32 | //间接实现全局设置分享内容 | ||
| 33 | wx.onAppRoute(function (res) { | ||
| 34 | //获取加载的页面 | ||
| 35 | let pages = getCurrentPages(); | ||
| 36 | //获取当前页面的对象 | ||
| 37 | let view = pages[pages.length - 1]; | ||
| 38 | let data; | ||
| 39 | if (view) { | ||
| 40 | data = view.data; | ||
| 41 | if (!data.isOverShare) { | ||
| 42 | data.isOverShare = true; | ||
| 43 | view.onShareAppMessage = function (res) { | ||
| 44 | //分享配置 | ||
| 45 | return { | ||
| 46 | title: '志亮·深士照明', | ||
| 47 | path: 'pages/index/index' | ||
| 48 | }; | ||
| 49 | }; | ||
| 50 | } | ||
| 51 | } | ||
| 52 | }) | ||
| 53 | }, | ||
| 54 | // 获取用户基本信息 | ||
| 55 | queryIndex(query = { | ||
| 56 | auth: true | ||
| 57 | }) { | ||
| 58 | return new Promise((resolve, reject) => { | ||
| 59 | this.post({ | ||
| 60 | url: this.api.index, | ||
| 61 | data: {}, | ||
| 62 | loading: true, | ||
| 63 | }).then((result) => { | ||
| 64 | this.globalData.indexInfo = result; | ||
| 65 | this.globalData.userInfo = result.userInfo; | ||
| 66 | if (result.isNeedAuth == 1 && auth == true) { | ||
| 67 | //需要授权 | ||
| 68 | this.router.push({ | ||
| 69 | path: "authorize" | ||
| 70 | }) | ||
| 71 | reject(); | ||
| 72 | // resolve(); | ||
| 73 | } else { | ||
| 74 | resolve(result) | ||
| 75 | } | ||
| 76 | }).catch((err) => { | ||
| 77 | reject(); | ||
| 78 | }); | ||
| 79 | }); | ||
| 80 | } | ||
| 25 | }) | 81 | }) | ... | ... |
| 1 | { | 1 | { |
| 2 | "pages": [ | 2 | "pages": [ |
| 3 | "pages/contact-table/contact-table", | ||
| 4 | "pages/contact/contact", | ||
| 5 | "pages/user-center/user-center", | ||
| 3 | "pages/index/index", | 6 | "pages/index/index", |
| 4 | "pages/authorize/authorize", | 7 | "pages/authorize/authorize", |
| 5 | "pages/gift-shop/gift-shop", | 8 | "pages/gift-shop/gift-shop", |
| ... | @@ -12,11 +15,8 @@ | ... | @@ -12,11 +15,8 @@ |
| 12 | "pages/my-qrcode/my-qrcode", | 15 | "pages/my-qrcode/my-qrcode", |
| 13 | "pages/my-order/my-order", | 16 | "pages/my-order/my-order", |
| 14 | "pages/my-message/my-message", | 17 | "pages/my-message/my-message", |
| 15 | "pages/contact/contact", | ||
| 16 | "pages/contact-table/contact-table", | ||
| 17 | "pages/vip-login/vip-login", | 18 | "pages/vip-login/vip-login", |
| 18 | "pages/vip-verify/vip-verify", | 19 | "pages/vip-verify/vip-verify", |
| 19 | "pages/user-center/user-center", | ||
| 20 | "pages/sign-in-record/sign-in-record", | 20 | "pages/sign-in-record/sign-in-record", |
| 21 | "pages/rank/rank", | 21 | "pages/rank/rank", |
| 22 | "pages/rank-gift/rank-gift", | 22 | "pages/rank-gift/rank-gift", |
| ... | @@ -26,7 +26,7 @@ | ... | @@ -26,7 +26,7 @@ |
| 26 | "window": { | 26 | "window": { |
| 27 | "backgroundTextStyle": "light", | 27 | "backgroundTextStyle": "light", |
| 28 | "navigationBarBackgroundColor": "#3680EB", | 28 | "navigationBarBackgroundColor": "#3680EB", |
| 29 | "navigationBarTitleText": "志亮照明", | 29 | "navigationBarTitleText": "深士照明", |
| 30 | "navigationBarTextStyle": "white" | 30 | "navigationBarTextStyle": "white" |
| 31 | }, | 31 | }, |
| 32 | "tabBar": { | 32 | "tabBar": { |
| ... | @@ -36,22 +36,26 @@ | ... | @@ -36,22 +36,26 @@ |
| 36 | "backgroundColor": "#ffffff", | 36 | "backgroundColor": "#ffffff", |
| 37 | "list": [{ | 37 | "list": [{ |
| 38 | "pagePath": "pages/index/index", | 38 | "pagePath": "pages/index/index", |
| 39 | "iconPath": "image/tabbar/scan_bar.png", | 39 | "iconPath": "image/tabbar/scan-bar.png", |
| 40 | "selectedIconPath": "image/tabbar/scan_bar_selected.png", | 40 | "selectedIconPath": "image/tabbar/scan-bar-selected.png", |
| 41 | "text": "扫码积分" | 41 | "text": "扫码积分" |
| 42 | }, | 42 | }, |
| 43 | { | 43 | { |
| 44 | "pagePath": "pages/gift-shop/gift-shop", | 44 | "pagePath": "pages/gift-shop/gift-shop", |
| 45 | "iconPath": "image/tabbar/gift_bar.png", | 45 | "iconPath": "image/tabbar/gift-bar.png", |
| 46 | "selectedIconPath": "image/tabbar/gift_bar_selected.png", | 46 | "selectedIconPath": "image/tabbar/gift-bar-selected.png", |
| 47 | "text": "礼物兑换" | 47 | "text": "礼物兑换" |
| 48 | }, | 48 | }, |
| 49 | { | 49 | { |
| 50 | "pagePath": "pages/user-center/user-center", | 50 | "pagePath": "pages/user-center/user-center", |
| 51 | "iconPath": "image/tabbar/user_bar.png", | 51 | "iconPath": "image/tabbar/user-bar.png", |
| 52 | "selectedIconPath": "image/tabbar/user_bar_selected.png", | 52 | "selectedIconPath": "image/tabbar/user-bar-selected.png", |
| 53 | "text": "个人中心" | 53 | "text": "个人中心" |
| 54 | } | 54 | } |
| 55 | ] | 55 | ] |
| 56 | }, | ||
| 57 | "usingComponents": { | ||
| 58 | "authorize-comp": "../../component/authorize-comp/authorize-comp", | ||
| 59 | "van-popup": "../../ui/vant-weapp/popup/index" | ||
| 56 | } | 60 | } |
| 57 | } | 61 | } | ... | ... |
| ... | @@ -100,3 +100,27 @@ | ... | @@ -100,3 +100,27 @@ |
| 100 | background-color: transparent; | 100 | background-color: transparent; |
| 101 | border: 0; | 101 | border: 0; |
| 102 | } | 102 | } |
| 103 | |||
| 104 | |||
| 105 | // 居中按钮样式 | ||
| 106 | @mixin btc($width, $height) { | ||
| 107 | width: $width; | ||
| 108 | height: $height; | ||
| 109 | line-height: $height; | ||
| 110 | text-align: center; | ||
| 111 | } | ||
| 112 | |||
| 113 | |||
| 114 | // 通用按钮 | ||
| 115 | @mixin cb($width:320px, $height:84px, $fontSize:32px) { | ||
| 116 | color: #FFFFFF; | ||
| 117 | position: relative; | ||
| 118 | width: $width; | ||
| 119 | height: $height; | ||
| 120 | line-height: $height; | ||
| 121 | text-align: center; | ||
| 122 | font-size: $fontSize; | ||
| 123 | border-radius: 8px; | ||
| 124 | background-color: #3680EB; | ||
| 125 | |||
| 126 | } | ... | ... |
| 1 | let app = getApp(); | ||
| 2 | Component({ | ||
| 3 | properties: { | ||
| 4 | // 这里定义了innerText属性,属性值可以在组件使用时指定 | ||
| 5 | innerText: { | ||
| 6 | type: String, | ||
| 7 | value: 'default value', | ||
| 8 | } | ||
| 9 | }, | ||
| 10 | data: { | ||
| 11 | // 这里是一些组件内部数据 | ||
| 12 | someData: {} | ||
| 13 | }, | ||
| 14 | methods: { | ||
| 15 | // 这里是一个自定义方法 | ||
| 16 | customMethod() { | ||
| 17 | this.triggerEvent('evtcomp', { | ||
| 18 | name: "_evt_custom" | ||
| 19 | }) | ||
| 20 | }, | ||
| 21 | // 隐藏蒙层 | ||
| 22 | hideMask() { | ||
| 23 | this.triggerEvent('evtcomp', { | ||
| 24 | name: "_evt_hide_mask" | ||
| 25 | }); | ||
| 26 | }, | ||
| 27 | authComplete() { | ||
| 28 | this.triggerEvent('evtcomp', { | ||
| 29 | name: "_evt_auth_complete" | ||
| 30 | }); | ||
| 31 | }, | ||
| 32 | bindGetUserInfo(e) { | ||
| 33 | wx.showLoading(); | ||
| 34 | this.getUserInfo(e.detail); | ||
| 35 | }, | ||
| 36 | getUserInfo(e) { | ||
| 37 | let _this = this; | ||
| 38 | app.globalData.userInfo = e.userInfo; | ||
| 39 | app.post({ | ||
| 40 | url: app.api.register, | ||
| 41 | sid: false, | ||
| 42 | data: { | ||
| 43 | encryptedData: e.encryptedData, | ||
| 44 | iv: e.iv, | ||
| 45 | code: app.store.getItem("wxcode"), | ||
| 46 | tlMemberCode: app.globalData.tlMemberCode | ||
| 47 | } | ||
| 48 | }).then((res2) => { | ||
| 49 | wx.hideLoading(); | ||
| 50 | if (res2 && res2.sessionId) { | ||
| 51 | app.store.setItem('sessionId', res2.sessionId); | ||
| 52 | } | ||
| 53 | _this.hideMask(); | ||
| 54 | _this.authComplete(); | ||
| 55 | }).catch((err) => {}) | ||
| 56 | }, | ||
| 57 | } | ||
| 58 | }) |
| 1 | @import '../../assets/scss/mixins'; | ||
| 2 | @import '../../assets/scss/utils'; | ||
| 3 | |||
| 4 | |||
| 5 | .comp-item { | ||
| 6 | width: 650px; | ||
| 7 | min-height: 496px; | ||
| 8 | border-radius: 10px; | ||
| 9 | background-color: #ffffff; | ||
| 10 | |||
| 11 | .cspace { | ||
| 12 | height: 80px; | ||
| 13 | } | ||
| 14 | |||
| 15 | .cont { | ||
| 16 | text-align: center; | ||
| 17 | width: 520px; | ||
| 18 | margin: 0 auto; | ||
| 19 | |||
| 20 | .logo { | ||
| 21 | margin: 0 auto; | ||
| 22 | width: 200px; | ||
| 23 | height: 153px; | ||
| 24 | |||
| 25 | image { | ||
| 26 | width: 200px; | ||
| 27 | height: 153px; | ||
| 28 | } | ||
| 29 | } | ||
| 30 | |||
| 31 | .tit { | ||
| 32 | font-size: 40px; | ||
| 33 | color: #333333; | ||
| 34 | } | ||
| 35 | |||
| 36 | .tips { | ||
| 37 | margin-top: 28px; | ||
| 38 | font-size: 32px; | ||
| 39 | color: #333333; | ||
| 40 | padding-bottom: 244px; | ||
| 41 | } | ||
| 42 | } | ||
| 43 | |||
| 44 | .btn { | ||
| 45 | @include cb(300px, 80px); | ||
| 46 | position: absolute; | ||
| 47 | left: 0; | ||
| 48 | right: 0; | ||
| 49 | bottom: 80px; | ||
| 50 | margin: 0 auto; | ||
| 51 | } | ||
| 52 | |||
| 53 | } |
| 1 | <view class="comp-item"> | ||
| 2 | <view class="cspace"></view> | ||
| 3 | <view class="cont"> | ||
| 4 | <!-- <view class="logo"> | ||
| 5 | <image mode="widthFix" src="../../image/logo.png" /> | ||
| 6 | </view> --> | ||
| 7 | <view class="tit">深士照明</view> | ||
| 8 | <view class="tips"> | ||
| 9 | <text >需要获取您的微信昵称等信息才可以获取积分和兑换奖品哦</text> | ||
| 10 | </view> | ||
| 11 | </view> | ||
| 12 | <button class="btn" open-type="getUserInfo" bindgetuserinfo="bindGetUserInfo">确认授权</button> | ||
| 13 | </view> |
| ... | @@ -26,13 +26,24 @@ | ... | @@ -26,13 +26,24 @@ |
| 26 | border: 1px solid #F0F0F0; | 26 | border: 1px solid #F0F0F0; |
| 27 | border-radius: 4px; | 27 | border-radius: 4px; |
| 28 | 28 | ||
| 29 | .swiper {} | 29 | .swiper { |
| 30 | width: 610px; | ||
| 31 | height: 322px; | ||
| 32 | |||
| 33 | .swiper-image { | ||
| 34 | width: 610px; | ||
| 35 | height: 322px; | ||
| 36 | } | ||
| 37 | } | ||
| 30 | } | 38 | } |
| 31 | 39 | ||
| 32 | .desc { | 40 | .desc { |
| 33 | color: #333333; | 41 | color: #333333; |
| 34 | font-size: 28px; | 42 | font-size: 28px; |
| 43 | height: 404px; | ||
| 44 | line-height: 48px; | ||
| 35 | } | 45 | } |
| 46 | |||
| 36 | } | 47 | } |
| 37 | 48 | ||
| 38 | .close { | 49 | .close { | ... | ... |
| 1 | <view class="comp-item"> | 1 | <view class="comp-item"> |
| 2 | <view class="cont"> | 2 | <view class="cont"> |
| 3 | <view class="tit">LED大功率球泡灯</view> | 3 | <view class="tit">{{productInfo.productName}}</view> |
| 4 | <view class="img-wrap"> | 4 | <view class="img-wrap"> |
| 5 | <view class="swiper"></view> | 5 | <swiper class="swiper" indicator-color="rgba(0,0,0,.3)" indicator-active-color="rgba(255,255,255,1)" indicator-dots="{{true}}" autoplay="{{true}}" interval="{{5000}}" duration="{{500}}"> |
| 6 | </view> | 6 | <block wx:for="{{productInfo.productImages}}" wx:key="{{index}}"> |
| 7 | <view class="desc">产品特点:</view> | 7 | <swiper-item> |
| 8 | <view class="desc"> | 8 | <image class="swiper-image" src="{{item}}" mode="aspectFill" /> |
| 9 | 节能白光LED的能耗仅为白炽灯的1/10,节能灯的1/4,超长寿命50.000小时以上,是传统钨丝灯的50倍以上,固态封装,方便运输和安装;环保,没有汞的有害物质。采用PWM恒流技术,效率高,热量低,恒流精度高。宽电压范围,全球通用,85V-265VAC全电压范围恒流。保证寿命及亮度不受电压波动影响。 | 9 | </swiper-item> |
| 10 | </block> | ||
| 11 | </swiper> | ||
| 10 | </view> | 12 | </view> |
| 13 | <scroll-view scroll-y="{{true}}" class="desc"> | ||
| 14 | <text class="t1">产品特点:</text> | ||
| 15 | <text class="t2"> | ||
| 16 | {{productInfo.productInfo}} | ||
| 17 | </text> | ||
| 18 | </scroll-view> | ||
| 11 | </view> | 19 | </view> |
| 12 | <view class="close"> | 20 | <view class="close"> |
| 13 | <image bindtap="hideMask" class="btn" src="../../image/index/index_close.png" /> | 21 | <image bindtap="hideMask" class="btn" src="../../image/index/index-close.png" /> |
| 14 | </view> | 22 | </view> |
| 15 | </view> | 23 | </view> | ... | ... |
| 1 | module.exports = { | 1 | module.exports = { |
| 2 | mockApi: 'http://mock.simonfungc.com', | 2 | mockApi: 'http://mock.simonfungc.com', |
| 3 | Dev: { | 3 | Dev: { |
| 4 | baseApi: 'https://dev-api.xxx.com' | 4 | baseApi: 'https://ow.go.qudone.com/zlzmapi' |
| 5 | }, | 5 | }, |
| 6 | Test: { | 6 | Test: { |
| 7 | baseApi: 'https://test-api.xxx.com' | 7 | baseApi: 'https://test-api.xxx.com' |
| ... | @@ -10,6 +10,6 @@ module.exports = { | ... | @@ -10,6 +10,6 @@ module.exports = { |
| 10 | baseApi: 'https://slave-api.xxx.com' | 10 | baseApi: 'https://slave-api.xxx.com' |
| 11 | }, | 11 | }, |
| 12 | Prod: { | 12 | Prod: { |
| 13 | baseApi: 'https://api.xxx.com' | 13 | baseApi: 'https://api.k.wxpai.cn/bizproxy/zlzmapi' |
| 14 | } | 14 | } |
| 15 | } | 15 | } | ... | ... |
| 1 | module.exports = { | 1 | module.exports = { |
| 2 | index: '/xxx/index', // Index 接口 | 2 | login: "/login", // post 通过wxcode换取sessionId |
| 3 | register: '/xxx/register', // 解析用户信息 | 3 | register: '/register', // post 注册(用户授权) |
| 4 | product: '/product', // post 首页商品概览 | ||
| 5 | bannerList: '/banner/list', // post 轮播图列表 | ||
| 6 | pointsOverview: '/points/overview', // post 查看积分概览 | ||
| 7 | commodityList: '/commodity/list', // post 积分商城浏览 商品列表 | ||
| 8 | commodityVeridcation: '/commodity/veridcation', // post 兑换礼物 红包和实物兑换礼物接口 , 实物会返回地址信息,红包校验通过会直接兑换 | ||
| 9 | commodityExchange: '/commodity/exchange', // post 兑换礼物2 实物兑换,需要带上地址的唯一标识uuid | ||
| 10 | receiver: '/receiver', // post 地址 地址列表接口 | ||
| 11 | receiverSave: '/receiver/save', // post 新建地址 地址信息新建 、保存 | ||
| 12 | receiverDelete: '/receiver/delete', // post 地址删除 | ||
| 13 | member: '/member', // post 个人首页 个人首页的详细信息 | ||
| 14 | memberType: '/member/type', // post 用户类型 获取用户类型 | ||
| 15 | memberPhone: '/member/phone', // post 获取手机验证码 获取验证码 | ||
| 16 | memberIdCommit: '/member/id/commit', // post 信息验证提交 | ||
| 17 | memberIdUpdate: '/member/id/update', // post 验证信息修改-----忽略 | ||
| 18 | memberIdQuery: '/member/id/query', // post 审核信息查看接口 | ||
| 19 | announcementList: '/announcement/list', // post 我的消息 我的消息列表 | ||
| 20 | announcementUpdate: '/announcement/update', // post 我的消息标已读 用户注册接口 | ||
| 21 | announcementDelete: '/announcement/delete', // post 我的消息删除 删除已读消息 | ||
| 22 | announcementDeleteOne: 'announcement/delete/one', // post 我的消息删除---单个 删除单条消息 单个的英文是single | ||
| 23 | messageSave: '/message/save', // post 用户留言 | ||
| 24 | contact: '/contact', // post 联系方式 | ||
| 25 | order: '/order', // post 订单状态 订单列表 | ||
| 26 | activity: '/activity', // post 推广积分排行 | ||
| 27 | activityHistory: '/activity/history', // post 历史推广排行 | ||
| 28 | activityAll: '/activity/all', // post 总排行--忽略 | ||
| 29 | activityPrize: '/activity/prize', // post 排行奖励明细 | ||
| 30 | activityPrizeGet: '/activity/prize/get', // post 领取奖励 活动奖励获取 | ||
| 31 | scanIntegralQrcode: '/scan/integral/qrcode', // post 扫积分码功能 扫积分码 | ||
| 32 | scanPersonQrcode: '/scan/person/qrcode', // post 扫个人二维码 | ||
| 33 | signInfo: '/sign/info', // post 签到信息 用户注册接口 | ||
| 34 | sign: '/sign', // post 签到动作 用户注册接口 | ||
| 35 | sginRecord: '/sgin/record', // post 签到记录 用户注册接口 | ||
| 4 | } | 36 | } | ... | ... |
| 1 | let config = require('./../config'); | 1 | let config = require('./../config'); |
| 2 | let Store = require('./../utils/stroage'); | 2 | let Store = require('./../utils/stroage'); |
| 3 | const reason = '服务异常,请稍后重试'; | 3 | let Router = require('./../router/index'); |
| 4 | const errMsg = '服务异常,请稍后重试'; | ||
| 4 | 5 | ||
| 5 | // 检查并获取sessionid sid:是否需要验证sessionId | 6 | // let isWxLogin = false; |
| 6 | function checkSessionId(sid) { | 7 | |
| 7 | return new Promise((resolve, reject) => { | 8 | function wxLogin() { |
| 8 | if (!sid) { | 9 | return new Promise((resolve, reject) => { |
| 9 | resolve(); | 10 | wx.login({ |
| 10 | return; | 11 | success: function (res) { |
| 11 | } | 12 | // isWxLogin = true; |
| 12 | let sessionId = Store.getItem('sessionId'); | 13 | Store.setItem('wxcode', res.code); |
| 13 | if (sessionId) { | 14 | resolve(); |
| 14 | resolve(sessionId); | 15 | } |
| 15 | } else { | 16 | }); |
| 16 | // 身份失效 | 17 | }); |
| 17 | //登陆失效的回调 | ||
| 18 | // Store.clear("sessionId"); | ||
| 19 | // wx.reLaunch({ | ||
| 20 | // // url: '/pages/authorize/authorize' | ||
| 21 | // url: '/pages/login/login', | ||
| 22 | // }) | ||
| 23 | } | ||
| 24 | }); | ||
| 25 | } | 18 | } |
| 26 | 19 | ||
| 27 | const fetch = function ({ | ||
| 28 | loading = false, | ||
| 29 | toast = true, | ||
| 30 | sid = true, | ||
| 31 | mode, | ||
| 32 | isMock, | ||
| 33 | url, | ||
| 34 | data, | ||
| 35 | method | ||
| 36 | }) { | ||
| 37 | // 自定义参数 | ||
| 38 | // const clientInfo = { | ||
| 39 | // user_id: 1 | ||
| 40 | // } | ||
| 41 | // 日志埋点不需要出现loading | ||
| 42 | if (loading && mode != 'log') wx.showLoading(); | ||
| 43 | // if (loading && mode != 'log') Util.showLoading(); | ||
| 44 | 20 | ||
| 45 | // 新建promise对象 | 21 | // 检查并获取sessionid |
| 46 | let promise = new Promise((resolve, reject) => { | 22 | function checkSessionId(sid) { |
| 47 | /** | 23 | return new Promise((resolve, reject) => { |
| 48 | * isMock设置单个接口Mock开启 | 24 | if (!sid) { |
| 49 | * mode:目前针对不同业务的接口进行处理,log标识本地埋点上传 | 25 | resolve(); |
| 50 | */ | 26 | return; |
| 51 | let baseUrl = config.NET_CONFIG.baseApi; | 27 | } |
| 52 | if (isMock && mode != 'log') { | 28 | let sessionId = Store.getItem('sessionId'); |
| 53 | baseUrl = config.MOCKAPI; //环境配置 | 29 | if (sessionId) { |
| 54 | } | 30 | resolve(); |
| 31 | } else { | ||
| 32 | // 没有sessionId则获取并埋值 | ||
| 33 | login().then((result) => { | ||
| 34 | resolve(); | ||
| 35 | }).catch((err) => { | ||
| 36 | reject(); | ||
| 37 | }); | ||
| 38 | } | ||
| 39 | }); | ||
| 40 | } | ||
| 55 | 41 | ||
| 56 | checkSessionId().then((result) => { | 42 | // session丢失 |
| 57 | if (sid) { | 43 | function login() { |
| 58 | url += "?sessionId=" + Store.getItem("sessionId") | 44 | return new Promise((resolve, reject) => { |
| 59 | } | 45 | wxLogin().then((result) => { |
| 60 | // console.log("url:", url); | 46 | let baseUrl = config.NET_CONFIG.baseApi; |
| 61 | wx.request({ | 47 | wx.request({ |
| 62 | url: baseUrl + url, //请求地址 | 48 | url: baseUrl + '/login', |
| 63 | data: data, //自定义参数 | 49 | sid: false, |
| 64 | method: method || 'GET', // OPTIONS, GET, HEAD, POST, PUT, DELETE, TRACE, CONNECT | 50 | data: { |
| 65 | // header: {}, // 设置请求的 header的默认参数,根据项目需求添加 | 51 | code: Store.getItem('wxcode') |
| 66 | // header: { | 52 | }, |
| 67 | // 'clientInfo': JSON.stringify(clientInfo), | 53 | method: 'POST', |
| 68 | // 'Server-Token':'xxx' | 54 | success: function (res2) { |
| 69 | // }, | 55 | let { |
| 70 | success: function (result) { | 56 | code, |
| 71 | // 日志上传不需要处理结果 | 57 | content |
| 72 | if (mode == 'log') return; | 58 | } = res2.data; |
| 73 | let res = result.data; | 59 | if (code == 200 && content.sessionId) { |
| 74 | // 登陆失效拦截,根据项目需要添加自己的配置 | 60 | Store.setItem('sessionId', content.sessionId); |
| 75 | if (res.code == 404) { | 61 | resolve(); |
| 76 | // wx.showToast({ | 62 | } else { |
| 77 | // title: '当前登陆失效,请重新登陆', | 63 | wx.hideLoading(); |
| 78 | // icon: 'none', | 64 | let pages = getCurrentPages(); |
| 79 | // mask: true, | 65 | let view = pages[pages.length - 1]; |
| 80 | // success: () => { | 66 | if (view) { |
| 81 | // return; | 67 | try { |
| 82 | // } | 68 | wx.login({ |
| 83 | // }) | 69 | success: function (res) { |
| 84 | //登陆失效的回调 | 70 | Store.setItem('wxcode', res.code); |
| 85 | Store.clear("sessionId"); | 71 | view.showAuth(); |
| 86 | wx.reLaunch({ | 72 | } |
| 87 | url: '/pages/authorize/authorize' | 73 | }); |
| 88 | }) | 74 | } catch (error) {} |
| 89 | } | 75 | } |
| 90 | // 内部统一的成功code拦截码 | 76 | reject(); |
| 91 | if (res.code === 200) { | 77 | } |
| 92 | if (loading) { | 78 | } |
| 93 | wx.hideLoading(); | 79 | }) |
| 94 | } | 80 | }) |
| 95 | // resolve(res); | ||
| 96 | // 直接返回content | ||
| 97 | resolve(res.content); | ||
| 98 | } else { | ||
| 99 | // 有些特殊状况不需要toast 需要弹窗 | ||
| 100 | if (toast) { | ||
| 101 | wx.showToast({ | ||
| 102 | title: res.errMsg || errMsg, | ||
| 103 | icon: 'none' | ||
| 104 | }) | ||
| 105 | } else { | ||
| 106 | wx.hideLoading(); | ||
| 107 | } | ||
| 108 | // 返回错误信息 | ||
| 109 | reject(res); | ||
| 110 | } | ||
| 111 | }, | ||
| 112 | fail: function (e = { | ||
| 113 | CODE: -1, | ||
| 114 | msg: errMsg, | ||
| 115 | errMsg | ||
| 116 | }) { | ||
| 117 | let msg = e.errMsg; | ||
| 118 | if (e.errMsg == 'request:fail timeout') { | ||
| 119 | msg = '服务请求超时,请稍后重试' | ||
| 120 | } | ||
| 121 | wx.showToast({ | ||
| 122 | title: msg, | ||
| 123 | icon: 'none' | ||
| 124 | }); | ||
| 125 | reject(e) | ||
| 126 | }, | ||
| 127 | complete: function () { | ||
| 128 | // complete | ||
| 129 | } | ||
| 130 | }) | ||
| 131 | }) | ||
| 132 | 81 | ||
| 82 | }); | ||
| 83 | } | ||
| 133 | 84 | ||
| 134 | }); | 85 | const fetch = function ({ |
| 135 | return promise; | 86 | loading = true, |
| 87 | toast = true, | ||
| 88 | sid = true, | ||
| 89 | auth = true, | ||
| 90 | mode, | ||
| 91 | isMock, | ||
| 92 | url, | ||
| 93 | data, | ||
| 94 | method | ||
| 95 | }) { | ||
| 96 | if (loading && mode != 'log') wx.showLoading(); | ||
| 97 | // 新建promise对象 | ||
| 98 | let promise = new Promise((resolve, reject) => { | ||
| 99 | /** | ||
| 100 | * isMock设置单个接口Mock开启 | ||
| 101 | * mode:目前针对不同业务的接口进行处理,log标识本地埋点上传 | ||
| 102 | */ | ||
| 103 | let baseUrl = config.NET_CONFIG.baseApi; | ||
| 104 | if (isMock && mode != 'log') { | ||
| 105 | baseUrl = config.MOCKAPI; //环境配置 | ||
| 106 | } | ||
| 107 | checkSessionId(sid).then((result) => { | ||
| 108 | wx.request({ | ||
| 109 | url: baseUrl + url, //请求地址 | ||
| 110 | data: data, //自定义参数 | ||
| 111 | method: method || 'GET', // OPTIONS, GET, HEAD, POST, PUT, DELETE, TRACE, CONNECT | ||
| 112 | header: { | ||
| 113 | sessionId: Store.getItem("sessionId") | ||
| 114 | }, | ||
| 115 | success: function (result) { | ||
| 116 | // 日志上传不需要处理结果 | ||
| 117 | if (mode == 'log') return; | ||
| 118 | let res = result.data; | ||
| 119 | // 登陆失效拦截,根据项目需要添加自己的配置 | ||
| 120 | if (res.code == 404) { | ||
| 121 | //登陆失效的回调 | ||
| 122 | Store.clear("sessionId"); | ||
| 123 | // wx.reLaunch({ | ||
| 124 | // url: '/pages/index/index' | ||
| 125 | // }) | ||
| 126 | // 404后拉取登陆后再做一次 | ||
| 127 | login().then((resultLogin) => { | ||
| 128 | wx.request({ | ||
| 129 | url: baseUrl + url, //请求地址 | ||
| 130 | data: data, //自定义参数 | ||
| 131 | method: method || 'GET', // OPTIONS, GET, HEAD, POST, PUT, DELETE, TRACE, CONNECT | ||
| 132 | header: { | ||
| 133 | sessionId: Store.getItem("sessionId") | ||
| 134 | }, | ||
| 135 | success: function (result) { | ||
| 136 | // 日志上传不需要处理结果 | ||
| 137 | if (mode == 'log') return; | ||
| 138 | let res = result.data; | ||
| 139 | if (res.code === 200) { | ||
| 140 | if (loading) { | ||
| 141 | wx.hideLoading(); | ||
| 142 | } | ||
| 143 | resolve(res.content); | ||
| 144 | } else { | ||
| 145 | // 有些特殊状况不需要toast 需要弹窗 | ||
| 146 | if (toast) { | ||
| 147 | wx.showToast({ | ||
| 148 | title: res.errMsg || errMsg, | ||
| 149 | icon: 'none' | ||
| 150 | }) | ||
| 151 | } else { | ||
| 152 | wx.hideLoading(); | ||
| 153 | } | ||
| 154 | // 返回错误信息 | ||
| 155 | reject(res); | ||
| 156 | } | ||
| 157 | } | ||
| 158 | }); | ||
| 159 | }) | ||
| 160 | return; | ||
| 161 | } | ||
| 162 | // 内部统一的成功code拦截码 | ||
| 163 | if (res.code === 200) { | ||
| 164 | if (loading) { | ||
| 165 | wx.hideLoading(); | ||
| 166 | } | ||
| 167 | resolve(res.content); | ||
| 168 | } else { | ||
| 169 | // 有些特殊状况不需要toast 需要弹窗 | ||
| 170 | if (toast) { | ||
| 171 | wx.showToast({ | ||
| 172 | title: res.errMsg || errMsg, | ||
| 173 | icon: 'none' | ||
| 174 | }) | ||
| 175 | } else { | ||
| 176 | wx.hideLoading(); | ||
| 177 | } | ||
| 178 | // 返回错误信息 | ||
| 179 | reject(res); | ||
| 180 | } | ||
| 181 | }, | ||
| 182 | fail: function (e = { | ||
| 183 | CODE: -1, | ||
| 184 | msg: errMsg, | ||
| 185 | errMsg | ||
| 186 | }) { | ||
| 187 | let msg = e.errMsg; | ||
| 188 | if (e.errMsg == 'request:fail timeout') { | ||
| 189 | msg = '服务请求超时,请稍后重试' | ||
| 190 | } | ||
| 191 | wx.showToast({ | ||
| 192 | title: msg, | ||
| 193 | icon: 'none' | ||
| 194 | }); | ||
| 195 | reject(e) | ||
| 196 | }, | ||
| 197 | complete: function () { | ||
| 198 | // complete | ||
| 199 | } | ||
| 200 | }) | ||
| 201 | }) | ||
| 202 | }); | ||
| 203 | return promise; | ||
| 136 | } | 204 | } |
| 137 | 205 | ||
| 138 | module.exports = { | 206 | module.exports = { |
| 139 | fetch | 207 | fetch |
| 140 | } | 208 | } | ... | ... |
src/image/contact/contact-c1.png
0 → 100644
21 KB
src/image/contact/contact-c2.png
0 → 100644
1.03 KB
src/image/icon/icon-all-order.png
0 → 100644
1.38 KB
src/image/icon/icon-check.png
0 → 100644
504 Bytes
src/image/icon/icon-concat-us.png
0 → 100644
3.76 KB
src/image/icon/icon-integral-rank.png
0 → 100644
3.53 KB
src/image/icon/icon-integral.png
0 → 100644
3.24 KB
src/image/icon/icon-my-address.png
0 → 100644
3.92 KB
src/image/icon/icon-my-message.png
0 → 100644
2.16 KB
src/image/icon/icon-qrcode.png
0 → 100644
1.95 KB
src/image/icon/icon-red-package.png
0 → 100644
8.92 KB
src/image/icon/icon-review-pass.png
0 → 100644
2.54 KB
src/image/icon/icon-shipped.png
0 → 100644
2.39 KB
src/image/icon/icon-sign-record.png
0 → 100644
1.11 KB
src/image/icon/icon-up-pass.png
0 → 100644
2.55 KB
src/image/icon/icon-wait-review.png
0 → 100644
2.39 KB
src/image/qrcode/qrcode-focus.png
0 → 100644
36.8 KB
src/image/user-center/user-center-top-bg.png
0 → 100644
31.1 KB
src/image/user-center/日历@2x.png
0 → 100644
1.43 KB
| 1 | let app = getApp(); | 1 | let app = getApp(); |
| 2 | Page({ | 2 | Page({ |
| 3 | data: { | 3 | data: { |
| 4 | authorizeVisible: false, | ||
| 4 | value: "", | 5 | value: "", |
| 5 | checked: true, | 6 | checked: true, |
| 6 | }, | 7 | }, |
| 8 | onShareAppMessage() {}, | ||
| 9 | showAuth() { | ||
| 10 | this.setData({ | ||
| 11 | authorizeVisible: true | ||
| 12 | }) | ||
| 13 | }, | ||
| 7 | onLoad(options) {}, | 14 | onLoad(options) {}, |
| 8 | onChange(event) { | 15 | onChange(event) { |
| 9 | this.setData({ | 16 | this.setData({ | ... | ... |
| 1 | let app = getApp(); | 1 | let app = getApp(); |
| 2 | Page({ | 2 | Page({ |
| 3 | data: {}, | 3 | data: { |
| 4 | authorizeVisible: false, | ||
| 5 | }, | ||
| 6 | onShareAppMessage() {}, | ||
| 7 | showAuth() { | ||
| 8 | this.setData({ | ||
| 9 | authorizeVisible: true | ||
| 10 | }) | ||
| 11 | }, | ||
| 4 | onLoad(options) {}, | 12 | onLoad(options) {}, |
| 5 | // 编辑收货地址 | 13 | // 编辑收货地址 |
| 6 | onAddressEditHandler() { | 14 | onAddressEditHandler() { | ... | ... |
src/pages/authorize-nav/authorize.js
deleted
100755 → 0
| 1 | let app = getApp(); | ||
| 2 | |||
| 3 | Page({ | ||
| 4 | data: { | ||
| 5 | barHeight: app.globalData.barHeight, | ||
| 6 | navbarData: { | ||
| 7 | showCapsule: 0, //是否显示左上角图标 1表示显示 0表示不显示 | ||
| 8 | title: '微信授权' //导航栏 中间的标题 | ||
| 9 | }, | ||
| 10 | loginData: null, | ||
| 11 | authorized: false, | ||
| 12 | canIUse: wx.canIUse('button.open-type.getUserInfo'), | ||
| 13 | }, | ||
| 14 | onShareAppMessage() {}, | ||
| 15 | onLoad(options) {}, | ||
| 16 | onReady() { | ||
| 17 | // app.store.clear("sessionId"); | ||
| 18 | let _this = this; | ||
| 19 | wx.login({ | ||
| 20 | success: function (res) { | ||
| 21 | _this.data.loginData = res; | ||
| 22 | } | ||
| 23 | }); | ||
| 24 | }, | ||
| 25 | bindGetUserInfo(e) { | ||
| 26 | wx.showLoading(); | ||
| 27 | this.getUserInfo(e.detail); | ||
| 28 | }, | ||
| 29 | getUserInfo(e) { | ||
| 30 | let _this = this; | ||
| 31 | app.globalData.userInfo = e.userInfo; | ||
| 32 | // console.log("loginData:",_this.data.loginData); | ||
| 33 | app.post({ | ||
| 34 | url: app.api.register, | ||
| 35 | sid: false, | ||
| 36 | data: { | ||
| 37 | encryptedData: e.encryptedData, | ||
| 38 | iv: e.iv, | ||
| 39 | code: _this.data.loginData.code, | ||
| 40 | } | ||
| 41 | }).then((res2) => { | ||
| 42 | app.store.setItem('sessionId', res2.sessionId); | ||
| 43 | _this.setData({ | ||
| 44 | authorized: true | ||
| 45 | }) | ||
| 46 | _this.toIndex(); | ||
| 47 | }).catch((err) => { | ||
| 48 | console.log("@authorize || err:", err); | ||
| 49 | }) | ||
| 50 | }, | ||
| 51 | toIndex() { | ||
| 52 | console.log("@authorize || toIndex "); | ||
| 53 | setTimeout(() => { | ||
| 54 | app.router.push({ | ||
| 55 | path: "index", | ||
| 56 | query: {}, | ||
| 57 | openType: "redirect" | ||
| 58 | }) | ||
| 59 | wx.hideLoading(); | ||
| 60 | }, 2000); | ||
| 61 | } | ||
| 62 | }) |
| 1 | @import '../../assets/scss/mixins'; | ||
| 2 | |||
| 3 | .page { | ||
| 4 | position: relative; | ||
| 5 | overflow: hidden; | ||
| 6 | |||
| 7 | .bgc { | ||
| 8 | // background-color: transparent; | ||
| 9 | // background-color: black; | ||
| 10 | background-color: #fafafc; | ||
| 11 | } | ||
| 12 | |||
| 13 | |||
| 14 | .main { | ||
| 15 | |||
| 16 | position: relative; | ||
| 17 | |||
| 18 | .top-space { | ||
| 19 | height: 60px; | ||
| 20 | } | ||
| 21 | |||
| 22 | |||
| 23 | .login { | ||
| 24 | position: relative; | ||
| 25 | width: 650px; | ||
| 26 | margin: 0 auto; | ||
| 27 | text-align: center; | ||
| 28 | |||
| 29 | &-logo { | ||
| 30 | width: 140px; | ||
| 31 | height: 140px; | ||
| 32 | } | ||
| 33 | |||
| 34 | &-name { | ||
| 35 | margin-top: 32px; | ||
| 36 | font-size: 32px; | ||
| 37 | color: #333333; | ||
| 38 | } | ||
| 39 | |||
| 40 | &-line { | ||
| 41 | margin-top: 70px; | ||
| 42 | width: 650px; | ||
| 43 | height: 2px; | ||
| 44 | background-color: #eaeaec; | ||
| 45 | } | ||
| 46 | |||
| 47 | &-title { | ||
| 48 | margin-top: 40px; | ||
| 49 | font-size: 32px; | ||
| 50 | text-align: left; | ||
| 51 | color: #333333; | ||
| 52 | } | ||
| 53 | |||
| 54 | |||
| 55 | &-tips { | ||
| 56 | margin-top: 28px; | ||
| 57 | font-size: 26px; | ||
| 58 | text-align: left; | ||
| 59 | color: #666666; | ||
| 60 | } | ||
| 61 | |||
| 62 | &-btn { | ||
| 63 | margin-top: 102px; | ||
| 64 | width: 650px; | ||
| 65 | height: 90px; | ||
| 66 | line-height: 90px; | ||
| 67 | border-radius: 8px; | ||
| 68 | background-color: #00c200; | ||
| 69 | font-size: 32px; | ||
| 70 | color: #ffffff; | ||
| 71 | } | ||
| 72 | |||
| 73 | } | ||
| 74 | |||
| 75 | } | ||
| 76 | |||
| 77 | } |
| 1 | <navbar navbar-data='{{navbarData}}'></navbar> | ||
| 2 | <view style='height: {{barHeight}}px'></view> | ||
| 3 | <view class="page-authorize page"> | ||
| 4 | <view class="app__bgc bgc"></view> | ||
| 5 | <view class="app__bg bg"></view> | ||
| 6 | <!-- <view class="app__top-shadow"></view> --> | ||
| 7 | <view class="app__content main"> | ||
| 8 | <view class="top-space"></view> | ||
| 9 | <view class="login"> | ||
| 10 | <image class="login-logo" src="../../image/logo.png" mode="aspectFit" /> | ||
| 11 | <view class="login-name">志亮·深士照明</view> | ||
| 12 | <view class="login-line"></view> | ||
| 13 | <view class="login-title">完整体验小程序功能,需要您的微信授权</view> | ||
| 14 | <view class="login-tips">· 获取您的公开信息(昵称、头像等)</view> | ||
| 15 | <button type="default" class="login-btn" wx:if="{{!authorized}}" open-type="getUserInfo" bindgetuserinfo="bindGetUserInfo"> | ||
| 16 | 确认授权 | ||
| 17 | </button> | ||
| 18 | </view> | ||
| 19 | </view> | ||
| 20 | </view> |
| 1 | @import '../../assets/scss/mixins'; | 1 | @import '../../assets/scss/mixins'; |
| 2 | @import '../../assets/scss/utils'; | 2 | @import '../../assets/scss/utils'; |
| 3 | 3 | ||
| 4 | $contentWidth:690px; | ||
| 5 | |||
| 4 | .page { | 6 | .page { |
| 5 | .bgc {} | 7 | .bgc {} |
| 6 | 8 | ||
| ... | @@ -8,11 +10,73 @@ | ... | @@ -8,11 +10,73 @@ |
| 8 | 10 | ||
| 9 | .main { | 11 | .main { |
| 10 | .top-space { | 12 | .top-space { |
| 11 | height: 0px; | 13 | height: 40px; |
| 12 | } | 14 | } |
| 13 | 15 | ||
| 14 | .content { | 16 | .content { |
| 15 | position: relative; | 17 | position: relative; |
| 18 | |||
| 19 | .form { | ||
| 20 | color: #333333; | ||
| 21 | &-item { | ||
| 22 | font-size: 28px; | ||
| 23 | display: flex; | ||
| 24 | justify-content: space-between; | ||
| 25 | margin: 30px auto; | ||
| 26 | |||
| 27 | .label { | ||
| 28 | color: #666666; | ||
| 29 | width: 120px; | ||
| 30 | margin-right: 20px; | ||
| 31 | } | ||
| 32 | |||
| 33 | .val { | ||
| 34 | flex: 1; | ||
| 35 | color: #333333; | ||
| 36 | } | ||
| 37 | |||
| 38 | .net { | ||
| 39 | color: #3680EB; | ||
| 40 | } | ||
| 41 | |||
| 42 | .exts { | ||
| 43 | @extend .fcc; | ||
| 44 | |||
| 45 | .icon { | ||
| 46 | width: 36px; | ||
| 47 | height: 35px; | ||
| 48 | margin-right: 10px; | ||
| 49 | } | ||
| 50 | } | ||
| 51 | |||
| 52 | |||
| 53 | } | ||
| 54 | |||
| 55 | .upload{ | ||
| 56 | margin-top: 30px; | ||
| 57 | .tips{ | ||
| 58 | font-size: 28px; | ||
| 59 | color: #666666; | ||
| 60 | } | ||
| 61 | .upload{} | ||
| 62 | } | ||
| 63 | |||
| 64 | .textarea { | ||
| 65 | background: #F8F8F8; | ||
| 66 | @extend .bb; | ||
| 67 | padding: 20px; | ||
| 68 | font-size: 28px; | ||
| 69 | } | ||
| 70 | } | ||
| 16 | } | 71 | } |
| 17 | } | 72 | } |
| 18 | } | 73 | } |
| 74 | |||
| 75 | .border { | ||
| 76 | width: $contentWidth; | ||
| 77 | @extend .shadow; | ||
| 78 | background-color: #ffffff; | ||
| 79 | @extend .bb; | ||
| 80 | padding: 40px 34px; | ||
| 81 | margin: 0 auto 20px; | ||
| 82 | } | ... | ... |
| ... | @@ -3,6 +3,28 @@ | ... | @@ -3,6 +3,28 @@ |
| 3 | <view class="app__bg bg"></view> | 3 | <view class="app__bg bg"></view> |
| 4 | <view class="app__content main"> | 4 | <view class="app__content main"> |
| 5 | <view class="top-space"></view> | 5 | <view class="top-space"></view> |
| 6 | <view class="content"></view> | 6 | <view class="content"> |
| 7 | <view class="border table"> | ||
| 8 | <view class="form"> | ||
| 9 | <view class="form-item"> | ||
| 10 | <view class="label">用户姓名</view> | ||
| 11 | <view class="val">深圳市龙岗区龙信工业区A栋</view> | ||
| 12 | </view> | ||
| 13 | <view class="form-item"> | ||
| 14 | <view class="label">联系方式</view> | ||
| 15 | <view class="val">深圳市龙岗区龙信工业区A栋</view> | ||
| 16 | </view> | ||
| 17 | <view class="form-item"></view> | ||
| 18 | <textarea class="textarea" placeholder="不超过500字"></textarea> | ||
| 19 | <view class="upload"> | ||
| 20 | <view class="tips">上传照片</view> | ||
| 21 | <!-- <view class="up"></view> --> | ||
| 22 | </view> | ||
| 23 | </view> | ||
| 24 | </view> | ||
| 25 | </view> | ||
| 7 | </view> | 26 | </view> |
| 8 | </view> | 27 | </view> |
| 28 | <van-popup show="{{ authorizeVisible }}"> | ||
| 29 | <authorize-comp bind:evtcomp="evtcomp"></authorize-comp> | ||
| 30 | </van-popup> | ... | ... |
| 1 | @import '../../assets/scss/mixins'; | 1 | @import '../../assets/scss/mixins'; |
| 2 | @import '../../assets/scss/utils'; | 2 | @import '../../assets/scss/utils'; |
| 3 | 3 | ||
| 4 | $contentWidth:690px; | ||
| 5 | |||
| 4 | .page { | 6 | .page { |
| 7 | border-bottom: $pageBottom; | ||
| 8 | |||
| 5 | .bgc {} | 9 | .bgc {} |
| 6 | 10 | ||
| 7 | .bg {} | 11 | .bg {} |
| 8 | 12 | ||
| 9 | .main { | 13 | .main { |
| 10 | .top-space { | 14 | .top-space { |
| 11 | height: 0px; | 15 | height: 20px; |
| 12 | } | 16 | } |
| 13 | 17 | ||
| 14 | .content { | 18 | .content { |
| 15 | position: relative; | 19 | position: relative; |
| 20 | |||
| 21 | // banner | ||
| 22 | .banner { | ||
| 23 | width: 726px; | ||
| 24 | margin: 0 auto; | ||
| 25 | |||
| 26 | image { | ||
| 27 | width: 726px; | ||
| 28 | } | ||
| 29 | } | ||
| 30 | |||
| 31 | // 表单 | ||
| 32 | .table { | ||
| 33 | .form { | ||
| 34 | &-item { | ||
| 35 | font-size: 28px; | ||
| 36 | display: flex; | ||
| 37 | justify-content: space-between; | ||
| 38 | margin: 30px auto; | ||
| 39 | |||
| 40 | .label { | ||
| 41 | color: #666666; | ||
| 42 | width: 120px; | ||
| 43 | margin-right: 20px; | ||
| 44 | } | ||
| 45 | |||
| 46 | .val { | ||
| 47 | flex: 1; | ||
| 48 | color: #333333; | ||
| 49 | } | ||
| 50 | |||
| 51 | .net { | ||
| 52 | color: #3680EB; | ||
| 53 | } | ||
| 54 | |||
| 55 | .exts { | ||
| 56 | @extend .fcc; | ||
| 57 | |||
| 58 | .icon { | ||
| 59 | width: 36px; | ||
| 60 | height: 35px; | ||
| 61 | margin-right: 10px; | ||
| 62 | } | ||
| 63 | } | ||
| 64 | } | ||
| 65 | } | ||
| 66 | } | ||
| 67 | |||
| 68 | // 关注 | ||
| 69 | .focus { | ||
| 70 | text-align: center; | ||
| 71 | |||
| 72 | .qrcode { | ||
| 73 | margin-top: 16px; | ||
| 74 | width: 280px; | ||
| 75 | } | ||
| 76 | |||
| 77 | .tips { | ||
| 78 | margin-top: 10px; | ||
| 79 | font-size: 28px; | ||
| 80 | color: #333333; | ||
| 81 | } | ||
| 82 | |||
| 83 | .btn { | ||
| 84 | // @extend .bc | ||
| 85 | @include cb(); | ||
| 86 | margin: 40px auto 24px; | ||
| 87 | } | ||
| 88 | |||
| 89 | } | ||
| 16 | } | 90 | } |
| 17 | } | 91 | } |
| 18 | } | 92 | } |
| 93 | |||
| 94 | |||
| 95 | |||
| 96 | .border { | ||
| 97 | width: $contentWidth; | ||
| 98 | @extend .shadow; | ||
| 99 | background-color: #ffffff; | ||
| 100 | @extend .bb; | ||
| 101 | padding: 24px 30px; | ||
| 102 | margin: 0 auto 20px; | ||
| 103 | } | ... | ... |
| ... | @@ -3,6 +3,51 @@ | ... | @@ -3,6 +3,51 @@ |
| 3 | <view class="app__bg bg"></view> | 3 | <view class="app__bg bg"></view> |
| 4 | <view class="app__content main"> | 4 | <view class="app__content main"> |
| 5 | <view class="top-space"></view> | 5 | <view class="top-space"></view> |
| 6 | <view class="content"></view> | 6 | <view class="content"> |
| 7 | <!-- banner --> | ||
| 8 | <view class="banner"> | ||
| 9 | <image class="image" mode="widthFix" src="../../image/contact/contact-c1.png" /> | ||
| 10 | </view> | ||
| 11 | <!-- 表单 --> | ||
| 12 | <view class="border table"> | ||
| 13 | <view class="form"> | ||
| 14 | <view class="form-item"> | ||
| 15 | <view class="label">生产地址</view> | ||
| 16 | <view class="val">深圳市龙岗区龙信工业区A栋</view> | ||
| 17 | </view> | ||
| 18 | <view class="form-item"> | ||
| 19 | <view class="label">电话</view> | ||
| 20 | <view class="val">0755-28839576</view> | ||
| 21 | <view class="exts"> | ||
| 22 | <image class="icon" mode="aspectFit" src="../../image/contact/contact-c2.png" /> | ||
| 23 | </view> | ||
| 24 | </view> | ||
| 25 | <view class="form-item"> | ||
| 26 | <view class="label">手机</view> | ||
| 27 | <view class="val">0755-28839576</view> | ||
| 28 | <view class="exts"> | ||
| 29 | <image class="icon" mode="aspectFit" src="../../image/contact/contact-c2.png" /> | ||
| 30 | </view> | ||
| 31 | </view> | ||
| 32 | <view class="form-item"> | ||
| 33 | <view class="label">网址</view> | ||
| 34 | <view class="val net">www.zgzlzm.com</view> | ||
| 35 | </view> | ||
| 36 | <view class="form-item"> | ||
| 37 | <view class="label">E-mail</view> | ||
| 38 | <view class="val net">www.zgzlzm.com</view> | ||
| 39 | </view> | ||
| 40 | </view> | ||
| 41 | </view> | ||
| 42 | <!-- 关注 --> | ||
| 43 | <view class="border focus"> | ||
| 44 | <image class="qrcode" mode="widthFix" src="../../image/qrcode/qrcode-focus.png" /> | ||
| 45 | <view class="tips">更多讯息,欢迎关注我们的公众号</view> | ||
| 46 | <view class="btn">一键关注</view> | ||
| 47 | </view> | ||
| 48 | </view> | ||
| 7 | </view> | 49 | </view> |
| 8 | </view> | 50 | </view> |
| 51 | <van-popup show="{{ authorizeVisible }}"> | ||
| 52 | <authorize-comp bind:evtcomp="evtcomp"></authorize-comp> | ||
| 53 | </van-popup> | ... | ... |
| 1 | let app = getApp(); | 1 | let app = getApp(); |
| 2 | Page({ | 2 | Page({ |
| 3 | data: {}, | 3 | data: { |
| 4 | authorizeVisible: false, | ||
| 5 | }, | ||
| 6 | onShareAppMessage() {}, | ||
| 7 | showAuth() { | ||
| 8 | this.setData({ | ||
| 9 | authorizeVisible: true | ||
| 10 | }) | ||
| 11 | }, | ||
| 4 | onLoad(options) {}, | 12 | onLoad(options) {}, |
| 5 | /** | 13 | /** |
| 6 | * 确认兑换 / 提交订单 | 14 | * 确认兑换 / 提交订单 | ... | ... |
| 1 | let app = getApp(); | 1 | let app = getApp(); |
| 2 | Page({ | 2 | Page({ |
| 3 | data: { | 3 | data: { |
| 4 | authorizeVisible: false, | ||
| 4 | productList: ["", "", ""] | 5 | productList: ["", "", ""] |
| 5 | }, | 6 | }, |
| 7 | onShareAppMessage() {}, | ||
| 8 | showAuth() { | ||
| 9 | this.setData({ | ||
| 10 | authorizeVisible: true | ||
| 11 | }) | ||
| 12 | }, | ||
| 6 | onLoad(options) {}, | 13 | onLoad(options) {}, |
| 7 | /** | 14 | /** |
| 8 | * 显示礼物详情 | 15 | * 显示礼物详情 | ... | ... |
| ... | @@ -6,17 +6,17 @@ | ... | @@ -6,17 +6,17 @@ |
| 6 | <div class="top-wrap"> | 6 | <div class="top-wrap"> |
| 7 | <view class="search"> | 7 | <view class="search"> |
| 8 | <input class="ipt" placeholder="输入关键字搜索" /> | 8 | <input class="ipt" placeholder="输入关键字搜索" /> |
| 9 | <image class="icon" mode="aspectFit" src="../../image/icon/icon_search.png" /> | 9 | <image class="icon" mode="aspectFit" src="../../image/icon/icon-search.png" /> |
| 10 | </view> | 10 | </view> |
| 11 | <view class="filter"> | 11 | <view class="filter"> |
| 12 | 积分排序 | 12 | 积分排序 |
| 13 | <view wx:if="{{1>0}}" class="icon-wrap"> | 13 | <view wx:if="{{1>0}}" class="icon-wrap"> |
| 14 | <image class="icon up" src="../../image/icon/icon_filter_up_on.png" mode="widthFix" /> | 14 | <image class="icon up" src="../../image/icon/icon-filter-up-on.png" mode="widthFix" /> |
| 15 | <image class="icon down" src="../../image/icon/icon_filter_down.png" mode="widthFix" /> | 15 | <image class="icon down" src="../../image/icon/icon-filter-down.png" mode="widthFix" /> |
| 16 | </view> | 16 | </view> |
| 17 | <view wx:else class="icon-wrap"> | 17 | <view wx:else class="icon-wrap"> |
| 18 | <image class="icon up" src="../../image/icon/icon_filter_up.png" mode="widthFix" /> | 18 | <image class="icon up" src="../../image/icon/icon-filter-up.png" mode="widthFix" /> |
| 19 | <image class="icon down" src="../../image/icon/icon_filter_down_on.png" mode="widthFix" /> | 19 | <image class="icon down" src="../../image/icon/icon-filter-down-on.png" mode="widthFix" /> |
| 20 | </view> | 20 | </view> |
| 21 | </view> | 21 | </view> |
| 22 | </div> | 22 | </div> |
| ... | @@ -39,3 +39,6 @@ | ... | @@ -39,3 +39,6 @@ |
| 39 | </view> | 39 | </view> |
| 40 | </view> | 40 | </view> |
| 41 | </view> | 41 | </view> |
| 42 | <van-popup show="{{ authorizeVisible }}" > | ||
| 43 | <authorize-comp bind:evtcomp="evtcomp"></authorize-comp> | ||
| 44 | </van-popup> | ... | ... |
| 1 | import { | ||
| 2 | getBindtapData | ||
| 3 | } from '../../utils/util'; | ||
| 4 | |||
| 1 | let app = getApp(); | 5 | let app = getApp(); |
| 2 | Page({ | 6 | Page({ |
| 3 | data: { | 7 | data: { |
| 8 | authorizeVisible: false, | ||
| 4 | productDetailVisible: false, | 9 | productDetailVisible: false, |
| 10 | bannerList: [], // 轮播图列表 | ||
| 11 | total: 0, | ||
| 12 | page: 1, | ||
| 13 | size: 10, | ||
| 14 | productList: [], // 产品列表 | ||
| 15 | curProductDetail: {} // 选中的产品详情 | ||
| 5 | }, | 16 | }, |
| 6 | onLoad(options) {}, | 17 | onShareAppMessage() {}, |
| 7 | 18 | showAuth() { | |
| 8 | // 子组件事件 | 19 | this.setData({ |
| 9 | evtcomp(evt) { | 20 | authorizeVisible: true |
| 10 | let { | 21 | }) |
| 11 | name, | 22 | }, |
| 12 | data | 23 | onLoad(options) { |
| 13 | } = evt.detail; | 24 | this.queryProduct(); |
| 14 | switch (name) { | 25 | this.queryBanner(); |
| 15 | 26 | }, | |
| 16 | case "_evt_hide_product_detail_mask": | 27 | // 到达底部 |
| 28 | onReachBottom() { | ||
| 29 | if (this.data.productList.length < this.data.total) { | ||
| 30 | this.setData({ | ||
| 31 | page: this.data.page + 1 | ||
| 32 | }); | ||
| 33 | this.queryProduct(); | ||
| 34 | } | ||
| 35 | }, | ||
| 36 | // 重置页面列表 点击搜索条件时需要 | ||
| 37 | resetPage() { | ||
| 38 | this.setData({ | ||
| 39 | page: 1, | ||
| 40 | productList: [] | ||
| 41 | }) | ||
| 42 | }, | ||
| 43 | /** | ||
| 44 | * 请求产品 | ||
| 45 | */ | ||
| 46 | queryProduct() { | ||
| 47 | return new Promise((resolve, reject) => { | ||
| 48 | app.post({ | ||
| 49 | sid: false, | ||
| 50 | url: app.api.product, | ||
| 51 | data: { | ||
| 52 | page: this.data.page, | ||
| 53 | size: this.data.size, | ||
| 54 | }, | ||
| 55 | }).then((result) => { | ||
| 56 | let productList = result.list; | ||
| 57 | productList = this.data.productList.concat(productList); | ||
| 17 | this.setData({ | 58 | this.setData({ |
| 18 | productDetailVisible: false | 59 | productList: productList, |
| 60 | total: result.total | ||
| 19 | }) | 61 | }) |
| 20 | break; | 62 | resolve(); |
| 21 | 63 | }) | |
| 22 | default: | 64 | }); |
| 23 | break; | ||
| 24 | } | ||
| 25 | }, | 65 | }, |
| 26 | /** | 66 | /** |
| 67 | * 请求bannder | ||
| 68 | */ | ||
| 69 | queryBanner() { | ||
| 70 | return new Promise((resolve, reject) => { | ||
| 71 | app.post({ | ||
| 72 | sid: false, | ||
| 73 | url: app.api.bannerList, | ||
| 74 | data: {}, | ||
| 75 | }).then((result) => { | ||
| 76 | this.setData({ | ||
| 77 | bannerList: result | ||
| 78 | }) | ||
| 79 | resolve(); | ||
| 80 | }) | ||
| 81 | }); | ||
| 82 | }, | ||
| 83 | |||
| 84 | /** | ||
| 27 | * 点击详情 | 85 | * 点击详情 |
| 28 | */ | 86 | */ |
| 29 | onProductItemHandler() { | 87 | onProductItemHandler(evt) { |
| 88 | let curProductDetail = getBindtapData(evt); | ||
| 30 | this.setData({ | 89 | this.setData({ |
| 90 | curProductDetail: curProductDetail, | ||
| 31 | productDetailVisible: true | 91 | productDetailVisible: true |
| 32 | }) | 92 | }) |
| 33 | }, | 93 | }, |
| ... | @@ -42,5 +102,23 @@ Page({ | ... | @@ -42,5 +102,23 @@ Page({ |
| 42 | let result = res.result; | 102 | let result = res.result; |
| 43 | } | 103 | } |
| 44 | }) | 104 | }) |
| 45 | } | 105 | }, |
| 106 | // 子组件事件 | ||
| 107 | evtcomp(evt) { | ||
| 108 | let { | ||
| 109 | name, | ||
| 110 | data | ||
| 111 | } = evt.detail; | ||
| 112 | switch (name) { | ||
| 113 | |||
| 114 | case "_evt_hide_product_detail_mask": | ||
| 115 | this.setData({ | ||
| 116 | productDetailVisible: false | ||
| 117 | }) | ||
| 118 | break; | ||
| 119 | |||
| 120 | default: | ||
| 121 | break; | ||
| 122 | } | ||
| 123 | }, | ||
| 46 | }) | 124 | }) | ... | ... |
| ... | @@ -14,7 +14,7 @@ $contentWidth:670px; | ... | @@ -14,7 +14,7 @@ $contentWidth:670px; |
| 14 | .main { | 14 | .main { |
| 15 | 15 | ||
| 16 | .top { | 16 | .top { |
| 17 | position: fixed; | 17 | position: relative; |
| 18 | width: 750px; | 18 | width: 750px; |
| 19 | z-index: 11; | 19 | z-index: 11; |
| 20 | 20 | ||
| ... | @@ -24,13 +24,18 @@ $contentWidth:670px; | ... | @@ -24,13 +24,18 @@ $contentWidth:670px; |
| 24 | height: 300px; | 24 | height: 300px; |
| 25 | } | 25 | } |
| 26 | 26 | ||
| 27 | .space1{ | ||
| 28 | height: 222px; | ||
| 29 | } | ||
| 30 | |||
| 27 | .search { | 31 | .search { |
| 28 | position: relative; | 32 | position: relative; |
| 29 | width: $contentWidth; | 33 | width: $contentWidth; |
| 30 | height: 100px; | 34 | height: 100px; |
| 31 | background: #FFFFFF; | 35 | background: #FFFFFF; |
| 32 | @extend .shadow; | 36 | @extend .shadow; |
| 33 | margin: 222px auto 0; | 37 | // margin: 222px auto 0; |
| 38 | margin: 0 auto 0; | ||
| 34 | display: flex; | 39 | display: flex; |
| 35 | justify-content: space-between; | 40 | justify-content: space-between; |
| 36 | align-items: center; | 41 | align-items: center; |
| ... | @@ -66,7 +71,8 @@ $contentWidth:670px; | ... | @@ -66,7 +71,8 @@ $contentWidth:670px; |
| 66 | } | 71 | } |
| 67 | 72 | ||
| 68 | .top-space { | 73 | .top-space { |
| 69 | height: 362px; | 74 | // height: 362px; |
| 75 | height: 80px; | ||
| 70 | } | 76 | } |
| 71 | 77 | ||
| 72 | .content { | 78 | .content { |
| ... | @@ -78,8 +84,17 @@ $contentWidth:670px; | ... | @@ -78,8 +84,17 @@ $contentWidth:670px; |
| 78 | .banner { | 84 | .banner { |
| 79 | width: $contentWidth; | 85 | width: $contentWidth; |
| 80 | height: 250px; | 86 | height: 250px; |
| 81 | background-color: wheat; | ||
| 82 | margin: 0 auto; | 87 | margin: 0 auto; |
| 88 | |||
| 89 | .swiper { | ||
| 90 | width: $contentWidth; | ||
| 91 | height: 250px; | ||
| 92 | |||
| 93 | .swiper-image { | ||
| 94 | width: $contentWidth; | ||
| 95 | height: 250px; | ||
| 96 | } | ||
| 97 | } | ||
| 83 | } | 98 | } |
| 84 | 99 | ||
| 85 | // 产品 | 100 | // 产品 |
| ... | @@ -111,19 +126,21 @@ $contentWidth:670px; | ... | @@ -111,19 +126,21 @@ $contentWidth:670px; |
| 111 | padding-bottom: 12px; | 126 | padding-bottom: 12px; |
| 112 | 127 | ||
| 113 | .image { | 128 | .image { |
| 114 | background: wheat; | ||
| 115 | width: 322px; | 129 | width: 322px; |
| 116 | height: 322px; | 130 | height: 322px; |
| 117 | } | 131 | } |
| 118 | 132 | ||
| 119 | .desc { | 133 | .desc { |
| 120 | @extend .bb; | 134 | @extend .bb; |
| 135 | width: 322px; | ||
| 121 | padding: 4px 20px; | 136 | padding: 4px 20px; |
| 122 | font-size: 24px; | 137 | font-size: 24px; |
| 123 | // line-height: 32px; | 138 | // line-height: 32px; |
| 124 | color: #333333; | 139 | color: #333333; |
| 125 | @include ellipsis(3); | 140 | @include ellipsis(3); |
| 126 | } | 141 | } |
| 142 | |||
| 143 | |||
| 127 | } | 144 | } |
| 128 | } | 145 | } |
| 129 | } | 146 | } | ... | ... |
| ... | @@ -4,58 +4,40 @@ | ... | @@ -4,58 +4,40 @@ |
| 4 | <view class="app__content main"> | 4 | <view class="app__content main"> |
| 5 | <!-- Title及搜索框 --> | 5 | <!-- Title及搜索框 --> |
| 6 | <view class="top"> | 6 | <view class="top"> |
| 7 | <image class="top-bg" mode="widthFix" src="../../image/index/index_c1.png" /> | 7 | <image class="top-bg" mode="widthFix" src="../../image/index/index-c1.png" /> |
| 8 | <view class="space1"></view> | ||
| 8 | <view class="search"> | 9 | <view class="search"> |
| 9 | <view class="search-ipt-wrap"> | 10 | <view class="search-ipt-wrap"> |
| 10 | <input class="ipt" placeholder="请输入串码" /> | 11 | <input class="ipt" placeholder="请输入串码" /> |
| 11 | </view> | 12 | </view> |
| 12 | <view class="search-scan"> | 13 | <view class="search-scan"> |
| 13 | <image class="icon" mode="aspectFit" src="../../image/icon/icon_search.png" /> | 14 | <image class="icon" mode="aspectFit" src="../../image/icon/icon-search.png" /> |
| 14 | </view> | 15 | </view> |
| 15 | <view class="search-line"></view> | 16 | <view class="search-line"></view> |
| 16 | <view bindtap="onScanHandler" class="search-scan"> | 17 | <view bindtap="onScanHandler" class="search-scan"> |
| 17 | <image class="icon" mode="aspectFit" src="../../image/icon/icon_scan.png" /> | 18 | <image class="icon" mode="aspectFit" src="../../image/icon/icon-scan.png" /> |
| 18 | </view> | 19 | </view> |
| 19 | </view> | 20 | </view> |
| 20 | </view> | 21 | </view> |
| 21 | <view class="top-space"></view> | 22 | <view class="top-space"></view> |
| 22 | <view class="content"> | 23 | <view class="content"> |
| 23 | <!-- 轮播 banner --> | 24 | <!-- 轮播 banner --> |
| 24 | <!-- <swiper indicator-dots="{{true}}" autoplay="{{true}}" interval="{{5000}}" duration="{{500}}"> | 25 | <view class="banner"> |
| 25 | <block wx:for="{{imgUrls}}"> | 26 | <swiper class="swiper" indicator-color="rgba(0,0,0,.3)" indicator-active-color="rgba(255,255,255,1)" indicator-dots="{{true}}" autoplay="{{true}}" interval="{{5000}}" duration="{{500}}"> |
| 26 | <swiper-item> | 27 | <block wx:for="{{bannerList}}" wx:key="{{index}}"> |
| 27 | <image class="swiper-image" src="{{item}}" /> | 28 | <swiper-item> |
| 28 | </swiper-item> | 29 | <image class="swiper-image" src="{{item}}" mode="aspectFill" /> |
| 29 | </block> | 30 | </swiper-item> |
| 30 | </swiper> --> | 31 | </block> |
| 31 | <view class="banner"></view> | 32 | </swiper> |
| 33 | </view> | ||
| 32 | <view class="product"> | 34 | <view class="product"> |
| 33 | <view class="product-title">产品推荐{{codeStr}}</view> | 35 | <view class="product-title">产品推荐{{codeStr}}</view> |
| 34 | <view class="product-list"> | 36 | <view class="product-list"> |
| 35 | <!-- for循环 --> | 37 | <!-- for循环 --> |
| 36 | <view class="item" bindtap="onProductItemHandler"> | 38 | <view bindtap="onProductItemHandler" data-data="{{item}}" wx:for="{{productList}}" wx:key="{{index}}" class="item"> |
| 37 | <image class="image" mode="aspectFill" /> | 39 | <image class="image" mode="aspectFill" src="{{item.productImages[0]}}" /> |
| 38 | <view class="desc"> | 40 | <view class="desc">{{item.productInfo}}</view> |
| 39 | LED筒灯-3W 5W 7W 9W 12W 15W 18WLED筒灯-3W 5W 7W 9W 12W 15W 18WLED筒灯-3W 5W 7W 9W 12W 15W 18WLED筒灯-3W 5W 7W 9W 12W 15W 18W | ||
| 40 | </view> | ||
| 41 | </view> | ||
| 42 | <view class="item"> | ||
| 43 | <image class="image" mode="aspectFill" /> | ||
| 44 | <view class="desc"> | ||
| 45 | LED筒灯-3W 5W 7W 9W 12W 15W 18WLED筒灯-3W 5W 7W 9W 12W 15W 18WLED筒灯-3W 5W 7W 9W 12W 15W 18WLED筒灯-3W 5W 7W 9W 12W 15W 18W | ||
| 46 | </view> | ||
| 47 | </view> | ||
| 48 | <view class="item"> | ||
| 49 | <image class="image" mode="aspectFill" /> | ||
| 50 | <view class="desc"> | ||
| 51 | LED筒灯-3W 5W 7W 9W 12W 15W 18WLED筒灯-3W 5W 7W 9W 12W 15W 18WLED筒灯-3W 5W 7W 9W 12W 15W 18WLED筒灯-3W 5W 7W 9W 12W 15W 18W | ||
| 52 | </view> | ||
| 53 | </view> | ||
| 54 | <view class="item"> | ||
| 55 | <image class="image" mode="aspectFill" /> | ||
| 56 | <view class="desc"> | ||
| 57 | LED筒灯-3W 5W 7W 9W 12W 15W 18WLED筒灯-3W 5W 7W 9W 12W 15W 18WLED筒灯-3W 5W 7W 9W 12W 15W 18WLED筒灯-3W 5W 7W 9W 12W 15W 18W | ||
| 58 | </view> | ||
| 59 | </view> | 41 | </view> |
| 60 | </view> | 42 | </view> |
| 61 | </view> | 43 | </view> |
| ... | @@ -63,5 +45,8 @@ | ... | @@ -63,5 +45,8 @@ |
| 63 | </view> | 45 | </view> |
| 64 | </view> | 46 | </view> |
| 65 | <van-popup show="{{ productDetailVisible }}" position="bottom"> | 47 | <van-popup show="{{ productDetailVisible }}" position="bottom"> |
| 66 | <product-detail-comp bind:evtcomp="evtcomp"></product-detail-comp> | 48 | <product-detail-comp product-info="{{curProductDetail}}" bind:evtcomp="evtcomp"></product-detail-comp> |
| 49 | </van-popup> | ||
| 50 | <van-popup show="{{ authorizeVisible }}"> | ||
| 51 | <authorize-comp bind:evtcomp="evtcomp"></authorize-comp> | ||
| 67 | </van-popup> | 52 | </van-popup> | ... | ... |
| 1 | let app = getApp(); | 1 | let app = getApp(); |
| 2 | Page({ | 2 | Page({ |
| 3 | data: {}, | 3 | data: { |
| 4 | onLoad(options) {} | 4 | authorizeVisible: false, |
| 5 | userInfo: {}, | ||
| 6 | }, | ||
| 7 | onShareAppMessage() {}, | ||
| 8 | showAuth() { | ||
| 9 | this.setData({ | ||
| 10 | authorizeVisible: true | ||
| 11 | }) | ||
| 12 | }, | ||
| 13 | onShow() { | ||
| 14 | |||
| 15 | }, | ||
| 16 | onLoad(options) { | ||
| 17 | this.initData(); | ||
| 18 | }, | ||
| 19 | initData() { | ||
| 20 | this.queryMember(); | ||
| 21 | }, | ||
| 22 | /** | ||
| 23 | * 获取会员信息 | ||
| 24 | */ | ||
| 25 | queryMember() { | ||
| 26 | return new Promise((resolve, reject) => { | ||
| 27 | app.post({ | ||
| 28 | url: app.api.member, | ||
| 29 | data: {} | ||
| 30 | }).then((result) => { | ||
| 31 | this.setData({ | ||
| 32 | userInfo: result | ||
| 33 | }) | ||
| 34 | resolve(); | ||
| 35 | }) | ||
| 36 | }); | ||
| 37 | }, | ||
| 38 | |||
| 39 | // 子组件事件 | ||
| 40 | evtcomp(evt) { | ||
| 41 | let { | ||
| 42 | name, | ||
| 43 | data | ||
| 44 | } = evt.detail; | ||
| 45 | switch (name) { | ||
| 46 | |||
| 47 | case "_evt_auth_complete": | ||
| 48 | this.initData(); | ||
| 49 | break; | ||
| 50 | |||
| 51 | case "_evt_hide_mask": | ||
| 52 | break; | ||
| 53 | |||
| 54 | default: | ||
| 55 | break; | ||
| 56 | } | ||
| 57 | }, | ||
| 5 | }) | 58 | }) | ... | ... |
| 1 | @import '../../assets/scss/mixins'; | 1 | @import '../../assets/scss/mixins'; |
| 2 | @import '../../assets/scss/utils'; | 2 | @import '../../assets/scss/utils'; |
| 3 | 3 | ||
| 4 | $contentWidth: 690px; | ||
| 5 | |||
| 4 | .page { | 6 | .page { |
| 7 | padding-bottom: $pageBottom; | ||
| 8 | |||
| 5 | .bgc {} | 9 | .bgc {} |
| 6 | 10 | ||
| 7 | .bg {} | 11 | .bg {} |
| 8 | 12 | ||
| 9 | .main { | 13 | .main { |
| 14 | |||
| 15 | .top { | ||
| 16 | position: relative; | ||
| 17 | width: 750px; | ||
| 18 | color: #ffffff; | ||
| 19 | |||
| 20 | &-bg { | ||
| 21 | position: absolute; | ||
| 22 | width: 750px; | ||
| 23 | height: 300px; | ||
| 24 | } | ||
| 25 | |||
| 26 | .user { | ||
| 27 | width: 750px; | ||
| 28 | margin: 0 auto 36px; | ||
| 29 | position: relative; | ||
| 30 | padding-top: 42px; | ||
| 31 | display: flex; | ||
| 32 | justify-content: space-between; | ||
| 33 | z-index: 21; | ||
| 34 | |||
| 35 | &-info { | ||
| 36 | display: flex; | ||
| 37 | padding-left: 30px; | ||
| 38 | @extend .bb; | ||
| 39 | |||
| 40 | .avatar { | ||
| 41 | width: 120px; | ||
| 42 | height: 120px; | ||
| 43 | border-radius: 60px; | ||
| 44 | } | ||
| 45 | |||
| 46 | .wrap1 { | ||
| 47 | margin-top: 12px; | ||
| 48 | margin-left: 20px; | ||
| 49 | |||
| 50 | .name { | ||
| 51 | font-size: 36px; | ||
| 52 | } | ||
| 53 | |||
| 54 | .vip { | ||
| 55 | font-size: 24px; | ||
| 56 | margin-top: 8px; | ||
| 57 | background: #FF7B21; | ||
| 58 | border-radius: 4px; | ||
| 59 | padding: 2px 12px; | ||
| 60 | border-radius: 8px; | ||
| 61 | } | ||
| 62 | |||
| 63 | .vip-check{ | ||
| 64 | background: #6DD400; | ||
| 65 | } | ||
| 66 | } | ||
| 67 | } | ||
| 68 | |||
| 69 | &-data { | ||
| 70 | display: flex; | ||
| 71 | align-items: center; | ||
| 72 | |||
| 73 | |||
| 74 | .wrap { | ||
| 75 | // width: 120px; | ||
| 76 | padding: 0 40px; | ||
| 77 | text-align: center; | ||
| 78 | |||
| 79 | .t1 { | ||
| 80 | font-size: 40px; | ||
| 81 | } | ||
| 82 | |||
| 83 | .t2 { | ||
| 84 | font-size: 24px; | ||
| 85 | opacity: .7; | ||
| 86 | } | ||
| 87 | } | ||
| 88 | |||
| 89 | .line { | ||
| 90 | height: 80px; | ||
| 91 | width: 2px; | ||
| 92 | opacity: 0.5; | ||
| 93 | background: #FFFFFF; | ||
| 94 | } | ||
| 95 | } | ||
| 96 | } | ||
| 97 | } | ||
| 98 | |||
| 10 | .top-space { | 99 | .top-space { |
| 11 | height: 0px; | 100 | height: 0px; |
| 12 | } | 101 | } |
| 13 | 102 | ||
| 14 | .content { | 103 | .content { |
| 15 | position: relative; | 104 | position: relative; |
| 105 | color: #ffffff; | ||
| 106 | |||
| 107 | // 场景 | ||
| 108 | .sence { | ||
| 109 | width: $contentWidth; | ||
| 110 | margin: 0 auto 0; | ||
| 111 | |||
| 112 | .border { | ||
| 113 | width: $contentWidth; | ||
| 114 | @extend .shadow; | ||
| 115 | background-color: #ffffff; | ||
| 116 | @extend .bb; | ||
| 117 | padding: 24px 26px; | ||
| 118 | margin: 0 auto 20px; | ||
| 119 | } | ||
| 120 | |||
| 121 | // 签到区 | ||
| 122 | .sign { | ||
| 123 | |||
| 124 | // 头部 | ||
| 125 | .tit { | ||
| 126 | display: flex; | ||
| 127 | justify-content: space-between; | ||
| 128 | |||
| 129 | .t1 { | ||
| 130 | font-size: 28px; | ||
| 131 | color: #333333; | ||
| 132 | font-weight: bold; | ||
| 133 | } | ||
| 134 | |||
| 135 | .t2 { | ||
| 136 | display: flex; | ||
| 137 | align-items: center; | ||
| 138 | font-size: 24px; | ||
| 139 | color: #3680EB; | ||
| 140 | |||
| 141 | .icon { | ||
| 142 | width: 34px; | ||
| 143 | height: 36px; | ||
| 144 | margin-right: 10px; | ||
| 145 | } | ||
| 146 | } | ||
| 147 | } | ||
| 148 | |||
| 149 | // 7天签到 | ||
| 150 | .check { | ||
| 151 | position: relative; | ||
| 152 | margin: 32px auto 0; | ||
| 153 | display: flex; | ||
| 154 | justify-content: space-between; | ||
| 155 | |||
| 156 | &-item { | ||
| 157 | width: 68px; | ||
| 158 | height: 100px; | ||
| 159 | border-radius: 8px; | ||
| 160 | text-align: center; | ||
| 161 | background: #F0F0F0; | ||
| 162 | padding: 8px 4px; | ||
| 163 | @extend .bb; | ||
| 164 | |||
| 165 | .no { | ||
| 166 | @extend .fcc; | ||
| 167 | color: #333333; | ||
| 168 | font-size: 28px; | ||
| 169 | height: 40px; | ||
| 170 | } | ||
| 171 | |||
| 172 | .icon { | ||
| 173 | image { | ||
| 174 | margin-top: 4px; | ||
| 175 | width: 40px; | ||
| 176 | height: 40px; | ||
| 177 | } | ||
| 178 | } | ||
| 179 | } | ||
| 180 | |||
| 181 | &-item-act { | ||
| 182 | color: #FFFFFF; | ||
| 183 | background: #3680EB; | ||
| 184 | |||
| 185 | .no { | ||
| 186 | color: #ffffff; | ||
| 187 | } | ||
| 188 | } | ||
| 189 | } | ||
| 190 | |||
| 191 | // 签到按钮 | ||
| 192 | &-btn { | ||
| 193 | @include btc(280px, 68px); | ||
| 194 | margin: 42px auto 4px; | ||
| 195 | border-radius: 34px; | ||
| 196 | background: #3680EB; | ||
| 197 | font-size: 28px; | ||
| 198 | color: #FFFFFF; | ||
| 199 | } | ||
| 200 | &-btn-disable{ | ||
| 201 | background: #ECECEC; | ||
| 202 | } | ||
| 203 | } | ||
| 204 | |||
| 205 | // 订单区域 | ||
| 206 | .order { | ||
| 207 | display: flex; | ||
| 208 | justify-content: space-between; | ||
| 209 | font-size: 24px; | ||
| 210 | color: #131415; | ||
| 211 | text-align: center; | ||
| 212 | |||
| 213 | &-item { | ||
| 214 | width: 110px; | ||
| 215 | |||
| 216 | .icon-wrap { | ||
| 217 | @extend .fcc; | ||
| 218 | height: 100px; | ||
| 219 | height: 100px; | ||
| 220 | |||
| 221 | .icon { | ||
| 222 | height: 64px; | ||
| 223 | height: 64px; | ||
| 224 | } | ||
| 225 | } | ||
| 226 | |||
| 227 | .txt {} | ||
| 228 | } | ||
| 229 | } | ||
| 230 | |||
| 231 | // 功能区 | ||
| 232 | .func { | ||
| 233 | color: #333333; | ||
| 234 | font-size: 28px; | ||
| 235 | text-align: center; | ||
| 236 | |||
| 237 | .my-qrcode { | ||
| 238 | width: 620px; | ||
| 239 | // height: 140px; | ||
| 240 | margin: auto 0; | ||
| 241 | background: #F8F8F8; | ||
| 242 | padding: 22px 0; | ||
| 243 | |||
| 244 | .qrcode { | ||
| 245 | width: 56px; | ||
| 246 | height: 56px; | ||
| 247 | } | ||
| 248 | |||
| 249 | .t1 { | ||
| 250 | margin-top: 4px; | ||
| 251 | } | ||
| 252 | } | ||
| 253 | |||
| 254 | &-wrap { | ||
| 255 | margin: 40px auto 4px; | ||
| 256 | display: flex; | ||
| 257 | justify-content: space-between; | ||
| 258 | |||
| 259 | &-item { | ||
| 260 | width: 132px; | ||
| 261 | |||
| 262 | .icon-wrap { | ||
| 263 | @extend .fcc; | ||
| 264 | height: 100px; | ||
| 265 | height: 100px; | ||
| 266 | |||
| 267 | .icon { | ||
| 268 | height: 64px; | ||
| 269 | height: 64px; | ||
| 270 | } | ||
| 271 | } | ||
| 272 | |||
| 273 | .txt {} | ||
| 274 | } | ||
| 275 | |||
| 276 | } | ||
| 277 | } | ||
| 278 | |||
| 279 | |||
| 280 | } | ||
| 16 | } | 281 | } |
| 17 | } | 282 | } |
| 18 | } | 283 | } | ... | ... |
| ... | @@ -2,7 +2,144 @@ | ... | @@ -2,7 +2,144 @@ |
| 2 | <view class="app__bgc bgc"></view> | 2 | <view class="app__bgc bgc"></view> |
| 3 | <view class="app__bg bg"></view> | 3 | <view class="app__bg bg"></view> |
| 4 | <view class="app__content main"> | 4 | <view class="app__content main"> |
| 5 | <view class="top"> | ||
| 6 | <image class="top-bg" mode="widthFix" src="../../image/user-center/user-center-top-bg.png" /> | ||
| 7 | <!-- 用户信息 --> | ||
| 8 | <view class="user"> | ||
| 9 | <!-- 左边栏 --> | ||
| 10 | <view class="user-info"> | ||
| 11 | <image class="avatar" mode="aspectFill" src="{{userInfo.avatar}}" /> | ||
| 12 | <view class="wrap1"> | ||
| 13 | <view class="name">{{userInfo.realName}}</view> | ||
| 14 | <view wx:if="{{userInfo.auditStatus == 'authorization'}}" class="vip vip-check">积分会员</view> | ||
| 15 | <view wx:else class="vip">未验证 ></view> | ||
| 16 | </view> | ||
| 17 | </view> | ||
| 18 | <!-- 右边栏 --> | ||
| 19 | <view class="user-data"> | ||
| 20 | <view class="wrap"> | ||
| 21 | <view class="t1">1345</view> | ||
| 22 | <view class="t2">我的积分</view> | ||
| 23 | </view> | ||
| 24 | <view class="line"></view> | ||
| 25 | <view class="wrap"> | ||
| 26 | <view class="t1">20</view> | ||
| 27 | <view class="t2">推广数据</view> | ||
| 28 | </view> | ||
| 29 | </view> | ||
| 30 | </view> | ||
| 31 | </view> | ||
| 5 | <view class="top-space"></view> | 32 | <view class="top-space"></view> |
| 6 | <view class="content"></view> | 33 | <view class="content"> |
| 34 | <!-- 场景 --> | ||
| 35 | <view class="sence"> | ||
| 36 | <!-- 签到区 --> | ||
| 37 | <view class="border sign "> | ||
| 38 | <view class="tit"> | ||
| 39 | <view class="t1">连续签到7天赢现金红包</view> | ||
| 40 | <view class="t2"> | ||
| 41 | <image class="icon" mode="aspectFit" src="../../image/icon/icon-sign-record.png" /> | ||
| 42 | 签到记录 | ||
| 43 | </view> | ||
| 44 | </view> | ||
| 45 | <!-- 7天签到 --> | ||
| 46 | <view class="check"> | ||
| 47 | <view class="check-item check-item-act"> | ||
| 48 | <view class="no">1</view> | ||
| 49 | <view class="icon"> | ||
| 50 | <image mode="aspectFit" src="../../image/icon/icon-check.png" /> | ||
| 51 | <!-- <image mode="aspectFit" src="../../image/icon/icon-integral.png" /> --> | ||
| 52 | <!-- <image mode="aspectFit" src="../../image/icon/icon-red-package.png" /> --> | ||
| 53 | </view> | ||
| 54 | </view> | ||
| 55 | <view class="check-item "> | ||
| 56 | <view class="no">2</view> | ||
| 57 | <view class="icon"> | ||
| 58 | <image mode="aspectFit" src="../../image/icon/icon-integral.png" /> | ||
| 59 | </view> | ||
| 60 | </view> | ||
| 61 | <view class="check-item "> | ||
| 62 | <view class="no">3</view> | ||
| 63 | <view class="icon"> | ||
| 64 | <image mode="aspectFit" src="../../image/icon/icon-red-package.png" /> | ||
| 65 | </view> | ||
| 66 | </view> | ||
| 67 | </view> | ||
| 68 | <!-- 签到按钮 --> | ||
| 69 | <!-- <view class="sign-btn ">签到 (第4天)</view> --> | ||
| 70 | <view class="sign-btn sign-btn-disable">已签到</view> | ||
| 71 | </view> | ||
| 72 | <!-- 订单区 --> | ||
| 73 | <view class="border order "> | ||
| 74 | <view class="order-item"> | ||
| 75 | <view class="icon-wrap"> | ||
| 76 | <image class="icon" mode="aspectFit" src="../../image/icon/icon-all-order.png" /> | ||
| 77 | </view> | ||
| 78 | <view class="txt">全部订单</view> | ||
| 79 | </view> | ||
| 80 | <view class="order-item"> | ||
| 81 | <view class="icon-wrap"> | ||
| 82 | <image class="icon" mode="aspectFit" src="../../image/icon/icon-wait-review.png" /> | ||
| 83 | </view> | ||
| 84 | <view class="txt">待审核</view> | ||
| 85 | </view> | ||
| 86 | <view class="order-item"> | ||
| 87 | <view class="icon-wrap"> | ||
| 88 | <image class="icon" mode="aspectFit" src="../../image/icon/icon-review-pass.png" /> | ||
| 89 | </view> | ||
| 90 | <view class="txt">已通过</view> | ||
| 91 | </view> | ||
| 92 | <view class="order-item"> | ||
| 93 | <view class="icon-wrap"> | ||
| 94 | <image class="icon" mode="aspectFit" src="../../image/icon/icon-shipped.png" /> | ||
| 95 | </view> | ||
| 96 | <view class="txt">已发货</view> | ||
| 97 | </view> | ||
| 98 | <view class="order-item"> | ||
| 99 | <view class="icon-wrap"> | ||
| 100 | <image class="icon" mode="aspectFit" src="../../image/icon/icon-up-pass.png" /> | ||
| 101 | </view> | ||
| 102 | <view class="txt">未通过</view> | ||
| 103 | </view> | ||
| 104 | </view> | ||
| 105 | <!-- 功能区 --> | ||
| 106 | <view class="border func"> | ||
| 107 | <view class="my-qrcode"> | ||
| 108 | <image class="qrcode" mode="widthFix" src="../../image/icon/icon-qrcode.png" /> | ||
| 109 | <view class="t1">我的二维码</view> | ||
| 110 | </view> | ||
| 111 | <!-- 功能区 --> | ||
| 112 | <view class="func-wrap"> | ||
| 113 | <view class="func-wrap-item"> | ||
| 114 | <view class="icon-wrap"> | ||
| 115 | <image class="icon" mode="aspectFit" src="../../image/icon/icon-integral-rank.png" /> | ||
| 116 | </view> | ||
| 117 | <view class="txt">积分排行</view> | ||
| 118 | </view> | ||
| 119 | <view class="func-wrap-item"> | ||
| 120 | <view class="icon-wrap"> | ||
| 121 | <image class="icon" mode="aspectFit" src="../../image/icon/icon-my-address.png" /> | ||
| 122 | </view> | ||
| 123 | <view class="txt">我的地址</view> | ||
| 124 | </view> | ||
| 125 | <view class="func-wrap-item"> | ||
| 126 | <view class="icon-wrap"> | ||
| 127 | <image class="icon" mode="aspectFit" src="../../image/icon/icon-my-message.png" /> | ||
| 128 | </view> | ||
| 129 | <view class="txt">我的消息</view> | ||
| 130 | </view> | ||
| 131 | <view class="func-wrap-item"> | ||
| 132 | <view class="icon-wrap"> | ||
| 133 | <image class="icon" mode="aspectFit" src="../../image/icon//icon-concat-us.png" /> | ||
| 134 | </view> | ||
| 135 | <view class="txt">联系我们</view> | ||
| 136 | </view> | ||
| 137 | </view> | ||
| 138 | </view> | ||
| 139 | </view> | ||
| 140 | </view> | ||
| 7 | </view> | 141 | </view> |
| 8 | </view> | 142 | </view> |
| 143 | <van-popup show="{{ authorizeVisible }}"> | ||
| 144 | <authorize-comp bind:evtcomp="evtcomp"></authorize-comp> | ||
| 145 | </van-popup> | ... | ... |
-
Please register or sign in to post a comment