diff --git a/app.js b/app.js index aee4c50..f459511 100644 --- a/app.js +++ b/app.js @@ -102,6 +102,7 @@ App({ }, kjId:null, gp_id:null, - team_id:null + team_id:null, + retailId:"" } }) \ No newline at end of file diff --git a/app.json b/app.json index 1ab6171..4fcfee2 100644 --- a/app.json +++ b/app.json @@ -35,6 +35,11 @@ "pages/info/showInfo/index", "pages/info/strategyInfo/index", "pages/user/user", + "pages/user/retail/index", + "pages/user/retail/apply/index", + "pages/user/retail/goods/index", + "pages/user/retail/list/index", + "pages/user/retail/order/index", "pages/user/coupon/index", "pages/user/verify/index", "pages/user/cartlist/list", @@ -131,7 +136,9 @@ "pages/kj/mine/index", "pages/group/index", "pages/group/mine/index", - "pages/group/info/index" + "pages/group/info/index", + "pages/culture/index", + "pages/culture/infoindex" ], "permission": { "scope.userLocation": { diff --git a/pages/activity/subway/index.js b/pages/activity/subway/index.js index c37c838..12841cd 100644 --- a/pages/activity/subway/index.js +++ b/pages/activity/subway/index.js @@ -11,156 +11,7 @@ Page({ colors:["#2EAE4F","#00A5AF","#E99A10","#278AE7","#C652A7"], tagIndex:0, isFixed:false, - tags:[ - [{ - id:74, - name:"全部" - },{ - id:31, - name:"木渎站" - },{ - id:32, - name:"西环路站" - },{ - id:33, - name:"养育巷站" - },{ - id:34, - name:"乐桥站" - },{ - id:35, - name:"临顿路站" - },{ - id:36, - name:"相门站" - },{ - id:37, - name:"东方之门站" - },{ - id:38, - name:"文化博览中心站" - },{ - id:39, - name:"时代广场站" - }],[{ - id:75, - name:"全部" - },{ - id:40, - name:"山塘街站" - },{ - id:41, - name:"石路站" - },{ - id:42, - name:"桐泾公园站" - },{ - id:43, - name:"独墅湖邻里中心站" - },{ - id:44, - name:"月亮湾站" - },{ - id:45, - name:"桑田岛站" - }],[{ - id:76, - name:"全部" - },{ - id:46, - name:"文昌路站" - },{ - id:47, - name:"索山桥西站" - },{ - id:48, - name:"石湖北站" - },{ - id:48, - name:"石湖北站" - },{ - id:49, - name:"新郭站" - },{ - id:50, - name:"迎春路站" - },{ - id:51, - name:"李公堤西站" - },{ - id:52, - name:"东方之门站" - },{ - id:53, - name:"唯亭站" - }],[{ - id:77, - name:"全部" - },{ - id:54, - name:"龙道浜站" - },{ - id:55, - name:"孙武纪念园站" - },{ - id:56, - name:"北寺塔站" - },{ - id:57, - name:"乐桥站" - },{ - id:58, - name:"三元坊站" - },{ - id:59, - name:"南门站" - },{ - id:60, - name:"苏州湾东站" - },{ - id:61, - name:"松陵大道站" - },{ - id:62, - name:"同里站" - },{ - id:63, - name:"越溪站" - }],[{ - id:78, - name:"全部" - },{ - id:64, - name:"太湖香山站" - },{ - id:65, - name:"胥口站" - },{ - id:66, - name:"灵岩山站" - },{ - id:67, - name:"索山桥西站" - },{ - id:68, - name:"新市桥站" - },{ - id:69, - name:"南门站" - },{ - id:70, - name:"李公堤南站" - },{ - id:71, - name:"斜塘站" - },{ - id:72, - name:"苏州奥体中心站" - },{ - id:73, - name:"阳澄湖南站" - }] - ], + tags:[], list:[], total:1 }, @@ -169,7 +20,17 @@ Page({ * 生命周期函数--监听页面加载 */ onLoad: function (options) { - this.getList() + commonApi._post("pbservice/Other/getClientConfig",{ + unique_key:"wechatxcx" + }).then(res=>{ + let info = JSON.parse(res.data); + console.log(info) + this.setData({ + tags:info.subway + }) + this.getList() + }) + }, changeLine:function(e){ this.setData({ @@ -193,7 +54,8 @@ Page({ commonApi._post('scene/get_scene_by_tag',{ tag_id:this.data.tags[this.data.line][this.data.tagIndex].id, limit:10, - offset:this.data.list.length + offset:this.data.list.length, + del_html:true }).then(res=>{ this.setData({ total:res.data.count, diff --git a/pages/activity/subway/index.wxml b/pages/activity/subway/index.wxml index 3e8fe01..bc0e227 100644 --- a/pages/activity/subway/index.wxml +++ b/pages/activity/subway/index.wxml @@ -17,7 +17,7 @@ {{item.title}} - {{item.display_tags}} + {{item.brief_intro}} 查看详情 diff --git a/pages/culture/index.js b/pages/culture/index.js new file mode 100644 index 0000000..e665346 --- /dev/null +++ b/pages/culture/index.js @@ -0,0 +1,171 @@ +// pages/culture/index.js +import commonApi from "../../utils/https/common" +Page({ + + /** + * 页面的初始数据 + */ + data: { + weeks:[], + selectDay:"", + date:null, + days: ['日','一','二','三','四','五','六'], + top:0, + tags:[], + tagKey:"", + page_no:1, + total:1, + list:[] + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad: function (options) { + let d = new Date(),that = this; + let month = d.getMonth() + 1,day = d.getDate(); + month = month>10?month:("0"+month); + day = day>10?day:("0"+day); + this.setData({ + selectDay:d.getTime(), + date:d.getFullYear()+"-"+month+"-"+day + }) + const query=wx.createSelectorQuery(); //创建节点查询器 + query.select("#types").boundingClientRect() //选择toViewid获取位置信息 + query.exec(function(res) { + console.log(res) + that.setData({ + top:res[0].top + }) + }) + this.getWeekDay(); + // 获取分类 + commonApi._post("pbservice/Culture/getCultureCategory",{ + }).then(res=>{ + this.setData({ + tags:res.data, + tagKey:res.data[0].key + }) + this.getList() + }) + }, + // picker修改日期 + bindDateChange:function(e){ + this.setData({ + selectDay: new Date(e.detail.value).getTime(), + list:[], + page_no:1, + total:1, + date:e.detail.value + }) + this.getWeekDay(); + this.getList(); + }, + // 点击修改日期 + changeDate:function(e){ + let times = e.currentTarget.dataset.times,d = new Date(times); + let month = d.getMonth()+1,day = d.getDate(); + month = month>10?month:('0'+month); + day = day>10?day:('0'+day); + this.setData({ + selectDay: times, + date:d.getFullYear()+"-"+month+"-"+day, + list:[], + page_no:1, + total:1 + }) + this.getList(); + }, + // 获取当前选择日期的一周日期范围 + getWeekDay:function(){ + var myDate = this.data.selectDay, daySecond = 24 * 60 * 60 * 1000,reslist=[]; + for (let i = myDate - daySecond * 3; i <= myDate + daySecond * 3; i = i + daySecond){ + let day = new Date(i),putDate = day.getDate(); + putDate = putDate>=10?putDate:'0'+putDate + let item = { + times:i, + day:this.data.days[day.getDay()], + date:putDate, + isSelect:i==myDate + }; + reslist.push(item); + } + this.setData({ + weeks: reslist + }) + }, + changeTag:function(e){ + this.setData({ + tagKey:e.currentTarget.dataset.tag, + page_no:1, + list:[], + total:1 + }) + this.getList() + }, + getList:function(){ + if(this.data.total<=this.data.list.length) return; + commonApi._post("pbservice/Culture/getCultureList",{ + page_no:this.data.page_no, + page_num:20, + date:this.data.date, + cate_id:this.data.tagKey + }).then(res=>{ + this.setData({ + total:res.data.total, + list:this.data.list.concat(res.data.rows), + page_no:this.data.page_no+1 + }) + console.log(res) + }) + }, + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady: function () { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow: function () { + + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide: function () { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload: function () { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh: function () { + + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom: function () { + this.getList() + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage: function () { + + } +}) \ No newline at end of file diff --git a/pages/culture/index.json b/pages/culture/index.json new file mode 100644 index 0000000..35cf02f --- /dev/null +++ b/pages/culture/index.json @@ -0,0 +1,5 @@ +{ + "usingComponents": { + "title":"/pages/component/TitleHeader" + } +} \ No newline at end of file diff --git a/pages/culture/index.wxml b/pages/culture/index.wxml new file mode 100644 index 0000000..eac9351 --- /dev/null +++ b/pages/culture/index.wxml @@ -0,0 +1,42 @@ + + + + + + {{item.value}} + + + + + + + + {{item.name}} + {{item.begin_date}}-{{item.end_date}} + + {{item.supplier_name}} + + + + 无需预约 + + + + \ No newline at end of file diff --git a/pages/culture/index.wxss b/pages/culture/index.wxss new file mode 100644 index 0000000..efba63e --- /dev/null +++ b/pages/culture/index.wxss @@ -0,0 +1,155 @@ +/* pages/culture/index.wxss */ +.fixed-top { + position: fixed; + left: 0; + right: 0; + height: 200rpx; + background: white; +} +.types { + height: 80rpx; + display: flex; + justify-content: space-between; +} +.types .type { + width: 50%; + text-align: center; + font-size: 30rpx; + color: #333; + line-height: 80rpx; + position: relative; +} +.types .type.active { + color: #0F9095; + font-weight: bold; +} +.types .type.active::after { + content: "1"; + font-size: 0; + width: 40rpx; + height: 6rpx; + position: absolute; + left: 50%; + margin-left: -20rpx; + bottom: 10rpx; + background: #0F9095; + display: block; + border-radius: 3rpx; +} +.date-box { + height: 86rpx; + background: rgba(15, 144, 149, 0.08); + display: flex; + justify-content: space-between; + align-items: center; + padding: 17rpx 0; + padding-left: 20rpx; +} +.date-item { + font-size: 24rpx; + color: #999; + text-align: center; + display: flex; + flex-direction: column; + justify-content: center; + width: 86rpx; + height: 86rpx; +} +.date-item.active { + font-weight:500; + background: #0B898E; + border-radius: 50%; + color: #fff; + font-size: 24rpx; + color: #fff; +} +.date-item view:nth-child(1){ + font-size: 28rpx; + color: #333; +} +.date-item.active view:nth-child(1){ + color: #fff; + font-size: 28rpx; +} +.calendar-img { + width: 70rpx; + padding-left: 10rpx; + height: 80rpx; + display: flex; + align-items: center; + justify-content: flex-start; + border-radius: 30rpx 0px 0px 30rpx; +} +.calendar-img image { + width: 56rpx; + height: 60rpx; + display: block; +} +.calendar-img.active { + background-color: #0B898E; +} +.left-fixed { + position: fixed; + left: 0; + width: 140rpx; + bottom: 0; + text-align: center; + line-height: 80rpx; + font-size: 24rpx; + color: #999; + background: #F2F2F2; + margin-top: 0; +} +.tags { + overflow-y: auto; +} +.tag.active { + background: white; + color: #333; +} +.item { + margin: 40rpx 20rpx; + margin-top: 20rpx; + display: flex; + margin-left: 150rpx; + font-size: 24rpx; + color: #999; +} +.item image { + width: 160rpx; + height: 160rpx; + flex-shrink: 0; + display: block; + margin-right: 10rpx; + border-radius: 10rpx; +} +.item .textOver2 { + font-size: 30rpx; + color: #333; +} +.info-bottom { + display: flex; + justify-content: space-between; + align-items: center; +} +.info-bottom .info-btn { + width: 140rpx; + height: 40rpx; + background: #0F9095; + border-radius: 20rpx; + line-height: 40rpx; + text-align: center; + color: #fff; +} +.right-info { + flex: 1; +} +.info-bottom .info-btn.borderbtn { + background: white; + box-sizing: border-box; + border: 2rpx solid #0F9095; + color: #0F9095; + display: flex; + justify-content: center; + align-items: center; +} \ No newline at end of file diff --git a/pages/culture/info/index.js b/pages/culture/info/index.js new file mode 100644 index 0000000..37f3a63 --- /dev/null +++ b/pages/culture/info/index.js @@ -0,0 +1,121 @@ +// pages/info/activityInfo/index.js +import commonApi from "../../../utils/https/common" +let app = getApp() +Page({ + + /** + * 页面的初始数据 + */ + data: { + id:null, + info:null + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad: function (options) { + let id = options.id; + this.setData({ + id:id + }) + commonApi._post("pbservice/Culture/getCultureDetail",{ + id:id + }).then(res=>{ + this.setData({ + info:res.data + }) + this.BroswerRecord() + }) + }, + BroswerRecord:function(){ + setTimeout(()=>{ + if(app.globalData.uuid){ + commonApi._post('browse/browse_record',{ + type:"page", + title:this.data.info.name, + drive:"mini", + source_id:this.data.info.id, + url:"/pages/culture/info/index?id="+this.data.info.id, + uuid:app.globalData.uuid + }).then(res=>{ + }) + } + else { + this.BroswerRecord(); + } + },500) + }, + order:function(){ + let skuid = this.data.info.sku_id; + if(!skuid) return; + commonApi._post("product/get_sku_detail_by_id",{ + sku_id:skuid + }).then(res=>{ + if(!res.data){ + wx.showToast({ + title: '本活动不支持预约', + icon:'none' + }) + return; + } + app.globalData.couponInfo = null; + app.globalData.product = { + sku:res.data, + product:res.data.product + } + wx.navigateTo({ + url: '/pages/order/scene/index?type=museum', + }) + }) + }, + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady: function () { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow: function () { + + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide: function () { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload: function () { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh: function () { + + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom: function () { + + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage: function () { + + } +}) \ No newline at end of file diff --git a/pages/culture/info/index.json b/pages/culture/info/index.json new file mode 100644 index 0000000..35cf02f --- /dev/null +++ b/pages/culture/info/index.json @@ -0,0 +1,5 @@ +{ + "usingComponents": { + "title":"/pages/component/TitleHeader" + } +} \ No newline at end of file diff --git a/pages/culture/info/index.wxml b/pages/culture/info/index.wxml new file mode 100644 index 0000000..5b4855b --- /dev/null +++ b/pages/culture/info/index.wxml @@ -0,0 +1,26 @@ + + + + + + + {{info.name}} + + + 活动时间:{{info.begin_date}} ~ {{info.end_date}} + + + + 活动地点:{{info.detail_address}} + + + 本活动无需在线预约,可直接前往。更多详情请咨询活动主办方工作人员。 + 活动详情 + + + + + + 预约活动 + 活动已过期 + \ No newline at end of file diff --git a/pages/culture/info/index.wxss b/pages/culture/info/index.wxss new file mode 100644 index 0000000..a362b80 --- /dev/null +++ b/pages/culture/info/index.wxss @@ -0,0 +1,105 @@ +/* pages/info/activityInfo/index.wxss */ +.swiper ,.swiper image{ + width: 100%; + height: 330rpx; + display: block; +} +.top-box { + margin: 35rpx 0; + position: relative; + z-index: 1; + border-radius: 13rpx; + padding: 0 20rpx; +} +.top-box-title { + font-size: 31rpx; + color: #000; +} +.top-tip-box { + font-size: 24rpx; + color: #999; + display: flex; + align-items: center; + margin-top: 20rpx; +} +.top-tip-box image { + width: 29rpx; + height: 29rpx; + display: block; + margin-right: 25rpx; +} +.box-title { + font-weight: 500; + font-size: 35rpx; + color: #000; + margin: 0 20rpx; + margin-top: 50rpx; + padding-left: 17rpx; + line-height: 30rpx; + border-left: 6rpx solid #0F9095; +} +.box-content { + margin: 0 27rpx; + font-size: 25rpx; + color: #333; + margin-top: 34rpx; + display: block; +} +.box-tip { + margin: 0 27rpx; + color: #D62828; + margin-top: 50rpx; + font-size: 25rpx; + margin-bottom: 30rpx; +} +.time { + margin: 0 27rpx; + margin-bottom: 17rpx; + border: 1rpx solid #999; + border-radius: 10rpx; + color: #666; + font-size: 24rpx; + padding: 0 19rpx; + line-height: 73rpx; +} +.time.active { + border-color: #0B898E; + background: #0B898E; + color: #fff; +} +.bottom-fixed { + position: fixed; + width: 750rpx; + height: 104rpx; + background: #FFFFFF; + left: 0; + bottom: 0; + box-shadow: -1rpx 1rpx 16rpx 0px rgba(6, 0, 1, 0.1); + display: flex; + z-index: 1; + align-items: center; + justify-content: center; +} +.bottom-btn { + width: 391rpx; + line-height: 74rpx; + background: #D62828; + border-radius: 37rpx; + font-size: 31rpx; + font-weight: 500; + color: #fff; + text-align: center; +} +.bottom-btn.disable { + background: #ccc; +} +.tip-box { + background: #ECF6F7; + border-radius: 10rpx; + margin: 0 20rpx; + color: #0F9095; + font-size: 28rpx; + padding: 14rpx 20rpx; + font-weight: bold; + line-height: 42rpx; +} \ No newline at end of file diff --git a/pages/culture/infoindex.js b/pages/culture/infoindex.js new file mode 100644 index 0000000..c5573f2 --- /dev/null +++ b/pages/culture/infoindex.js @@ -0,0 +1,66 @@ +// pages/culture/infoindex.js +Page({ + + /** + * 页面的初始数据 + */ + data: { + + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad: function (options) { + + }, + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady: function () { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow: function () { + + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide: function () { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload: function () { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh: function () { + + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom: function () { + + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage: function () { + + } +}) \ No newline at end of file diff --git a/pages/culture/infoindex.json b/pages/culture/infoindex.json new file mode 100644 index 0000000..8835af0 --- /dev/null +++ b/pages/culture/infoindex.json @@ -0,0 +1,3 @@ +{ + "usingComponents": {} +} \ No newline at end of file diff --git a/pages/culture/infoindex.wxml b/pages/culture/infoindex.wxml new file mode 100644 index 0000000..183f63b --- /dev/null +++ b/pages/culture/infoindex.wxml @@ -0,0 +1,2 @@ + +pages/culture/infoindex.wxml diff --git a/pages/culture/infoindex.wxss b/pages/culture/infoindex.wxss new file mode 100644 index 0000000..0b05612 --- /dev/null +++ b/pages/culture/infoindex.wxss @@ -0,0 +1 @@ +/* pages/culture/infoindex.wxss */ \ No newline at end of file diff --git a/pages/index/index.js b/pages/index/index.js index f55dbcd..c1274db 100644 --- a/pages/index/index.js +++ b/pages/index/index.js @@ -22,7 +22,9 @@ Page({ date:"", list:[], listMore:true, - isTest:false + isTest:false, + lat:"", + lon:"" }, onLoad: function (options) { if(options.from){ @@ -30,7 +32,20 @@ Page({ } let systemInfo = wx.getSystemInfoSync(),rect = wx.getMenuButtonBoundingClientRect(); let height = (rect.top - systemInfo.statusBarHeight) * 2 + rect.height; - this.getList() + wx.getLocation({ + type: 'gcj02', + success:(res)=>{ + this.setData({ + lat:res.latitude, + lon:res.longitude + }) + this.getList() + }, + fail:(err)=>{ + this.getList() + } + }) + this.setData({ height:height, padHeight:systemInfo.statusBarHeight, @@ -223,7 +238,9 @@ Page({ if(!this.data.listMore) return; commonApi._post("search/recommend",{ offset:this.data.list.length, - limit:10 + limit:10, + lon:this.data.lon, + lat:this.data.lat }).then(res=>{ res.data.map(item=>{ if(item.ext.display_tags){ diff --git a/pages/info/activityInfo/index.js b/pages/info/activityInfo/index.js index 9fbc9d1..766af88 100644 --- a/pages/info/activityInfo/index.js +++ b/pages/info/activityInfo/index.js @@ -8,7 +8,8 @@ Page({ */ data: { id:null, - info:null + info:null, + retailId:"" }, /** @@ -19,6 +20,11 @@ Page({ this.setData({ id:id }) + if(options.retailId){ + this.setData({ + retailId:options.retailId + }) + } commonApi._post("pbservice/Actcalendar/getActDetail",{ id:id }).then(res=>{ @@ -64,6 +70,7 @@ Page({ sku:res.data, product:res.data.product } + app.globalData.retailId = this.data.retailId; wx.navigateTo({ url: '/pages/order/scene/index?type=museum', }) diff --git a/pages/info/activityInfo/index.wxml b/pages/info/activityInfo/index.wxml index 2bacd26..b65803a 100644 --- a/pages/info/activityInfo/index.wxml +++ b/pages/info/activityInfo/index.wxml @@ -27,19 +27,13 @@ 活动场次名称 2020/06/13 9:00:00至2020/06/13 12:00:00 --> 活动时间 - {{info.begin_date}} ~ {{info.end_date}} 活动详情 - - - + \ No newline at end of file diff --git a/pages/info/cardInfo/index.js b/pages/info/cardInfo/index.js index 1448ca5..edf0fe7 100644 --- a/pages/info/cardInfo/index.js +++ b/pages/info/cardInfo/index.js @@ -13,7 +13,8 @@ Page({ fixed:false, type:1, info:null, - top:0 + top:0, + retailId:"" }, /** @@ -29,6 +30,11 @@ Page({ util.back(); return; } + if(options.retailId){ + this.setData({ + retailId:options.retailId + }) + } let rect = wx.getMenuButtonBoundingClientRect(); let height = (rect.top - device.statusBarHeight) * 2 + rect.height + device.statusBarHeight; console.log(height) @@ -77,6 +83,7 @@ Page({ product:this.data.info, sku:this.data.info.sku[0] } + app.globalData.retailId = this.data.retailId; wx.navigateTo({ url: '/pages/order/card/index' }) diff --git a/pages/info/foodProductInfo/index.js b/pages/info/foodProductInfo/index.js index c97632d..ac39664 100644 --- a/pages/info/foodProductInfo/index.js +++ b/pages/info/foodProductInfo/index.js @@ -11,7 +11,8 @@ Page({ number:['一','二','三','四','五','六','七','八','九','十','十一','十二'], skuIndex:0, bookingInfo:null, - skuName:"" + skuName:"", + retailId:'' }, /** @@ -22,6 +23,11 @@ Page({ if(wx.getStorageSync("jstrip_token")){ api = commonApi.user_post } + if(options.retailId){ + this.setData({ + retailId:options.retailId + }) + } api("product/get_product_detail",{ id:options.id }).then(res=>{ @@ -85,6 +91,7 @@ Page({ }, order:function(e){ app.globalData.couponInfo = null; + app.globalData.retailId = this.data.retailId; app.globalData.product = e.currentTarget.dataset; wx.navigateTo({ url: '/pages/order/food/index', diff --git a/pages/info/hotelProductInfo/index.js b/pages/info/hotelProductInfo/index.js index cc43621..4ea113d 100644 --- a/pages/info/hotelProductInfo/index.js +++ b/pages/info/hotelProductInfo/index.js @@ -31,7 +31,8 @@ Page({ isTest:true, activeSkuIndex:-1, skuList:[], - roomInfo:null + roomInfo:null, + retailId:"" }, /** @@ -41,6 +42,11 @@ Page({ this.setData({ id:options.id }) + if(options.retailId){ + this.setData({ + retailId:options.retailId + }) + } commonApi._post("pbservice/Other/getClientConfig",{ unique_key:"wechatxcx" }).then(res=>{ @@ -148,8 +154,8 @@ Page({ item.sku_model.bed_type = item.bed_type; item.sku_model.breakfast=item.breakfast; item.sku_model.max_room_num = item.max_room_num; - console.log(item); app.globalData.product = item; + app.globalData.retailId = this.data.retailId; // return; app.globalData.couponInfo = null; wx.navigateTo({ diff --git a/pages/info/museumInfo/index.js b/pages/info/museumInfo/index.js index a460032..60a4de1 100644 --- a/pages/info/museumInfo/index.js +++ b/pages/info/museumInfo/index.js @@ -21,7 +21,8 @@ Page({ isLogin:false, product:null, time:null, - date:null + date:null, + retailId:"" }, /** @@ -31,6 +32,11 @@ Page({ this.setData({ id:options.id }) + if(options.retailId){ + this.setData({ + retailId:options.retailId + }) + } commonApi._post("scene/detail_for_venue",{ id:options.id }).then(res=>{ @@ -130,6 +136,7 @@ Page({ if(!this.data.info.product_venue) return; if(!this.data.info.product_venue.sku[0]) return; app.globalData.couponInfo = null; + app.globalData.retailId = this.data.retailId; // 如果在当前的详情页面选择了日期时间的话 那么需要修改日期时间 app.globalData.product = { product:this.data.info.product_venue, diff --git a/pages/info/postProductInfo/index.js b/pages/info/postProductInfo/index.js index 586e719..10d7791 100644 --- a/pages/info/postProductInfo/index.js +++ b/pages/info/postProductInfo/index.js @@ -18,7 +18,8 @@ Page({ info:null, skuFlag:null, producNum:1, - skuIndex:0 + skuIndex:0, + retailId:"" }, /** @@ -32,6 +33,11 @@ Page({ top:height, id:options.id }) + if(options.retailId){ + this.setData({ + retailId:options.retailId + }) + } commonApi._post("product/get_product_detail",{ id:options.id }).then(res=>{ @@ -193,6 +199,7 @@ Page({ productNum:this.data.producNum }]; app.globalData.postProduct = product; + app.globalData.retailId = this.data.retailId; wx.navigateTo({ url: '/pages/order/postOrder/index', }) diff --git a/pages/info/roadInfo/index.js b/pages/info/roadInfo/index.js index 1519e85..2b8e5cc 100644 --- a/pages/info/roadInfo/index.js +++ b/pages/info/roadInfo/index.js @@ -14,7 +14,8 @@ Page({ top:0, info:null, comment:[], - commentTotal:0 + commentTotal:0, + retailId:"" }, /** @@ -27,6 +28,11 @@ Page({ top:height, id:options.id }) + if(options.retailId){ + this.setData({ + retailId:options.retailId + }) + } let api = commonApi._post; if(wx.getStorageSync("jstrip_token")){ api = commonApi.user_post; @@ -141,6 +147,7 @@ Page({ app.globalData.product = { product:this.data.info } + app.globalData.retailId = this.data.retailId; wx.navigateTo({ url: '/pages/order/road/index?id='+this.data.info.id }) diff --git a/pages/info/sceneInfo/index.js b/pages/info/sceneInfo/index.js index a654f3a..ace7bb8 100644 --- a/pages/info/sceneInfo/index.js +++ b/pages/info/sceneInfo/index.js @@ -25,6 +25,7 @@ Page({ this.setData({ top:height }) + commonApi._post("scene/detail",{ id:options.id }).then(res=>{ diff --git a/pages/info/sceneProductInfo/index.js b/pages/info/sceneProductInfo/index.js index aca3ee6..67c88c4 100644 --- a/pages/info/sceneProductInfo/index.js +++ b/pages/info/sceneProductInfo/index.js @@ -15,7 +15,8 @@ Page({ isLike:0, comment:[], commentTotal:0, - isTest:true + isTest:true, + retailId:"" }, /** @@ -26,6 +27,11 @@ Page({ util.back() return; } + if(options.retailId){ + this.setData({ + retailId:options.retailId + }) + } commonApi._post("pbservice/Other/getClientConfig",{ unique_key:"wechatxcx" }).then(res=>{ @@ -157,6 +163,7 @@ Page({ }, order:function(e){ app.globalData.couponInfo = null; + app.globalData.retailId = this.data.retailId; // let sku = e.currentTarget.dataset.sku,product = e.currentTarget.dataset.product; app.globalData.product = e.currentTarget.dataset; wx.navigateTo({ diff --git a/pages/info/showInfo/index.js b/pages/info/showInfo/index.js index 6643dd4..ec51cf5 100644 --- a/pages/info/showInfo/index.js +++ b/pages/info/showInfo/index.js @@ -7,13 +7,19 @@ Page({ * 页面的初始数据 */ data: { - info:null + info:null, + retailId:'' }, /** * 生命周期函数--监听页面加载 */ onLoad: function (options) { + if(options.retailId){ + this.setData({ + retailId:options.retailId + }) + } commonApi.user_post('product/get_product_detail',{ id:options.id }).then(res=>{ @@ -50,6 +56,7 @@ Page({ }) return; } + app.globalData.retailId = this.data.retailId; app.globalData.couponInfo = null; app.globalData.product = this.data.info; wx.navigateTo({ diff --git a/pages/info/strategyInfo/index.js b/pages/info/strategyInfo/index.js index 3a9cdc5..f5a26f6 100644 --- a/pages/info/strategyInfo/index.js +++ b/pages/info/strategyInfo/index.js @@ -14,6 +14,7 @@ Page({ * 生命周期函数--监听页面加载 */ onLoad: function (options) { + commonApi.user_post("travels/getDetail",{ id:options.id }).then(res=>{ diff --git a/pages/order/card/index.js b/pages/order/card/index.js index 83a724b..4a009b7 100644 --- a/pages/order/card/index.js +++ b/pages/order/card/index.js @@ -180,6 +180,13 @@ Page({ fetch_type:this.data.type==0?'selffetch':'post' }] } + if(app.globalData.retailId){ + data.commission_code = app.globalData.retailId; + app.globalData.retailId = null; + } + if(app.globalData.from){ + data.system_name = app.globalData.from; + } commonApi.user_post("order/create",{ data:JSON.stringify(data) }).then(res=>{ diff --git a/pages/order/components/contact/index.js b/pages/order/components/contact/index.js index 20b5c7e..57937bf 100644 --- a/pages/order/components/contact/index.js +++ b/pages/order/components/contact/index.js @@ -206,7 +206,7 @@ Component({ wx.hideLoading() }, selectIt:function(e){ - let item = e.currentTarget.dataset.item,linkmanList = this.data.linkmanList,num = 0,traveller_limit_num = this.properties.maxNum!=-1?this.properties.maxNum:app.globalData.product.sku.sku_model.traveller_limit_num; + let item = e.currentTarget.dataset.item,linkmanList = this.data.linkmanList,num = 0,traveller_limit_num = this.properties.maxNum!=-1?this.properties.maxNum:(app.globalData.product.sku.sku_model?app.globalData.product.sku.sku_model.traveller_limit_num:-1); // 先计算出全部选中的出行人 linkmanList.map(linkman=>{ if(linkman.selected==1){ @@ -229,14 +229,14 @@ Component({ }) return; } - else if(this.properties.maxNum!=-1 && item.selected!=1 && num>=traveller_limit_num){ + else if(this.properties.maxNum!=-1 && item.selected!=1 && num>=traveller_limit_num && traveller_limit_num!=-1){ wx.showToast({ title: '最多只能选择'+this.properties.maxNum+"个出行人", icon:'none' }) return; } - else if(item.selected!=1 && traveller_limit_num!=0 && num>=traveller_limit_num){ + else if(item.selected!=1 && traveller_limit_num!=0 && num>=traveller_limit_num && traveller_limit_num!=-1){ wx.showToast({ title: '出行人限购'+traveller_limit_num+"份", icon:'none' diff --git a/pages/order/components/date/index.js b/pages/order/components/date/index.js index c0c9f78..0fb7ff5 100644 --- a/pages/order/components/date/index.js +++ b/pages/order/components/date/index.js @@ -154,7 +154,7 @@ Component({ if(this.data.activeDate.is_time_stock!=true) return; commonApi.user_post("product/product_timestock_price",{ date:this.data.activeDate.date, - sku_id:app.globalData.product.sku.id + sku_id:this.data.activeDate.sku_id?this.data.activeDate.sku_id:app.globalData.product.sku.id }).then(res=>{ let timeIndex = -1; if(app.globalData.product.infoTime){ diff --git a/pages/order/food/index.js b/pages/order/food/index.js index 18c0e6d..1b2b2df 100644 --- a/pages/order/food/index.js +++ b/pages/order/food/index.js @@ -110,6 +110,13 @@ Page({ source:"WECHATXCX", coupon_id:this.data.coupon?this.data.coupon.id:null }; + if(app.globalData.from){ + data.system_name = app.globalData.from; + } + if(app.globalData.retailId){ + data.commission_code = app.globalData.retailId; + app.globalData.retailId = null; + } commonApi.user_post("order/create",{ data:JSON.stringify(data) }).then(res=>{ diff --git a/pages/order/hotel/index.js b/pages/order/hotel/index.js index fdb4364..178230e 100644 --- a/pages/order/hotel/index.js +++ b/pages/order/hotel/index.js @@ -315,6 +315,13 @@ Page({ product_num:numberIndex }] } + if(app.globalData.from){ + data.system_name = app.globalData.from; + } + if(app.globalData.retailId){ + data.commission_code = app.globalData.retailId; + app.globalData.retailId = null; + } commonApi.user_post("order/create",{ data:JSON.stringify(data) }).then(res=>{ diff --git a/pages/order/movie/index.js b/pages/order/movie/index.js index 98bb663..761ff92 100644 --- a/pages/order/movie/index.js +++ b/pages/order/movie/index.js @@ -89,6 +89,13 @@ Page({ source:"WECHATXCX", coupon_id:this.data.coupon?this.data.coupon.id:null } + if(app.globalData.from){ + data.system_name = app.globalData.from; + } + if(app.globalData.retailId){ + data.commission_code = app.globalData.retailId; + app.globalData.retailId = null; + } commonApi.user_post("order/create",{ data:JSON.stringify(data) }).then(res=>{ diff --git a/pages/order/postOrder/index.js b/pages/order/postOrder/index.js index 8cd3897..2741014 100644 --- a/pages/order/postOrder/index.js +++ b/pages/order/postOrder/index.js @@ -133,6 +133,13 @@ Page({ gp_id:app.globalData.gp_id, team_id:app.globalData.team_id }; + if(app.globalData.from){ + data.system_name = app.globalData.from; + } + if(app.globalData.retailId){ + data.commission_code = app.globalData.retailId; + app.globalData.retailId = null; + } commonApi.user_post("order/create",{ data:JSON.stringify(data) }).then(res=>{ diff --git a/pages/order/roadOrder/index.js b/pages/order/roadOrder/index.js index b97b166..e458a9c 100644 --- a/pages/order/roadOrder/index.js +++ b/pages/order/roadOrder/index.js @@ -246,6 +246,13 @@ Page({ source:"WECHATXCX", remark:this.data.remark } + if(app.globalData.from){ + data.system_name = app.globalData.from; + } + if(app.globalData.retailId){ + data.commission_code = app.globalData.retailId; + app.globalData.retailId = null; + } commonApi.user_post("order/create",{ data:JSON.stringify(data) }).then(res=>{ diff --git a/pages/order/scene/index.js b/pages/order/scene/index.js index 4619ba7..59539b9 100644 --- a/pages/order/scene/index.js +++ b/pages/order/scene/index.js @@ -164,7 +164,7 @@ Page({ product_list: [{ type:product.product.type, product_id:product.product.id, - sku_id:product.sku.id, + sku_id:date.sku_id?date.sku_id:product.sku.id, start_time:time.start_time, end_time:time.end_time, use_date:date.date, @@ -176,6 +176,13 @@ Page({ gp_id:app.globalData.gp_id, team_id:app.globalData.team_id } + if(app.globalData.from){ + data.system_name = app.globalData.from; + } + if(app.globalData.retailId){ + data.commission_code = app.globalData.retailId; + app.globalData.retailId = null; + } commonApi.user_post("order/create",{ data:JSON.stringify(data) }).then(res=>{ diff --git a/pages/order/showOrder/index.js b/pages/order/showOrder/index.js index e4f0baf..e69b08a 100644 --- a/pages/order/showOrder/index.js +++ b/pages/order/showOrder/index.js @@ -54,6 +54,13 @@ Page({ "seats_ids":product.seats }] }; + if(app.globalData.from){ + data.system_name = app.globalData.from; + } + if(app.globalData.retailId){ + data.commission_code = app.globalData.retailId; + app.globalData.retailId = null; + } commonApi.user_post("order/create",{ data:JSON.stringify(data) }).then(res=>{ diff --git a/pages/user/retail/apply/index.js b/pages/user/retail/apply/index.js new file mode 100644 index 0000000..8a63a83 --- /dev/null +++ b/pages/user/retail/apply/index.js @@ -0,0 +1,129 @@ +// pages/user/retail/apply/index.js +import spreadApi from "../../../../utils/https/common" +import userApi from "../../../../utils/https/user" +Page({ + + /** + * 页面的初始数据 + */ + data: { + name:"", + phone:"", + idcard:"", + list:[], + index:-1, + nickName:"" + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad: function (options) { + userApi.user_post("user/getMyInfo",{}).then(res=>{ + spreadApi.user_post("commission/getMerchantList",{ + user_id:res.data.id + }).then(r=>{ + this.setData({ + list:r.data.rows, + user_id:res.data.id + }) + }) + }) + + }, + bindPickerChange:function(e){ + console.log(e) + this.setData({ + index:e.detail.value + }) + }, + apply:function(){ + spreadApi.user_post("commission/Register",{ + user_name:this.data.name, + mobile:this.data.phone, + id_card:this.data.idcard, + merchant_id:this.data.list[this.data.index].id, + user_id:this.data.user_id + }).then(res=>{ + if(res.code==1){ + wx.showToast({ + title: '申请成功', + icon:'success' + }) + setTimeout(()=>{ + wx.navigateBack() + },1000) + } + }) + // wx.redirectTo({ + // url: '../index', + // }) + }, + changeName:function(e){ + let name = e.detail.value; + this.setData({ + name:name + }) + }, + changeTel:function(e){ + let tel = e.detail.value; + this.setData({ + phone:tel + }) + }, + changeId:function(e){ + let id = e.detail.value; + this.setData({ + idcard:id + }) + }, + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady: function () { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow: function () { + + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide: function () { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload: function () { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh: function () { + + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom: function () { + + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage: function () { + + } +}) \ No newline at end of file diff --git a/pages/user/retail/apply/index.json b/pages/user/retail/apply/index.json new file mode 100644 index 0000000..35cf02f --- /dev/null +++ b/pages/user/retail/apply/index.json @@ -0,0 +1,5 @@ +{ + "usingComponents": { + "title":"/pages/component/TitleHeader" + } +} \ No newline at end of file diff --git a/pages/user/retail/apply/index.wxml b/pages/user/retail/apply/index.wxml new file mode 100644 index 0000000..5ce46ea --- /dev/null +++ b/pages/user/retail/apply/index.wxml @@ -0,0 +1,29 @@ + + + + + + 所属单位: + + + {{list[index].merchant_name}} + + + + + + + 姓名: + + + + 手机号: + + + + 身份证号: + + + 立即申请 + + \ No newline at end of file diff --git a/pages/user/retail/apply/index.wxss b/pages/user/retail/apply/index.wxss new file mode 100644 index 0000000..9666f80 --- /dev/null +++ b/pages/user/retail/apply/index.wxss @@ -0,0 +1,43 @@ +/* pages/user/retail/apply/index.wxss */ +.topbg { + height: 320rpx; + background: #0B898E; + position: absolute; + width: 900rpx; + border-bottom-left-radius: 130rpx; + border-bottom-right-radius: 130rpx; + left: 50%; + margin-left: -450rpx; + z-index: 0; +} +.content { + background: #FFFFFF; + border-radius: 20rpx; + margin: 0 30rpx; + margin-top:100rpx; + position: relative; + z-index: 1; + padding: 0 45rpx; +} +.line-item { + display: flex; + align-items: center; + height: 120rpx; + border-bottom: 1rpx solid #ccc; + font-size: 30rpx; + color: #333; +} +.left-item { + width: 200rpx; + text-align: left; +} +.apply-btn { + font-size: 30rpx; + color: #fff; + width: 360rpx; + line-height: 80rpx; + background: #0B898E; + border-radius: 40rpx; + text-align: center; + margin: 100rpx auto; +} \ No newline at end of file diff --git a/pages/user/retail/goods/index.js b/pages/user/retail/goods/index.js new file mode 100644 index 0000000..8491097 --- /dev/null +++ b/pages/user/retail/goods/index.js @@ -0,0 +1,168 @@ +// pages/user/retail/goods/index.js +import spreadApi from "../../../../utils/https/common" +Page({ + + /** + * 页面的初始数据 + */ + data: { + pageNo:1, + list:[], + isMore:true, + userid:"", + total:1, + commission_code:'' + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad: function (options) { + spreadApi.user_post("commission/getCommissionUser",{ + }).then(res=>{ + this.setData({ + userid:res.data.id, + commission_code:res.data.commission_code + }) + this.getList() + }) + }, + getList:function(){ + if(this.data.list.length>=this.data.total) return; + spreadApi.user_post("commission/getProductsByUserid",{ + page:this.data.pageNo, + user_id:this.data.userid + }).then(res=>{ + if(res.code==1){ + this.setData({ + pageNo:this.data.pageNo+1, + list:this.data.list.concat(res.data.rows), + total:res.data.total + }) + } + }) + }, + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady: function () { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow: function () { + + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide: function () { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload: function () { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh: function () { + + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom: function () { + this.getList() + }, + getUrl(item){ + switch(item.type){ + case "tenscenic": + return '/pages/info/foodInfo/index?id='+(item.scene_id || item.id); + break; + case "ticket": + // 产品 产品票务 + return '/pages/info/sceneProductInfo/index?id='+(item.scene_id || item.id); + break; + case "hotel": + // 产品 酒店 + return '/pages/info/hotelProductInfo/index?id='+(item.scene_id || item.id); + break; + case "post": + // 产品 产品发货的 + return '/pages/info/postProductInfo/index?id='+item.id; + break; + case "line": + // 产品 线路 + return '/pages/info/roadInfo/index?id='+item.id; + break; + case "coupon": + // 产品 卡券 + wx.navigateTo({ + url: '/pages/info/cardInfo/index?id='+item.id + }) + break; + case "show": + // 产品 演出 + return '/pages/info/showInfo/index?id='+item.id; + break; + case "food": + // 产品 美食 + return '/pages/info/foodProductInfo/index?id='+item.id; + break; + case "activity": + // 活动 + return '/pages/info/activityInfo/index?id='+item.act_calendar_id; + break; + case "movie": + // 产品 电影票 + return '/pages/list/movieticket/list/info/index?id='+item.third_id+'&title='+item.title; + break; + case "cinema": + // 产品 电影票 + return '/pages/list/movieticket/list/cinema/index?id='+item.third_id+'&title='+item.title; + break; + case "scenic": + // 场景 景点 + return '/pages/info/sceneProductInfo/index?id='+(item.scene_id || item.id); + break; + case "room": + // 场景 酒店 + return '/pages/info/hotelProductInfo/index?id='+(item.scene_id || item.id); + break; + case "venue": + // 场景 场馆 + return '/pages/info/museumInfo/index?id='+(item.scene_id || item.id); + break; + } + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage: function (e) { + if(e.from=='button'){ + let item = e.target.dataset.item; + return { + title: item.product.title, + path: this.getUrl(item.product)+'&retailId='+this.data.commission_code,  //分享页面地址 + imageUrl:item.product.headimg + } + } + else { + return { + title: "君到苏州", + path: '/pages/user/user',  //分享页面地址 + } + } + } +}) \ No newline at end of file diff --git a/pages/user/retail/goods/index.json b/pages/user/retail/goods/index.json new file mode 100644 index 0000000..35cf02f --- /dev/null +++ b/pages/user/retail/goods/index.json @@ -0,0 +1,5 @@ +{ + "usingComponents": { + "title":"/pages/component/TitleHeader" + } +} \ No newline at end of file diff --git a/pages/user/retail/goods/index.wxml b/pages/user/retail/goods/index.wxml new file mode 100644 index 0000000..4c1ffeb --- /dev/null +++ b/pages/user/retail/goods/index.wxml @@ -0,0 +1,11 @@ + + + + + + {{item.product.title}} + ¥{{item.product.price/100}} + 佣金:预计{{item.commission_price/100}}元 + + + \ No newline at end of file diff --git a/pages/user/retail/goods/index.wxss b/pages/user/retail/goods/index.wxss new file mode 100644 index 0000000..8f01208 --- /dev/null +++ b/pages/user/retail/goods/index.wxss @@ -0,0 +1,54 @@ +/* pages/user/retail/goods/index.wxss */ +.item { + display: flex; + align-items: center; + justify-content: space-between; + margin: 20rpx 30rpx; + background: white; + border-radius: 20rpx; + padding: 20rpx; +} +.item image { + width: 140rpx; + height: 140rpx; + border-radius: 10rpx; + display: block; + flex-shrink: 0; + margin-right: 20rpx; +} +.item-center { + flex: 1; + width: 300rpx; + font-size: 30rpx; +} +button.item-btn { + width: 140rpx !important; + line-height: 60rpx !important; + background: #0B898E; + border-radius: 30rpx !important; + font-size: 26rpx !important; + text-align: center !important; + font-weight: 500 !important; + flex-shrink: 0; + color: #fff; + padding: 0 !important; +} +.item-title { + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; +} +.item-price { + color: #D62828; + margin-top: 10rpx; + margin-bottom: 20rpx; +} +.item-price text { + font-size: 24rpx; + color: #333; + margin-left: 10rpx; +} +.item-money { + font-size: 24rpx; + color: #999; +} \ No newline at end of file diff --git a/pages/user/retail/index.js b/pages/user/retail/index.js new file mode 100644 index 0000000..f36f783 --- /dev/null +++ b/pages/user/retail/index.js @@ -0,0 +1,77 @@ +// pages/user/retail/index.js +import spreadApi from "../../../utils/https/common" +Page({ + + /** + * 页面的初始数据 + */ + data: { + info:null + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad: function (options) { + spreadApi.user_post("commission/getCommissionUser",{ + }).then(res=>{ + spreadApi.user_post("commission/getStatistics",{ + user_id:res.data.id + }).then(r=>{ + this.setData({ + info:r.data.rows + }) + }) + }) + + }, + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady: function () { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow: function () { + + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide: function () { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload: function () { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh: function () { + + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom: function () { + + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage: function () { + + } +}) \ No newline at end of file diff --git a/pages/user/retail/index.json b/pages/user/retail/index.json new file mode 100644 index 0000000..35cf02f --- /dev/null +++ b/pages/user/retail/index.json @@ -0,0 +1,5 @@ +{ + "usingComponents": { + "title":"/pages/component/TitleHeader" + } +} \ No newline at end of file diff --git a/pages/user/retail/index.wxml b/pages/user/retail/index.wxml new file mode 100644 index 0000000..d5a6218 --- /dev/null +++ b/pages/user/retail/index.wxml @@ -0,0 +1,23 @@ + + + + + 我的佣金 + {{info.total_collection/100}} + 0 + + + 我的粉丝数(人) + {{info.fans}} + + + 我的业绩(订单数) + + {{info.count?info.count:0}} + + + + 可分销产品 + + + \ No newline at end of file diff --git a/pages/user/retail/index.wxss b/pages/user/retail/index.wxss new file mode 100644 index 0000000..52d6d00 --- /dev/null +++ b/pages/user/retail/index.wxss @@ -0,0 +1,34 @@ +/* pages/user/retail/index.wxss */ +.top { + height: 300rpx; + color: #FFFFFF; + text-align: center; + display: flex; + flex-direction: column; + justify-content: center; + font-size: 30rpx; + font-weight: 500; + align-items: center; + background: #0B898E; +} +.money-all { + font-size: 60rpx; + margin-top: 40rpx; +} +.money-all::before { + content: "¥"; + font-size: 40rpx; +} +.line-item { + height: 120rpx; + display: flex; + align-items: center; + margin: 0 30rpx; + border-bottom: 1rpx solid #ccc; + font-size: 30rpx; + color: #333; + justify-content: space-between; +} +page { + background: white; +} \ No newline at end of file diff --git a/pages/user/retail/list/index.js b/pages/user/retail/list/index.js new file mode 100644 index 0000000..8b3fda6 --- /dev/null +++ b/pages/user/retail/list/index.js @@ -0,0 +1,96 @@ +// pages/user/retail/list/index.js +import spreadApi from "../../../../utils/https/common" +let app = getApp() +Page({ + + /** + * 页面的初始数据 + */ + data: { + month:null, + list:[], + status:{}, + page:1, + total:1 + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad: function (options) { + let month = options.month; + this.setData({ + month:month, + status:app.globalData.productState + }) + spreadApi.user_post("commission/getCommissionUser",{}).then(res=>{ + this.setData({ + user_id:res.data.id + }) + this.getList() + }) + }, + getList:function(){ + if(this.data.list.length>=this.data.total) return; + spreadApi.user_post("commission/getOrdersByMonth",{ + date:this.data.month, + user_id:this.data.user_id, + page:this.data.page + }).then(res=>{ + this.setData({ + list:res.data.rows, + total:res.data.total, + page:this.data.page+1 + }) + }) + }, + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady: function () { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow: function () { + + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide: function () { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload: function () { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh: function () { + + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom: function () { + this.getList() + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage: function () { + + } +}) \ No newline at end of file diff --git a/pages/user/retail/list/index.json b/pages/user/retail/list/index.json new file mode 100644 index 0000000..35cf02f --- /dev/null +++ b/pages/user/retail/list/index.json @@ -0,0 +1,5 @@ +{ + "usingComponents": { + "title":"/pages/component/TitleHeader" + } +} \ No newline at end of file diff --git a/pages/user/retail/list/index.wxml b/pages/user/retail/list/index.wxml new file mode 100644 index 0000000..b193d5b --- /dev/null +++ b/pages/user/retail/list/index.wxml @@ -0,0 +1,20 @@ + + + + + 订单编号:{{item.order_id}} + {{status[item.order_product[0].state]}} + + + 创建时间:{{item.create_time}} + 佣金:{{item.commission_price?item.commission_price/100:0}} + + + + {{product.product_title+product.sku_name}} + + {{product.paid_money?product.paid_money/100:0}} + x {{product.product_num}} + + + \ No newline at end of file diff --git a/pages/user/retail/list/index.wxss b/pages/user/retail/list/index.wxss new file mode 100644 index 0000000..ac80790 --- /dev/null +++ b/pages/user/retail/list/index.wxss @@ -0,0 +1,59 @@ +/* pages/user/retail/list/index.wxss */ +.item { + border-radius: 20rpx; + background: white; + margin: 20rpx 30rpx; + padding: 0 20rpx; +} +page { + background: #f2f2f2; +} +.top-tip { + display: flex; + align-items: center; + justify-content: space-between; + font-size: 24rpx; + color: #888888; + line-height: 40rpx; + padding-top: 10rpx; +} +.top-tip view { + color: #0B898E; + font-size: 30rpx; + font-weight: bold; +} +.item-info { + display: flex; + justify-content: space-between; + padding: 20rpx 0; + border-top: 1rpx solid #D8D8D8; + margin-top: 10rpx; +} +.item image { + width: 140rpx; + height: 140rpx; + border-radius: 10rpx; + display: block; + flex-shrink: 0; +} +.item-title { + flex: 1; + width: 300rpx; + font-size: 30rpx; + font-weight: 500; + margin: 0 20rpx; +} +.item-right { + flex-shrink: 0; + font-size: 26rpx; + color: #333; + text-align: right; +} +.item-right .price { + margin-bottom: 20rpx; +} +.price::before { + content: "¥"; + font-size: 24rpx; + margin-right: 6rpx; +} \ No newline at end of file diff --git a/pages/user/retail/order/index.js b/pages/user/retail/order/index.js new file mode 100644 index 0000000..cd2161a --- /dev/null +++ b/pages/user/retail/order/index.js @@ -0,0 +1,90 @@ +// pages/user/retail/order/index.js +import spreadApi from "../../../../utils/https/common" +Page({ + + /** + * 页面的初始数据 + */ + data: { + pageNo:1, + isMore:true, + list:[], + user_id:"", + total:1 + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad: function (options) { + spreadApi.user_post("commission/getCommissionUser",{}).then(res=>{ + this.setData({ + user_id:res.data.id + }) + this.getList() + }) + + }, + getList:function(){ + if(this.data.list.length>=this.data.total) return; + spreadApi.user_post("commission/getStatisticsByMonth",{ + page:this.data.pageNo, + user_id:this.data.user_id + }).then(res=>{ + this.setData({ + list:this.data.list.concat(res.data.rows), + total:res.data.total, + pageNo:this.data.pageNo+1 + }) + }) + }, + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady: function () { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow: function () { + + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide: function () { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload: function () { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh: function () { + + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom: function () { + this.getList() + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage: function () { + + } +}) \ No newline at end of file diff --git a/pages/user/retail/order/index.json b/pages/user/retail/order/index.json new file mode 100644 index 0000000..35cf02f --- /dev/null +++ b/pages/user/retail/order/index.json @@ -0,0 +1,5 @@ +{ + "usingComponents": { + "title":"/pages/component/TitleHeader" + } +} \ No newline at end of file diff --git a/pages/user/retail/order/index.wxml b/pages/user/retail/order/index.wxml new file mode 100644 index 0000000..8cd9241 --- /dev/null +++ b/pages/user/retail/order/index.wxml @@ -0,0 +1,21 @@ + + + + + {{item.c_month}} + {{item.is_withdraw==0?'未':'已'}}结算 + + + 订单数量 + {{item.count}} + + + 订单金额 + ¥{{item.total_collection?item.total_collection/100:0}} + + + 佣金金额 + ¥{{item.totle_price?item.totle_price/100:0}} + + 查看详情 > + \ No newline at end of file diff --git a/pages/user/retail/order/index.wxss b/pages/user/retail/order/index.wxss new file mode 100644 index 0000000..1f36210 --- /dev/null +++ b/pages/user/retail/order/index.wxss @@ -0,0 +1,38 @@ +/* pages/user/retail/order/index.wxss */ +.item { + border-radius: 20rpx; + background: white; + margin: 20rpx 30rpx; + padding: 0 20rpx; + color: #333333; + font-size: 26rpx; + line-height: 54rpx; +} +.item-top { + display: flex; + justify-content: space-between; + align-items: center; + height: 60rpx; + border-bottom: 1rpx solid #D8D8D8; + font-size: 30rpx; + font-weight: bold; + margin-bottom: 10rpx; +} +.item-top view { + color: rgba(11, 137, 142, 1); +} +page { + background: #f2f2f2; +} +.item-bottom { + border-top: 1rpx solid #D8D8D8; + line-height: 69rpx; + text-align: center; + font-weight: 500; + margin-top: 10rpx; +} +.line { + display: flex; + justify-content: space-between; + align-items: center; +} \ No newline at end of file diff --git a/pages/user/user.js b/pages/user/user.js index 3f249fb..d4dd12a 100644 --- a/pages/user/user.js +++ b/pages/user/user.js @@ -1,3 +1,4 @@ +import common from "../../utils/https/common"; // pages/user/user.js import userApi from "../../utils/https/user" Page({ @@ -20,7 +21,32 @@ Page({ }) }, - + retail:function(){ + common.user_post('commission/getCommissionUser',{}).then(res=>{ + if(res.code==0){ + wx.navigateTo({ + url: 'retail/apply/index', + }) + } + else if(res.data.status==0){ + wx.showToast({ + title: '正在审核中,请联系管理员', + icon:'none' + }) + } + else if(res.data.status==2){ + wx.showToast({ + title: '审核拒绝,请联系管理员', + icon:'none' + }) + } + else if(res.data.status==1){ + wx.navigateTo({ + url: 'retail/index', + }) + } + }) + }, /** * 生命周期函数--监听页面初次渲染完成 */ diff --git a/pages/user/user.wxml b/pages/user/user.wxml index b0930e7..8788415 100644 --- a/pages/user/user.wxml +++ b/pages/user/user.wxml @@ -54,9 +54,9 @@ 我的收藏 - + 实名认证 diff --git a/project.private.config.json b/project.private.config.json index 25c7c9a..98429e3 100644 --- a/project.private.config.json +++ b/project.private.config.json @@ -13,15 +13,15 @@ "miniprogram": { "list": [ { - "name": "pages/kj/info/index", - "pathName": "pages/kj/info/index", + "name": "pages/user/user", + "pathName": "pages/user/user", "query": "user_id=25&id=68&originate_id=109", "scene": null }, { - "name": "pages/kj/index", - "pathName": "pages/kj/index", - "query": "id=5", + "name": "pages/info/sceneProductInfo/index", + "pathName": "pages/info/sceneProductInfo/index", + "query": "id=5442&retailId=17020017459", "scene": null }, { diff --git a/utils/https.js b/utils/https.js index bec3577..ebfd83b 100644 --- a/utils/https.js +++ b/utils/https.js @@ -1,8 +1,8 @@ var app = getApp(); import util from "../utils/util" import userApi from "../utils/https/user.js"; -// const baseUrl = "https://test.api.cloud.sz-trip.com/api/"; -const baseUrl = "https://api.cloud.sz-trip.com/api/"; +const baseUrl = "https://test.api.cloud.sz-trip.com/api/"; +// const baseUrl = "https://api.cloud.sz-trip.com/api/"; const orders = ['','weight','distance','sale_number','sale_price','price']; //封装GET请求 function _get(url,data) {