Showing
11 changed files
with
188 additions
and
10 deletions
components/tips/showModal/showModal.js
0 → 100644
| 1 | +// components/showModal/showModal.js | ||
| 2 | +import util from '../../../utils/util' | ||
| 3 | +const properties={ | ||
| 4 | + cancelText:{type:String,value:''}, | ||
| 5 | + cancelColor:{type:String,value:'#000'}, | ||
| 6 | + confirmText:{type:String,value:'确认'}, | ||
| 7 | + confirmColor:{type:String,value:'#fff'}, | ||
| 8 | + header:{type:String,value:'确认信息'}, | ||
| 9 | + body:{type:String,value:'确认信息'}, | ||
| 10 | +}; | ||
| 11 | +Component({ | ||
| 12 | + options: { | ||
| 13 | + multipleSlots: true // 在组件定义时的选项中启用多slot支持 | ||
| 14 | + }, | ||
| 15 | + /** | ||
| 16 | + * 组件的属性列表 | ||
| 17 | + */ | ||
| 18 | + properties: properties, | ||
| 19 | + | ||
| 20 | + /** | ||
| 21 | + * 组件的初始数据 | ||
| 22 | + */ | ||
| 23 | + data: { | ||
| 24 | + hasShow:false, | ||
| 25 | + }, | ||
| 26 | + attached(){ | ||
| 27 | + let opt={}; | ||
| 28 | + Object.keys(properties).forEach((k)=>{ | ||
| 29 | + opt[k]=this.data[k] | ||
| 30 | + }) | ||
| 31 | + this.setData({ | ||
| 32 | + opt:opt | ||
| 33 | + }) | ||
| 34 | + }, | ||
| 35 | + /** | ||
| 36 | + * 组件的方法列表 | ||
| 37 | + */ | ||
| 38 | + methods: { | ||
| 39 | + options(obj){ | ||
| 40 | + let opt=this.data.opt; | ||
| 41 | + this.setData({ | ||
| 42 | + opt:{ | ||
| 43 | + ...opt, | ||
| 44 | + ...obj | ||
| 45 | + } | ||
| 46 | + }) | ||
| 47 | + return this; | ||
| 48 | + }, | ||
| 49 | + show(){ | ||
| 50 | + console.log(this.data.opt) | ||
| 51 | + this.setData({ | ||
| 52 | + hasShow:true, | ||
| 53 | + }) | ||
| 54 | + }, | ||
| 55 | + tapButton(e){ | ||
| 56 | + this.triggerEvent('showModal',{type:util.attr(e,'type')}) | ||
| 57 | + this.hide(); | ||
| 58 | + }, | ||
| 59 | + hide(){ | ||
| 60 | + this.setData({ | ||
| 61 | + hasShow:false, | ||
| 62 | + }) | ||
| 63 | + } | ||
| 64 | + } | ||
| 65 | +}) |
components/tips/showModal/showModal.json
0 → 100644
components/tips/showModal/showModal.wxml
0 → 100644
| 1 | +<!--components/showModal/showModal.wxml--> | ||
| 2 | +<view class="mask flex-vc" hidden="{{!hasShow}}"> | ||
| 3 | + <view class="showModal"> | ||
| 4 | + <view class="header"> | ||
| 5 | + {{opt.header}} | ||
| 6 | + </view> | ||
| 7 | + <view class="body"> | ||
| 8 | + {{opt.body}} | ||
| 9 | + <slot name="body"></slot> | ||
| 10 | + </view> | ||
| 11 | + <view class="footer flex-cc"> | ||
| 12 | + <button class="button-none cancel" plain wx:if="{{opt.cancelText}}" | ||
| 13 | + bindtap="tapButton" data-type="cancel" | ||
| 14 | + style="color:{{opt.cancelColor}};">{{opt.cancelText}}</button> | ||
| 15 | + <button class="button-none confirm bg-brown" plain | ||
| 16 | + bindtap="tapButton" data-type="confirm" | ||
| 17 | + style="color:{{opt.confirmColor}};">{{opt.confirmText}}</button> | ||
| 18 | + </view> | ||
| 19 | + </view> | ||
| 20 | +</view> |
components/tips/showModal/showModal.wxss
0 → 100644
| 1 | +/* components/showModal/showModal.wxss */ | ||
| 2 | +@import "../../../app.wxss"; | ||
| 3 | +.mask{ | ||
| 4 | + position: fixed; | ||
| 5 | + width: 100%; | ||
| 6 | + height: 100%; | ||
| 7 | + background-color: rgba(0,0,0,.5); | ||
| 8 | + top:0; | ||
| 9 | + left: 0; | ||
| 10 | +} | ||
| 11 | +.showModal{ | ||
| 12 | + width: 100%; | ||
| 13 | + background-color: #fff; | ||
| 14 | + padding: 60rpx 40rpx 0; | ||
| 15 | + position: fixed; | ||
| 16 | + bottom:0; | ||
| 17 | + height: 460rpx; | ||
| 18 | + box-sizing: border-box; | ||
| 19 | + border-radius: 20rpx 20rpx 0 0; | ||
| 20 | +} | ||
| 21 | +.showModal .header{ | ||
| 22 | + height:50rpx; | ||
| 23 | + font-size:36rpx; | ||
| 24 | + font-family:PingFangSC-Semibold,PingFangSC; | ||
| 25 | + font-weight:600; | ||
| 26 | + color:rgba(53,53,53,1); | ||
| 27 | + line-height:50rpx; | ||
| 28 | +} | ||
| 29 | +.showModal .body{ | ||
| 30 | + margin-top: 20rpx; | ||
| 31 | + height:80rpx; | ||
| 32 | + font-size:28rpx; | ||
| 33 | + font-family:PingFang-SC-Medium,PingFang-SC; | ||
| 34 | + font-weight:500; | ||
| 35 | + color:rgba(153,153,153,1); | ||
| 36 | + line-height:40rpx; | ||
| 37 | +} | ||
| 38 | +.footer{ | ||
| 39 | + height:80rpx; | ||
| 40 | + box-sizing: border-box; | ||
| 41 | + position: fixed; | ||
| 42 | + bottom: 80rpx; | ||
| 43 | + width: calc(100% - 80rpx); | ||
| 44 | +} | ||
| 45 | +.footer .button-none{ | ||
| 46 | + background:#C0A369; | ||
| 47 | + border-radius:10rpx; | ||
| 48 | + border-width: 0; | ||
| 49 | + height:80rpx; | ||
| 50 | + font-size:32rpx; | ||
| 51 | + font-family:PingFangSC-Semibold,PingFangSC; | ||
| 52 | + font-weight:600; | ||
| 53 | + color:rgba(255,255,255,1); | ||
| 54 | + line-height:80rpx; | ||
| 55 | + width: 320rpx; | ||
| 56 | +} | ||
| 57 | +.footer .button-none.confirm{ | ||
| 58 | +} | ||
| 59 | +.footer .button-none.cancel{ | ||
| 60 | +} |
| @@ -223,7 +223,10 @@ Page({ | @@ -223,7 +223,10 @@ Page({ | ||
| 223 | is_agree: 0, | 223 | is_agree: 0, |
| 224 | userinfo: userInfo | 224 | userinfo: userInfo |
| 225 | }).then(res => { | 225 | }).then(res => { |
| 226 | - this.getDetail(true); | 226 | + //this.getDetail(true); |
| 227 | + wx.switchTab({ | ||
| 228 | + url: '/pages/customer/list?hasRelaTip=1' | ||
| 229 | + }) | ||
| 227 | }) | 230 | }) |
| 228 | }, | 231 | }, |
| 229 | shareSetting(){ | 232 | shareSetting(){ |
| @@ -238,5 +241,10 @@ Page({ | @@ -238,5 +241,10 @@ Page({ | ||
| 238 | },'/pages/customer/index'), | 241 | },'/pages/customer/index'), |
| 239 | imageUrl: this.data.tpls[0].shareImage, | 242 | imageUrl: this.data.tpls[0].shareImage, |
| 240 | } | 243 | } |
| 241 | - } | 244 | + }, |
| 245 | + gotoHome(){ | ||
| 246 | + wx.switchTab({ | ||
| 247 | + url: '/pages/reserve/index' | ||
| 248 | + }) | ||
| 249 | + }, | ||
| 242 | }) | 250 | }) |
| @@ -11,12 +11,12 @@ | @@ -11,12 +11,12 @@ | ||
| 11 | </block> | 11 | </block> |
| 12 | </view> | 12 | </view> |
| 13 | </view> | 13 | </view> |
| 14 | -<view class="opt-button flex-vc"> | 14 | +<view class="opt-button flex-lr"> |
| 15 | + <view bindtap="gotoHome" class="dingbaojian flex-vc"> | ||
| 16 | + <image src="http://qn.colorcun.com/reserve/images/%E5%BE%AE%E4%BF%A1%E5%9B%BE%E7%89%87_20191114105901.png" class="icon"></image> | ||
| 17 | + <view class="text">订包间</view> | ||
| 18 | + </view> | ||
| 15 | <view class="opt flex-cc"> | 19 | <view class="opt flex-cc"> |
| 16 | - <view bindtap="gotoHome" class="dingbaojian flex-vc"> | ||
| 17 | - <image src="http://qn.colorcun.com/reserve/images/%E5%BE%AE%E4%BF%A1%E5%9B%BE%E7%89%87_20191114105901.png" class="icon"></image> | ||
| 18 | - <view class="text">订包间</view> | ||
| 19 | - </view> | ||
| 20 | <formids class="button-none flex-vc" bindclick="lookLocation"> | 20 | <formids class="button-none flex-vc" bindclick="lookLocation"> |
| 21 | <view class="opt-text flex-cc"> | 21 | <view class="opt-text flex-cc"> |
| 22 | <image class="buts-dh" src="http://qn.colorcun.com/manager-invitation/wx2/%E4%B8%80%E9%94%AE%E5%AF%BC%E8%88%AA.png"></image> | 22 | <image class="buts-dh" src="http://qn.colorcun.com/manager-invitation/wx2/%E4%B8%80%E9%94%AE%E5%AF%BC%E8%88%AA.png"></image> |
| @@ -20,9 +20,10 @@ Page({ | @@ -20,9 +20,10 @@ Page({ | ||
| 20 | tpls: TP.tpls(), | 20 | tpls: TP.tpls(), |
| 21 | /** | 21 | /** |
| 22 | * 生命周期函数--监听页面加载 | 22 | * 生命周期函数--监听页面加载 |
| 23 | + * hasRelaTip 从邀请函,接受邀请进入 | ||
| 23 | */ | 24 | */ |
| 24 | onLoad: function (options) { | 25 | onLoad: function (options) { |
| 25 | - | 26 | + this.options=options |
| 26 | }, | 27 | }, |
| 27 | 28 | ||
| 28 | /** | 29 | /** |
| @@ -36,6 +37,12 @@ Page({ | @@ -36,6 +37,12 @@ Page({ | ||
| 36 | * 生命周期函数--监听页面显示 | 37 | * 生命周期函数--监听页面显示 |
| 37 | */ | 38 | */ |
| 38 | onShow: function () { | 39 | onShow: function () { |
| 40 | + if(this.options.hasRelaTip){ | ||
| 41 | + this.selectComponent("#showModal").show({ | ||
| 42 | + | ||
| 43 | + }) | ||
| 44 | + this.options.hasRelaTip='' | ||
| 45 | + } | ||
| 39 | this.getListData(); | 46 | this.getListData(); |
| 40 | }, | 47 | }, |
| 41 | 48 |
| @@ -7,6 +7,7 @@ | @@ -7,6 +7,7 @@ | ||
| 7 | "userinfo-share": "/components/userinfo/share", | 7 | "userinfo-share": "/components/userinfo/share", |
| 8 | "formids":"/components/formids/formids", | 8 | "formids":"/components/formids/formids", |
| 9 | "nav":"/components/nav/nav", | 9 | "nav":"/components/nav/nav", |
| 10 | - "card":"/components/seller-card/seller-card" | 10 | + "card":"/components/seller-card/seller-card", |
| 11 | + "showModal":"/components/tips/showModal/showModal" | ||
| 11 | } | 12 | } |
| 12 | } | 13 | } |
| @@ -515,6 +515,13 @@ | @@ -515,6 +515,13 @@ | ||
| 515 | "pathName": "pages/customer/index", | 515 | "pathName": "pages/customer/index", |
| 516 | "query": "seller_id=80&seller_openid=oGefL4qKBWIh5xwyg3LVfkMbDumA&manager_id=763&rid=33354&act=tobook", | 516 | "query": "seller_id=80&seller_openid=oGefL4qKBWIh5xwyg3LVfkMbDumA&manager_id=763&rid=33354&act=tobook", |
| 517 | "scene": null | 517 | "scene": null |
| 518 | + }, | ||
| 519 | + { | ||
| 520 | + "id": -1, | ||
| 521 | + "name": "pages/customer/list", | ||
| 522 | + "pathName": "pages/customer/list", | ||
| 523 | + "query": "hasRelaTip=1", | ||
| 524 | + "scene": null | ||
| 518 | } | 525 | } |
| 519 | ] | 526 | ] |
| 520 | } | 527 | } |
-
Please register or login to post a comment