Commit ca2cdb22dc4fcb4e39996f1f16521aa76b97b516

Authored by wangfan
1 parent 16951c28

customer

... ... @@ -76,18 +76,19 @@ App({
async _getLiteOpenidByCode(code){
return new Promise((success,fail)=>{
wx.request({
url: uri_dc.HOST__LINE+'App.Wechat.GetLiteOpenidByCode',
url: uri_dc.HOST__LINE+'App.Reserve.GetLiteOpenid',
method: 'POST',
data: {code:code,appid:'wxd3dc4206c76f14fc'},
data: {code:code},
header: {
'content-type': 'application/x-www-form-urlencoded'
},
success: function (res) {
let openid=JSON.parse(res.data.data[0]).openid;
let openid=res.data.data.openid;
wx.setStorage({key:'openid',data:openid});
success(openid);
},
fail: function (res) {
console.log(res);
fail(res);
}
})
... ...
... ... @@ -5,7 +5,8 @@
"pages/book/b_add",
"pages/book/b_info",
"pages/book/b_desk",
"pages/customer/index"
"pages/customer/index",
"pages/customer/detail_owner"
],
"window": {
"backgroundTextStyle": "light",
... ...
Component({
properties:{
url:String,
openType:{
type: String,
value:'navigate',
},
},
data:{
},
methods:{
formSubmit: function(e) {
console.log('formids',e.detail.formId)
if("the formId is a mock one"!=e.detail.formId){
let formids=wx.getStorageSync('formids') || [];
formids.push(e.detail.formId);
formids=[...new Set(formids)];
wx.setStorage({key:'formids',data:formids});
}
this.triggerEvent("click");
if(this.data.url || this.data.openType!='navigate'){
let obj={url:this.data.url};
switch (this.data.openType){
case 'navigate':
wx.navigateTo(obj)
break;
case 'redirect':
wx.redirectTo(obj)
break;
case 'switchTab':
wx.switchTab(obj)
break;
case 'reLaunch':
wx.reLaunch(obj)
break;
case 'navigateBack':
wx.navigateBack(obj)
break;
case 'exit':
break;
}
}
},
},
attached(){
//console.log('this.data',this.data);
}
})
\ No newline at end of file
... ...
{
"component": true
}
\ No newline at end of file
... ...
<form bindsubmit="formSubmit" report-submit>
<button formType="submit" class="button-none">
<slot></slot>
</button>
</form>
... ...
/* component/cook-class/cook-class.wxss */
@import '../../app.wxss';
.button-none {
display: inline-block;
padding-left: 0;
padding-right: 0;
box-sizing: border-box;
font-size: inherit;
text-align: center;
text-decoration: none;
line-height: inherit;
-webkit-tap-highlight-color: transparent;
color: inherit;
}
\ No newline at end of file
... ...
// component/menu/addDelete.js
import util from '../../utils/util';
import App from '../../utils/api';
Component({
/**
* 组件的属性列表
*/
properties: {
// talkImage: {
// type: String, // 类型(必填),目前接受的类型包括:String, Number, Boolean, Object, Array, null(表示任意类型)
// value: '/pages/image/menu-fixed-taomei.png'
// },
},
/**
* 组件的初始数据
*/
data: {
},
attached(){
},
ready () {
},
detached(){
},
/**
* 组件的方法列表
*/
methods: {
getUserInfoSuccess(e){
if(e.type="getuserinfo"){
if(e.detail.errMsg=='getUserInfo:ok'){
var userInfo = e.detail.userInfo //avatarUrl nickName gender;
console.log('xxxxx',userInfo)
App.Reserve.AddUser({
openid: getApp().openid,
headerimg: userInfo.avatarUrl,
nickname: userInfo.nickName,
gender: userInfo.gender
})
this.triggerEvent("userinfo",userInfo);
}else if(e.detail.errMsg=='getUserInfo:fail auth deny'){
wx.showModal({
title:'授权提示',
content:'您点击了拒绝授权,将无法正常显示个人信息,点击确定重新获取授权',
confirmColor:'#199095',
cancelColor:'#999',
success:function(res){
if(res.confirm){
util.setting();
}
}
})
}
}
}
}
})
... ...
{
"component": true,
"usingComponents": {}
}
\ No newline at end of file
... ...
<button bindgetuserinfo="getUserInfoSuccess" open-type="getUserInfo" class="button-none">
<slot></slot>
</button>
\ No newline at end of file
... ...
.button-none {
display: inline-block;
padding-left: 0;
padding-right: 0;
box-sizing: border-box;
font-size: inherit;
text-align: center;
text-decoration: none;
line-height: inherit;
-webkit-tap-highlight-color: transparent;
color: inherit;
}
\ No newline at end of file
... ...
// pages/customer/detail_owner.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
... ...
{
"navigationBarBackgroundColor": "#ffffff",
"navigationBarTextStyle": "black",
"navigationBarTitleText":"订座详情"
}
\ No newline at end of file
... ...
<!--pages/customer/detail_owner.wxml-->
<text>pages/customer/detail_owner.wxml</text>
... ...
/* pages/customer/detail_owner.wxss */
page{
width: 94%;
margin: 0 3%;
}
\ No newline at end of file
... ...
... ... @@ -31,13 +31,11 @@ Page({
return;
}
let url = 'list';
if(opt.fromid){
App.Reserve.SetRelaOpenid({
id:opt.id,
openid:opt.openid,
fromid:opt.fromid?opt.fromid:''
})
}
App.Reserve.SetRelaOpenid({
id:opt.id,
openid:opt.openid,
fromid:opt.fromid?opt.fromid:''
})
if (opt.id > 0) {
App.Reserve.Detail({
openid: opt.openid,
... ... @@ -53,7 +51,9 @@ Page({
}
url+='?id='+opt.id
wx.redirectTo({url: url});
}).catch()
}).catch(res=>{
wx.redirectTo({url: url});
})
} else {
wx.redirectTo({url: url});
}
... ...
{
"navigationBarBackgroundColor": "#ffffff",
"navigationBarTextStyle": "black",
"navigationBarTitleText":"定个座儿",
"backgroundTextStyle": "light",
"navigationBarBackgroundColor": "#4c4e4f",
"navigationBarTextStyle": "white",
"usingComponents": {
"network": "/component/network/network"
"network": "/components/network/network"
}
}
\ No newline at end of file
... ...
... ... @@ -8,7 +8,7 @@
"newFeature": true
},
"compileType": "miniprogram",
"libVersion": "1.9.91",
"libVersion": "2.2.3",
"appid": "wxd3dc4206c76f14fc",
"projectname": "xcx-book",
"isGameTourist": false,
... ... @@ -21,12 +21,16 @@
"current": -1,
"list": []
},
"plugin": {
"current": -1,
"list": []
},
"game": {
"currentL": -1,
"list": []
},
"miniprogram": {
"current": 0,
"current": 6,
"list": [
{
"id": 0,
... ... @@ -63,6 +67,12 @@
"name": "时间选择",
"pathName": "pages/report/r_time",
"query": ""
},
{
"id": -1,
"name": "pages/customer/index",
"pathName": "pages/customer/index",
"query": "id=61"
}
]
}
... ...
... ... @@ -73,14 +73,16 @@ function rpc(host='',act,data={},fouce=false,header={},silence=true,cachetime=0,
success: function (res) {
console.log('request.api==>',host+cache_key+'\nrequest.success',res.data);
// return;
if(cachetime!=0 && res.data.ret==200 && res.data.data.length>0){
cache(cache_key,res.data,cachetime);//.then().catch();
}
if(res.data.ret!==200){
try{
res.data.msg=res.data.msg.replace('非法请求:','');
}catch(e){
console.log('res-fail',res,e);
if(res.data){
if(cachetime!=0 && res.data.ret==200 && res.data.data && res.data.data.length>0){
cache(cache_key,res.data,cachetime);//.then().catch();
}
if(res.data.ret!==200){
try{
res.data.msg=res.data.msg.replace('非法请求:','');
}catch(e){
console.log('res-fail',res,e);
}
}
}
success(res.data);
... ...
... ... @@ -15,6 +15,11 @@ export default {
//建立预定关系
'App.Reserve.SetRelaOpenid':{
cachetime:-1,
}
},
//增加顾客信息
'App.Reserve.AddUser':{
cachetime:-1,
},
}
\ No newline at end of file
... ...