Browse Source

[c端][新增][商场信息]

tags/C.10.02
hurui 5 years ago
parent
commit
a9238434a8
12 changed files with 276 additions and 7 deletions
  1. +3
    -2
      app.json
  2. +3
    -1
      config/config.js
  3. +8
    -0
      index/user.js
  4. +5
    -0
      index/user.wxml
  5. +16
    -2
      index/user.wxss
  6. +4
    -0
      pages/integralmall/index.wxml
  7. +19
    -2
      pages/integralmall/index.wxss
  8. +62
    -0
      pages/mallInfo/mallInfo.js
  9. +8
    -0
      pages/mallInfo/mallInfo.json
  10. +28
    -0
      pages/mallInfo/mallInfo.wxml
  11. +94
    -0
      pages/mallInfo/mallInfo.wxss
  12. +26
    -0
      utils/util.js

+ 3
- 2
app.json View File

@@ -12,7 +12,7 @@
"pages/joinFrDpell/index",
"pages/spellDetail/index",
"pages/radetail/success/index",
"pages/spellTimeout/index",
"pages/spellTimeout/index",
"pages/spellGroup/mySpellGroup/index",
"pages/spellGroup/spellGroup",
"pages/complete/index",
@@ -60,7 +60,8 @@
"pages/externallinks/index",
"pages/czdetail/czdetail",
"pages/spellGroup/paySpellGroup/index",
"pages/integralmall/index"
"pages/integralmall/index",
"pages/mallInfo/mallInfo"
],
"navigateToMiniProgramAppIdList": [
"wx192b7d2e8dcbefd0",


+ 3
- 1
config/config.js View File

@@ -310,7 +310,9 @@ var config = {
//获取未支付的订单
getUnPaidOrder: "/order/getUnPaidOrder",
getCouponOrderByPassword:'/couponPassword/getCouponOrderByPassword',
getbuildingfloorlist:'/wxMallBuilding/getbuildingfloorlist'
getbuildingfloorlist:'/wxMallBuilding/getbuildingfloorlist',
//商场信息接口
getMallInfo: "/mall/mallInfo"
},
weapp: {
AppId: weappId


+ 8
- 0
index/user.js View File

@@ -68,6 +68,14 @@ Page({
url: '/pages/czdetail/czdetail',
})
},
/**
* 跳转到商场信息的页面
*/
gomallInfo: function () {
wx.navigateTo({
url: '/pages/mallInfo/mallInfo',
})
},
showVersion: function() {
/**
* 长按显示版本号


+ 5
- 0
index/user.wxml View File

@@ -146,4 +146,9 @@
<view class='of' wx:if="{{canIUse}}">
<official-account class="gzh"></official-account>
</view>
<view class='of1' bindtap='gomallInfo'>
<image class='img'></image>
<view>富茂链客好大一广场</view>
<view>></view>
</view>
</view>

+ 16
- 2
index/user.wxss View File

@@ -1,5 +1,6 @@
page{
overflow-y:visible!important;
/* overflow-y:visible!important; */
overflow: auto;
height: 100%!important;
background: #f6f6f6;
}
@@ -220,7 +221,20 @@ page{
overflow: hidden;
box-shadow: 0 6px 20px 0 rgba(0, 0, 0, 0.15);
}

.of1{
width: 90%;
margin: auto;
height: 160rpx;
background: #fff;
border-radius: 16rpx;
overflow: hidden;
box-shadow: 0 6px 20px 0 rgba(0, 0, 0, 0.15);
display: flex;
}
.of1 .img{
width:100rpx;
height: 100rpx;
}
.activeimg {
width: 200rpx !important;
position: absolute;


+ 4
- 0
pages/integralmall/index.wxml View File

@@ -41,6 +41,10 @@
<image src='{{nodata}}'></image>
<view class='no-data-text'>暂无数据</view>
</view>
<view class='sort'>
<view>我可换购</view>
<view>所需积分</view>
</view>
<view class='content' wx:if='{{lists.length>0}}'>
<view class='sepll-list' wx:for="{{lists}}" wx:key="{{index}}" data-couponId='{{item.couponId}}' data-id='{{item.id}}' bindtap='invite'>
<view class='spell-left'>


+ 19
- 2
pages/integralmall/index.wxss View File

@@ -1,9 +1,8 @@
/* pages/spellGroup/spellGroup.wxss */

.topbg {
margin-bottom: 30rpx;
/* margin-bottom: 20rpx; */
width:100%;
/* padding: 0 3%; */
height:234rpx;
background:linear-gradient(180deg,rgba(253,131,45,1) 0%,rgba(254,74,22,1) 100%);
}
@@ -466,4 +465,22 @@ button::after{ border: none; }
}
.remainInventory{
background: #ccc;
}
.sort{
width:100%;
height:90rpx;
background:#fff;
margin:0 auto 20rpx;
display: flex;
justify-content: space-between;
align-items: center;
}
.sort view{
height:60rpx;
width: 180rpx;
line-height: 60rpx;
color: #3C3C3C;
font-size: 28rpx;
text-align: center;
/* border-radius: 20rpx; */
}

+ 62
- 0
pages/mallInfo/mallInfo.js View File

@@ -0,0 +1,62 @@
// pages/mallInfo.js
const navigationBarHeight = (getApp().statusBarHeight + 44) + 'px';
var config = require("../../config/config.js");
var app = getApp();
const Http = require("../../utils/HttpBasics");
const imgurl = require("../../utils/imgurl");
const util = require("../../utils/util");
Page({
/**
* 页面的初始数据
*/
data: {
navigationBarHeight,
weekName:[],
times:[],
dateArr:[
{ name: "星期一", value: "0" },
{ name: "星期二", value: "1" },
{ name: "星期三", value: "2" },
{ name: "星期四", value: "3" },
{ name: "星期五", value: "4" },
{ name: "星期六", value: "5" },
{ name: "星期天", value: "6" }
],
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
let that = this;
console.log("渲染开始")
Http.get({
url: config.api.getMallInfo,
})
.then(res => {
console.log(res)
let businessHours = JSON.parse(res.data.businessHours)
businessHours.map((item,index)=>{
item.weekName = [that.data.dateArr.filter(e => e.value == item.week[0])[0].name, that.data.dateArr.filter(e => e.value == item.week[1])[0].name],
item.time = [util.fmtDate(item.time[0]), util.fmtDate(item.time[1])]
console.log(item.time)
})
console.log(businessHours,222)
that.setData({
name: res.data.name,
servicePhone: res.data.servicePhone,
img: res.data.img,
introduction: res.data.introduction,
parkingSpace: res.data.parkingSpace,
businessHoursH: businessHours,
})
})
.catch(err => {
wx.showModal({
title: '提示',
content: err.message,
showCancel: false
})
})
},
})

+ 8
- 0
pages/mallInfo/mallInfo.json View File

@@ -0,0 +1,8 @@
{
"navigationBarTitleText": "我的特权",
"navigationBarBackgroundColor": "#FD832D",
"navigationBarTextStyle": "white",
"usingComponents": {
"navbar": "../../components/navbar/navbar"
}
}

+ 28
- 0
pages/mallInfo/mallInfo.wxml View File

@@ -0,0 +1,28 @@
<!--pages/mallInfo.wxml-->
<!-- <button class='goback' bindtap='goback'><image src='{{wmhome}}' mode="widthFix"></image></button> -->
<navbar back home text="我的特权" background='#FD832D' color="#fff"></navbar>
<view style="margin-top:{{navigationBarHeight}}!important;" class='codeBox'>
<view class='code' >
<image class='icons' src="{{img}}" mode='widthFix'></image>
</view>
<view class='info'>
<view class='title'>{{name}}</view>
<text class='introduction'>{{introduction}}</text>
<view class='time'>
<text>营业时间 :</text>
<view class='' wx:for="{{businessHoursH}}" wx:key="index" >
<text>{{item.time}}({{item.weekName}})</text>
<!-- <text>{{item.times}}</text> -->
</view>
</view>
<view class='park'>
<text>停车位 :</text>
<text>{{parkingSpace}}</text>
</view>
<view class='phone'>
<text>热线电话 :</text>
<text>{{servicePhone}}</text>
</view>
</view>
</view>


+ 94
- 0
pages/mallInfo/mallInfo.wxss View File

@@ -0,0 +1,94 @@
/* pages/mallInfo.wxss */
@import "../../app.wxss";
page{
background:linear-gradient(180deg,#FD832D 0%,#FE4A16 100%);
}
.codeBox{
background:linear-gradient(180deg,#FD832D 0%,#FE4A16 100%);
height: 100%;
overflow: auto;
}
.none {
font-size: 24rpx;
text-align: center;
margin-top: 38rpx;
color: #FFFFFF;
float: none !important;
}

.fl {
float: left;
}

.fr {
float: right;
}

.goback {
position: fixed;
right: 50rpx;
bottom: 60rpx;
width: 100rpx !important;
height: 100rpx;
z-index: 100;
background: rgba(255, 255, 255, 1);
line-height: 95rpx;
border: 1rpx solid rgba(227, 227, 227, 1);
border-radius: 50%;
}

.goback image {
position: absolute;
width: 60rpx;
left: 0;
right: 0;
top: 0;
bottom: 0;
margin: auto;
}

.code {
width: 690rpx;
background: #fff;
margin: 20rpx auto;
border-radius: 10rpx;
padding-top: 20rpx;
padding-bottom: 20rpx;
}
.code image{
display:block;
margin: auto ;
}
.info{
width: 650rpx;
background: #fff;
margin: 20rpx auto;
border-radius: 10rpx;
padding: 20rpx;
}
.title{
margin: 20rpx 0;
text-align: center;
font-size: 50rpx;
}
.phone,.park,.introduction{
font-size: 30rpx;
line-height:40rpx;
margin: 20rpx 0;
}
.time{
margin: 20rpx 0;
font-size: 30rpx;
display: flex;
}
.times{
display: flex;
flex-direction: column;
margin-left: 10rpx;
}
.times text{
line-height: 40rpx;
}
.park > text:nth-child(2) ,.phone > text:nth-child(2){
margin-left: 10rpx;
}

+ 26
- 0
utils/util.js View File

@@ -4,6 +4,32 @@ var qrcode = require("./qrcode");
const extConfig = wx.getExtConfigSync ? wx.getExtConfigSync() : {}
let imgProxy = extConfig.attr.imgProxy;

function convertUTCTimeToLocalTime(UTCDateString) {
if (!UTCDateString) {
return '-';
}
function formatFunc(str) { //格式化显示
return str > 9 ? str : '0' + str
}
var date2 = new Date(UTCDateString); //这步是关键
var year = date2.getFullYear();
var mon = formatFunc(date2.getMonth() + 1);
var day = formatFunc(date2.getDate());
var hour = date2.getHours();
var noon = hour >= 12 ? 'PM' : 'AM';
hour = hour >= 12 ? hour - 12 : hour;
hour = formatFunc(hour);
var min = formatFunc(date2.getMinutes());
var dateStr = year + '-' + mon + '-' + day + ' ' + noon + ' ' + hour + ':' + min;
return dateStr;
}

function fmtDate(date) {
var dateee = new Date(date).toJSON();
return new Date(+new Date(dateee) + 8 * 3600 * 1000).toISOString().replace(/T/g, ' ').replace(/\.[\d]{3}Z/, '');
}


const formatTime = (date, fmt) => {
try {
if (!date) {


Loading…
Cancel
Save