Skip to content

Commit

Permalink
new visions
Browse files Browse the repository at this point in the history
  • Loading branch information
bothyan committed Oct 31, 2018
1 parent c7272da commit 503cc1d
Show file tree
Hide file tree
Showing 21 changed files with 347 additions and 12 deletions.
1 change: 1 addition & 0 deletions sh/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ App({
globalData:{
sh_token:wx.getStorageSync('sh_token') || "",
host:"https://ssl.zhihuishangjie.cn"
//host:"https://promotion-test.zhihuishangjie.cn"
},
shoreConfig:null,
urlMap:{},
Expand Down
7 changes: 5 additions & 2 deletions xfz/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ App({
xfz_token:"",
userInfo: null,
logingData:null,
host:"https://ssl.zhihuishangjie.cn",
host:"https://ssl.zhihuishangjie.cn"
//host:"https://promotion-test.zhihuishangjie.cn",
card:{}
},
urlMap:{},
Expand Down Expand Up @@ -198,7 +199,9 @@ App({
chargeList: host+"/app/user/balance/chargeList",
balancesummary: host+"/app/user/balance/summary",
orderList: host+"/app/user/pay/orderList",
paySummary: host+"/app/user/pay/summary"
paySummary: host+"/app/user/pay/summary",
shoreHome: host+"/app/user/store/home",
shoreList: host+"/app/user/store/list"
};
this.urlMap = urlMap;
},
Expand Down
15 changes: 15 additions & 0 deletions xfz/app.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
{
"pages":[
"pages/index/chooseMerchant",
"pages/index/index",
"pages/index/shoplist",
"pages/my/my",
"pages/my/card",
"pages/my/yue",
Expand All @@ -15,5 +17,18 @@
"navigationBarBackgroundColor": "#e06e27",
"navigationBarTitleText": "智慧商街",
"navigationBarTextStyle":"white"
},
"tabBar":{
"list":[{
"pagePath":"pages/index/index",
"iconPath":"images/nav/nav1.png",
"selectedIconPath":"images/nav/nav1_h.png",
"text":"首页"
},{
"pagePath":"pages/my/my",
"iconPath":"images/nav/nav2.png",
"selectedIconPath":"images/nav/nav2_h.png",
"text":"我的"
}]
}
}
Binary file added xfz/images/box.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added xfz/images/car.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added xfz/images/drinks.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added xfz/images/locaicon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added xfz/images/phoneicon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added xfz/images/smoke.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added xfz/images/temp/shops.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added xfz/images/temp/ssavtar.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added xfz/images/wifi.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 5 additions & 4 deletions xfz/pages/index/chooseMerchant.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Page({
if(options.scene){
wx.setStorageSync('xfzshopname', "");
app.globalData.scene = scene;
wx.navigateTo({
wx.switchTab({
url: '../my/my'
})
}else{
Expand All @@ -38,7 +38,7 @@ Page({
url: '../my/storedhistory'
})
}else{
wx.navigateTo({
wx.switchTab({
url: '../my/my'
})
}
Expand Down Expand Up @@ -80,8 +80,9 @@ Page({
app.getJson(app.urlMap.chooseMerchant,"post",{
merchantCode:code
},function(res){

if(res.data.code == 0){
wx.navigateTo({
wx.switchTab({
url: '../my/my'
})
}
Expand Down Expand Up @@ -117,7 +118,7 @@ Page({
if(data.needOpenCard){
app.globalData.logingData = Object.assign(app.globalData.logingData , data)
}
wx.navigateTo({
wx.switchTab({
url: '../my/my'
})
}
Expand Down
84 changes: 80 additions & 4 deletions xfz/pages/index/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,90 @@ const app = getApp()

Page({
data: {
indicatorDots: true,
autoplay: false,
interval: 5000,
duration: 1000,
message: null
},
onLoad: function (options) {

},
onLoad: function () {

onShow: function(){
var that = this;
var code = wx.getStorageSync('xfzshopcode') || "";
if(code == ""){
app.getJson(app.urlMap.shoreList,"get",{
},function(res){
if(res.data.code == 0){
wx.setStorageSync('xfzshopcode', res.data.data.list[0].storeCode);
that.getDetail();
}
});
}else{
that.getDetail();
}
},
getDetail:function(){
var that = this;
var code = wx.getStorageSync('xfzshopcode');
app.getJson(app.urlMap.shoreHome,"get",{
storeCode : code
},function(res){
if(res.data.code == 0){
var storeInfoVO = res.data.data.storeInfoVO;
if(!storeInfoVO){
storeInfoVO = {};
storeInfoVO.parking = "";
storeInfoVO.room = "";
storeInfoVO.freeDrinking = "";
storeInfoVO.smoking = "";
storeInfoVO.wifi = "";
}
storeInfoVO.parking = storeInfoVO.parking == "" ? "无" : "有";
storeInfoVO.room = storeInfoVO.room == "" ? "无" : "有";
storeInfoVO.freeDrinking = storeInfoVO.freeDrinking == "" ? "无" : "有";
storeInfoVO.smoking = storeInfoVO.smoking == "" ? "无" : "有";
if(storeInfoVO.wifi == ""){
storeInfoVO.wifi = "无"
}else{
storeInfoVO.wifiObj = JSON.parse(storeInfoVO.wifi)
storeInfoVO.wifi = "有"
}
res.data.data.storeInfoVO = storeInfoVO;
that.setData({
message:res.data.data
})
}
});
},
bindViewTap: function() {
toshops: function() {
wx.navigateTo({
url: '../logs/logs'
url: 'shoplist'
})
},
calling: function (e) {
var num = e.currentTarget.dataset.num;
   wx.makePhoneCall({
phoneNumber: num,
success: function () {
console.log("拨打电话成功!")
},
fail: function () {
console.log("拨打电话失败!")
}
})
},
copypassword: function(e){
var num = e.currentTarget.dataset.num;
   wx.setClipboardData({
data: num,
success: function () {
console.log("复制成功")
},
fail: function () {
console.log("复制失败")
}
})
}
})
2 changes: 1 addition & 1 deletion xfz/pages/index/index.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"navigationBarTitleText": "首页"
"navigationBarTitleText": "店铺首页"
}
50 changes: 49 additions & 1 deletion xfz/pages/index/index.wxml
Original file line number Diff line number Diff line change
@@ -1,3 +1,51 @@
<view class="container">

<swiper indicator-color="#fff" indicator-active-color="#f38200" indicator-dots="{{indicatorDots}}" autoplay="{{autoplay}}" interval="{{interval}}" duration="{{duration}}" class="banner">
<block wx:for="{{message.carrousel}}">
<swiper-item>
<image src="{{item}}" model="aspectFill" />
</swiper-item>
</block>
</swiper>
<view class="shopdes">
<view class="msg1">
<view class="ssavtar">
<image model="aspectFill" src="{{message.logo}}"/>
</view>
<view class="name">{{message.name}}</view>
<view class="mores" bindtap="toshops">更多></view>
</view>
<view class="msg2">
<view class="location"><image src="../../images/locationicon.png"/>{{message.address || "暂无地址"}}</view>
<image wx:if="{{message.phone}}" data-num="{{message.phone}}" class="phoneicon" bindtap="calling" src="../../images/phoneicon.png"/>
<image wx:else class="phoneicon grays" src="../../images/phoneicon.png"/>
</view>
</view>
<view class="model">
<view class="titlebox">
<image src="../../images/titleb.png" style="width:11rpx;height:29rpx;"></image>
<text>更多信息</text>
</view>
<view class="shebei">
<view class="sb-item">
<image style="width: 20rpx;height: 21rpx;" src="../../images/wifi.png"/>WIFI:{{message.storeInfoVO.wifi}}
</view>
<view class="sb-item">
<image style="width: 25rpx;height: 19rpx;" src="../../images/car.png"/>停车位:{{message.storeInfoVO.parking}}
</view>
<view class="sb-item">
<image style="width: 24rpx;height: 25rpx;" src="../../images/smoke.png"/>吸烟区:{{message.storeInfoVO.smoking}}
</view>
<view class="sb-item">
<image style="width: 22rpx;height: 23rpx;" src="../../images/box.png"/>包厢:{{message.storeInfoVO.room}}
</view>
<view class="sb-item">
<image style="width: 17rpx;height: 22rpx;" src="../../images/drinks.png"/>免费饮品:{{message.storeInfoVO.freeDrinking}}
</view>
</view>
<view class="wifis" wx:if="{{message.storeInfoVO.wifi == '有'}}">
<view class="wcode">WIFI账号:<text>{{message.storeInfoVO.wifiObj.wifi}}</text></view>
<view class="wpassword">WIFI密码:<text>{{message.storeInfoVO.wifiObj.password}}</text></view>
<view data-num="{{message.storeInfoVO.wifiObj.password}}" class="copy" bindtap="copypassword">复制密码</view>
</view>
</view>
</view>
130 changes: 130 additions & 0 deletions xfz/pages/index/index.wxss
Original file line number Diff line number Diff line change
@@ -0,0 +1,130 @@
/*滚动图*/

.banner{
width: 750rpx;
height: 498rpx;
background-color: #fff;
}

.banner image {
width: 750rpx;
height: 498rpx;
}
.shopdes{
height: 175rpx;
padding: 0 24rpx;
background: #fff;
position: relative;
z-index: 10;
border-bottom: 20rpx solid #f4f4f4;
}
.msg1{
display: flex;
flex-direction: row;
align-items: center;
height: 90rpx;
border-bottom: 2rpx solid #f2f2f2;
}
.ssavtar{
padding: 10rpx;
width: 120rpx;
height: 120rpx;
border-radius: 100%;
background: #fff;
margin-top: -50rpx;
}
.ssavtar image{
width: 120rpx;
height: 120rpx;
border-radius: 100%;
}
.shopdes .name{
color: #333333;
flex: 1;
font-size: 36rpx;
}
.shopdes .mores{
color: #ff9b1f;
font-size: 20rpx;
}
.msg2{
display: flex;
flex-direction: row;
align-items: center;
height: 83rpx;
}
.msg2 .location{
flex: 1;
color: #999999;
font-size: 24rpx;
display: flex;
align-items: center;
}
.msg2 .location image{
width: 26rpx;
height: 28rpx;
}
.msg2 .phoneicon{
width: 30rpx;
height: 31rpx;
}
.model{
background: #fff;
border-bottom: 20rpx solid #f4f4f4;
}
.titlebox{
height: 90rpx;
line-height: 90rpx;
display: flex;
align-items: center;
}
.titlebox text{
color: #333333;
font-size: 28rpx;
margin-left: 14rpx;
}
.shebei{
display: flex;
align-items: center;
flex-direction: row;
justify-content: space-between;
padding: 0 24rpx 20rpx;
flex-wrap: wrap;
}
.shebei .sb-item{
color: #333333;
display: flex;
align-items: center;
font-size: 24rpx;
}
.shebei .sb-item image{
margin-right: 5rpx;
}
.wifis{
padding: 20rpx 24rpx;
border-top: 2rpx solid #f2f2f2;
position: relative;
}
.wcode,.wpassword{
color: #333333;
font-size: 24rpx;
margin-bottom: 10rpx;
}
.wcode text,.wpassword text{
color: #999999;
}
.copy{
position: absolute;
width: 120rpx;
height: 30rpx;
text-align: center;
line-height: 30rpx;
color: #333333;
font-size: 24rpx;
right: 0;
bottom: 30rpx;
border: 2rpx solid #f2f2f2;
}



Loading

0 comments on commit 503cc1d

Please sign in to comment.