Commit 3fce6e73e37eae19c1db68d8e0f6116d896fa349

Authored by wangfan
1 parent 4a40e479

customer

... ... @@ -8,7 +8,8 @@
"pages/customer/index",
"pages/customer/detail_owner",
"pages/customer/detail_customer",
"pages/customer/list"
"pages/customer/list",
"pages/customer/invite"
],
"window": {
"backgroundTextStyle": "light",
... ...
... ... @@ -87,5 +87,9 @@ Page({
}
})
},
userinfo(){
wx.navigateTo({
url:'invite?id='+this.id,
});
}
})
\ No newline at end of file
... ...
// pages/customer/invite.js
import util from '../../utils/util';
import App from '../../utils/api';
const {regeneratorRuntime} = global
Page({
/**
* 页面的初始数据
*/
data: {
detail:null,
},
id:null,
topicVal:'',
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
this.id=options.id;
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
App.Reserve.Detail({
openid: getApp().openid,
rid: this.id
}).then(res => {
this.setData({
detail:this.formatDatail(res.data)
})
})
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
return {
title: this.topicVal,
path: '/pages/customer/index?id='+this.id+'&fromid='+getApp().openid,
}
},
formatDatail(detail){
detail.rdateStr=util.unixtoTime(detail.rdate,'MM月DD日 WW HH:II');
detail.tableFirst=detail.tables[0].name;
if(detail.tables.length>1){
detail.tableSubInfo='等'+(detail.tables.length)+'个'
+(detail.tables[0].tid==2?'包间':'');
}
if(!detail.cusman){
detail.cusman='vking';
detail.cusman_phone='15877556369';
detail.cusman_account='wx:vking';
}
return detail;
},
topic(e){
let val=util.val(e);
this.topicVal=val.trim();
},
userinfo(){
console.log('this.topicVal',this.topicVal)
if (!this.topicVal) {
wx.showToast({
title: '请填写邀请主题',
icon: "none"
})
return;
}
if(this.data.detail.openid!=getApp().openid){
wx.showToast({
title: '只有发起人才能设置',
icon: "none"
})
return;
}
App.Reserve.SetTopicFromShare({
rid:this.id,
topic:this.topicVal
})
}
})
\ No newline at end of file
... ...
{
"navigationBarBackgroundColor": "#ffffff",
"navigationBarTextStyle": "black",
"navigationBarTitleText":"邀请详情",
"usingComponents": {
"userinfo": "/components/userinfo/userinfo"
}
}
\ No newline at end of file
... ...
<!--pages/customer/invite.wxml-->
<view class="page">
<view class="card">
<view class="top flex-vc">
<input bindinput="topic" bindconfirm="topic" value="{{detail.topic}}"
class="topic"
placeholder="点这里,填写你想说的话" class-placeholder="topic-placeholder"/>
</view>
<view class="bottom">
<view class="rdateStr Medium">{{detail.rdateStr}}</view>
<view class="seller flex-lr" bindtap="lookLocation">
<view class="seller-info">
<view class="name Medium">{{detail.seller.sellername}}</view>
<view class="addr">{{detail.seller.map_address}}</view>
</view>
</view>
</view>
</view>
<button class="share-but Regular" open-type="share">发送邀请</button>
</view>
... ...
/* pages/customer/invite.wxss */
.page{
width: 94%;
margin: 0 3%;
color:#353535;
}
.seller{
height: 84rpx;
margin-top: 28rpx;
}
.seller .avatar{
min-width: 60rpx;
width: 60rpx;
height: 60rpx;
background: #ccc;
}
.seller image{
width:100%;
height: 100%;
}
.seller .seller-info{
width: 60rpx;
height: 84rpx;
width:100%;
}
.seller .addr-icon{
min-width: 32rpx;
width: 32rpx;
height: 34rpx;
}
.seller .name{
font-size: 30rpx;
}
.seller .addr{
font-size: 26rpx;
color:#999999;
margin-top: 8rpx;
}
.hr{
border-top: 2rpx solid #F1F0F4;
}
.share-but{
margin-top: 128rpx;
color:#FEFEFE;
background: #262628;
width: 100%;
line-height: 80rpx;
font-size: 34rpx;
text-align: center;
}
.line-text{
border-top: 2rpx solid #F1F0F4;
position: relative;
text-align: center;
width:50%;
margin: 0 auto;
font-size: 26rpx;
}
.line-text .text{
position: absolute;
top:-16rpx;
width:100%;
}
.line-text .text view{
width:100rpx;
margin: 0 auto;
background-color: #fff;
}
.card{
margin-top: 62rpx;
border-radius: 10rpx;
box-shadow: 2rpx 2rpx 14rpx 6rpx rgba(231,228,228,.5);
}
.card .top{
min-height: 160rpx;
}
.card .bottom{
background-color: #EAECEE;
border-radius: 10rpx;
box-shadow: 2rpx 2rpx 14rpx 6rpx rgba(231,228,228,.5);
padding: 36rpx 46rpx 50rpx;
}
.card .bottom .rdateStr{
font-size: 30rpx;
}
.topic-placeholder,.topic{
height: 60rpx;
font-size: 44rpx;
font-weight: bold;
width:94%;
}
.topic-placeholder{
color:#999999
}
\ No newline at end of file
... ...
// pages/customer/list.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
... ...
{}
\ No newline at end of file
... ...
<!--pages/customer/list.wxml-->
<text>pages/customer/list.wxml</text>
... ...
/* pages/customer/list.wxss */
\ No newline at end of file
... ...
... ... @@ -30,7 +30,7 @@
"list": []
},
"miniprogram": {
"current": 6,
"current": 8,
"list": [
{
"id": 0,
... ... @@ -73,6 +73,18 @@
"name": "pages/customer/index",
"pathName": "pages/customer/index",
"query": "id=64"
},
{
"id": -1,
"name": "邀请设置页 pages/customer/invite",
"pathName": "pages/customer/invite",
"query": "id=64"
},
{
"id": -1,
"name": "邀请进入 pages/customer/index",
"pathName": "pages/customer/index",
"query": "id=64&fromid=test"
}
]
}
... ...
... ... @@ -22,4 +22,7 @@ export default {
cachetime:-1,
},
//邀请详情页面----设置分享信息
'App.Reserve.SetTopicFromShare':null,
}
\ No newline at end of file
... ...