Commit 0dec3699 authored by 罗超's avatar 罗超

提交餐厅信息

parent 06cb0f62
......@@ -390,75 +390,6 @@
"path": "index"
}]
},
//教育列表
{
"root": "pages/school",
"pages": [{
"path": "courseList"
},{
"path": "courseInfo"
},{
"path":"courseContent"
// "style": {
// "navigationStyle": "custom"
// }
},{
"path":"teacherDetails",
"style": {
"navigationStyle": "custom"
}
},{
"path":"articleList"
},{
"path":"articleDetails"
},{
"path":"commentPageList"
},{
"path":"course-submit"
},{
"path":"components/schoolDraw"
},{
"path":"personal/followTeacher"
},{
"path":"personal/studycard"
},{
"path":"personal/cardList"//学习卡中心
},{
"path":"mystudy/mystudy",
"style": {
"navigationStyle": "custom"
}
},{
"path":"mystudy/studyrecord",
"style": {
"navigationStyle": "custom"
}
},{
"path":"mystudy/orderStudy"
},{
"path":"personal/mycollection"
},{
"path":"personal/orderList"
},{
"path":"personal/orderDetail"
},{
"path":"personal/order-commit"//课程待评价
},{
"path":"personal/order-commit-details"//发表评论
},{
"path": "personal/payment-order"//课程代付
},{
"path":"investigation"
},{
"path":"Jiaheactivity"//甲鹤活动
},{
"path":"JIaheactivitydetails"//活动详情
},{
"path":"jieheactivityBM"//甲鹤活动报名
},{
"path":"personal/JhphoneRz"//电话认证
}]
},
//线下服务
{
"root": "pages/reserve",
......@@ -719,6 +650,13 @@
},{
"path" : "firstShop/list"
}] },
//餐厅
{
"root": "pages/restaurant",
"pages":[{
"path":"list"
}]
},
//酒店
{
"root": "pages/hotel",
......
......@@ -329,6 +329,21 @@
this.mainColor = this.$uiConfig.mainColor;
},
methods: {
goMap(name, lon, lat) {
wx.openLocation({
latitude:lat,
longitude:lon,
scale: 18,
name,
address:"武侯区科华中路 2 号",
success:(res)=>{
// console.log(res)
},
fail: (err) => {
// console.log(err)
}
})
},
openPicture(){
uni.navigateTo({
url:"/pages/hotel/picture"
......
......@@ -242,7 +242,7 @@
},
created() {
uni.navigateTo({
url:"/pages/hotel/order"
url:"/pages/hotel/detail"
})
uni.setNavigationBarTitle({
title: "酒店",
......
<template>
<view class="range-slider" :style="'width:' + width + 'rpx;height:' + height + 'rpx'">
<view class="range-bar" :style="'width:100%;height:' + barHeight + 'rpx'">
<view class="range-bar-bg" :style="'background-color:' + backgroundColor + ''"></view>
<view class="range-bar-progress" :style="'margin-left:' + progressBarLeft + 'rpx;width:' + progressBarWidth + 'rpx;background-color:' + activeColor + ''"></view>
</view>
<view
class="block"
:class="{ active: isMinActive }"
:style="'width:' + blockSize + 'rpx;height:' + blockSize + 'rpx;margin-left:' + minBlockLeft + 'rpx;'"
@touchstart="_onBlockTouchStart"
@touchmove.stop="_onBlockTouchMove"
@touchend="_onBlockTouchEnd"
:data-left="minBlockLeft"
data-tag="minBlock"
>
<slot name="minBlock"></slot>
</view>
<view
class="block"
:class="{ active: isMaxActive }"
:style="'width:' + blockSize + 'rpx;height:' + blockSize + 'rpx;margin-left:' + maxBlockLeft + 'rpx;'"
@touchstart="_onBlockTouchStart"
@touchmove.stop="_onBlockTouchMove"
@touchend="_onBlockTouchEnd"
:data-left="maxBlockLeft"
data-tag="maxBlock"
>
<slot name="maxBlock"></slot>
</view>
</view>
</template>
<script>
/**
* range-slider v1.0.6
*/
const _windowWidth = uni.getSystemInfoSync().windowWidth;
export default {
data() {
return {
isMinActive: false,
isMaxActive: false,
//#ifdef H5
MAX_LENGTH: 294,
maxBlockLeft: 300,
//#endif
// #ifndef H5
MAX_LENGTH: 700,
maxBlockLeft: 350,
// #endif
minBlockLeft: 0,
progressBarLeft: 0,
progressBarWidth: 350,
originalMinValue: 0,
originalMaxValue: 0
};
},
components: {},
props: {
//组件宽度
width: {
type: Number,
default: 750
},
//组件高度
height: {
type: Number,
default: 100
},
//滑块大小
blockSize: {
type: Number,
default: 50
},
//区间进度条高度
barHeight: {
type: Number,
default: 5
},
//背景条颜色
backgroundColor: {
type: String,
default: '#e9e9e9'
},
//已选择的颜色
activeColor: {
type: String,
default: '#1aad19'
},
//最小值
min: {
type: Number,
default: 0
},
//最大值
max: {
type: Number,
default: 100
},
//设置初始值
values: {
type: Array,
default: function() {
return [0, 100];
}
},
//步长值
step: {
type: Number,
default: 1
},
//live模式,是否动态更新
liveMode: {
type: Boolean,
default: true
}
},
created: function() {
//使用自定义组件编译模式时,支持生命周期为:created
this._refresh();
},
onLoad: function(option) {
//不使用自定义组件编译模式时,支持生命周期为:onload
this._refresh();
},
onUnload: function() {},
watch: {
//组件宽度
width: function(newVal, oldVal, changedPath) {
var that = this;
if (newVal != that.width) {
this._refresh();
}
},
//滑块大小
blockSize: function(newVal, oldVal, changedPath) {
var that = this;
if (newVal != that.blockSize) {
this._refresh();
}
},
//最小值
min: function(newVal, oldVal, changedPath) {
var that = this;
if (newVal != that.min) {
that._refresh();
}
},
//最大值
max: function(newVal, oldVal, changedPath) {
var that = this;
if (newVal != that.max) {
that._refresh();
}
},
//设置初始值
values: function(newVal, oldVal, changedPath) {
var that = this;
var values = that.values;
console.log('refresh', newVal, oldVal);
if (that._isValuesValid(newVal) && that._isValuesValid(values)) {
if (values[0] != oldVal[0] || values[1] != oldVal[1]) that._refresh();
}
}
},
methods: {
//补0
_pad: function(num, n) {
return Array(n - ('' + num).length + 1).join(0) + num;
},
_pxToRpx: function(px) {
return (750 * px) / _windowWidth;
},
_onBlockTouchStart: function(e) {
let tag = e.target.dataset.tag;
if (tag == 'minBlock' || tag == 'maxBlock') {
this.isMinActive = tag == 'minBlock';
this.isMaxActive = tag == 'maxBlock';
//兼容h5平台及某版本微信
if (e.hasOwnProperty('changedTouches')) {
this._blockDownX = e.changedTouches[0].pageX;
} else {
this._blockDownX = e.pageX;
}
//#ifdef H5
this._blockLeft = parseFloat(e.target.dataset.left);
//#endif
// #ifndef H5
this._blockLeft = e.target.dataset.left;
// #endif
this._curBlock = e.target.dataset.tag;
}
},
_onBlockTouchMove: function(e) {
let tag = e.target.dataset.tag;
if (tag == 'minBlock' || tag == 'maxBlock') {
var that = this;
var values = that._calculateValues(e);
that._refreshProgressBar(values[2], values[3]);
that._refreshBlock(values[2], values[3]);
//拖动时也触发事件
var eventDetail = {
minValue: this.formatNumber(values[0], this.step),
maxValue: this.formatNumber(values[1], this.step),
fromUser: true,
originalValue: {
minValue: values[0],
maxValue: values[1]
}
};
this.originalMinValue = values[0];
this.originalMaxValue = values[1];
var eventOption = {};
//
if (this.liveMode) that.$emit('rangechange', eventDetail, eventOption);
}
},
_onBlockTouchEnd: function(e) {
let tag = e.target.dataset.tag;
this.isMinActive = false;
this.isMaxActive = false;
if (tag == 'minBlock' || tag == 'maxBlock') {
var that = this;
var values = that._calculateValues(e.mp.changedTouches[0]);
that._refreshProgressBar(values[2], values[3]);
that._refreshBlock(values[2], values[3]);
var eventDetail = {
minValue: this.formatNumber(values[0], this.step),
maxValue: this.formatNumber(values[1], this.step),
fromUser: true,
originalValue: {
minValue: values[0],
maxValue: values[1]
}
};
this.originalMinValue = values[0];
this.originalMaxValue = values[1];
var eventOption = {};
that.$emit('rangechange', eventDetail, eventOption);
}
},
_isValuesValid: function(values) {
return values != null && values != undefined && values.length == 2;
},
/**
* 根据手势计算相关数据
*/
_calculateValues: function(e) {
var pageX = e.pageX;
//兼容h5平台
if (e.hasOwnProperty('changedTouches')) {
pageX = e.changedTouches[0].pageX;
}
var that = this;
var moveLength = pageX - that._blockDownX;
var left = that._blockLeft + that._pxToRpx(moveLength);
left = Math.max(0, left);
left = Math.min(left, that.MAX_LENGTH);
var minBlockLeft = that.minBlockLeft;
var maxBlockLeft = that.maxBlockLeft;
if (that._curBlock == 'minBlock') {
minBlockLeft = left;
} else {
maxBlockLeft = left;
}
var range = that.max - that.min;
var minLeft = Math.min(minBlockLeft, maxBlockLeft);
var maxLeft = Math.max(minBlockLeft, maxBlockLeft);
var minValue = (minLeft / that.MAX_LENGTH) * range + that.min;
var maxValue = (maxLeft / that.MAX_LENGTH) * range + that.min;
return [minValue, maxValue, minLeft, maxLeft];
},
/**
* 计算滑块坐标
*/
_calculateBlockLeft: function(minValue, maxValue) {
var that = this;
var blockSize = that.blockSize;
var range = that.max - that.min;
var minLeft = ((minValue - that.min) / range) * that.MAX_LENGTH;
var maxLeft = ((maxValue - that.min) / range) * that.MAX_LENGTH;
return [minLeft, maxLeft];
},
/**
* 刷新进度条视图
*/
_refreshProgressBar: function(minBlockLeft, maxBlockLeft) {
var that = this;
var blockSize = that.blockSize;
that.progressBarLeft = minBlockLeft + blockSize / 2;
that.progressBarWidth = Math.abs(maxBlockLeft - minBlockLeft);
},
/**
* 刷新滑块视图
*/
_refreshBlock: function(minBlockLeft, maxBlockLeft) {
var that = this;
that.minBlockLeft = minBlockLeft;
that.maxBlockLeft = maxBlockLeft;
},
/**
* 刷新整个视图
*/
_refresh: function() {
var that = this;
var MAX_LENGTH = that.width - that.blockSize;
that.MAX_LENGTH = MAX_LENGTH;
that.maxBlockLeft = MAX_LENGTH;
that.progressBarWidth = MAX_LENGTH;
var values = that.values;
if (this.originalMinValue && this.originalMinValue) {
values = [this.originalMinValue || values[0], this.originalMaxValue || values[1]];
}
if (that._isValuesValid(values)) {
values[0] = Math.max(that.min, values[0]);
values[0] = Math.min(values[0], that.max);
values[1] = Math.max(that.min, values[1]);
values[1] = Math.min(values[1], that.max);
var leftValues = that._calculateBlockLeft(values[0], values[1]);
that._refreshProgressBar(leftValues[0], leftValues[1]);
that._refreshBlock(leftValues[0], leftValues[1]);
}
},
formatNumber(num, step) {
//格式化数字,保留几位小数
let stepStr = '' + step;
let index = stepStr.indexOf('.');
let len = index > -1 ? stepStr.length - index - 1 : 0;
let offestNum = parseInt(1 + Array(('' + len).length + 1).join(0)) * 0.1;
let tmpNum = num * offestNum;
return ((parseInt(tmpNum / step + (step > 1 ? 1 : step) * 0.5) * step) / offestNum).toFixed(len);
}
}
};
</script>
<style>
.range-slider {
position: relative;
}
.range-bar {
position: absolute;
}
.range-bar {
position: absolute;
top: 50%;
transform: translate(0, -50%);
border-radius: 10000rpx;
}
.range-bar-bg {
position: absolute;
width: 100%;
height: 100%;
border-radius: 10000rpx;
}
.range-bar-progress {
position: absolute;
width: 100%;
height: 100%;
background-color: blueviolet;
}
.block {
position: absolute;
top: 50%;
transform: translate(0, -50%);
background: #fff;
border-radius: 50%;
box-shadow: 0rpx 0rpx 6rpx #ccc;
}
.block.active {
transform: translate(0, -50%) scale(1.5);
}
</style>
<template>
<view class="restaurant-list-item">
<view class="img-box">
<image src="https://dimg04.c-ctrip.com/images/03551120008nt5eb8BB53_C_500_500_Q80.jpg" mode="aspectFill"></image>
</view>
<view class="restaurant-info">
<view class="restaurant-name">北京街头卤煮火烧</view>
<view class="restaurant-start">
<view class="other-rate">
<text>老北京·地道</text>
<span class="line"></span>
</view>
</view>
<view class="localtion">环境内外装修以竹制品体现,夫妻肺片麻辣鲜香,口干嫩滑色泽红亮</view>
<view>
<u-tag text="川菜 " bg-color="#FFF" border-color="#DFBE6E" color="#DFBE6E" size="mini" style="margin-right: 20rpx;"></u-tag>
<u-tag text="沟口" bg-color="#FFF" border-color="#DFBE6E" color="#DFBE6E" size="mini"></u-tag>
</view>
<view class="price">
<text></text>
<text class="money">200</text>
<text>/起</text>
</view>
</view>
</view>
</template>
<script>
export default {
props:{
restaurantType:{
type:Number,
default:0
}
},
data() {
return {
key: value
}
},
}
</script>
<style>
.restaurant-list-item{
margin: 30rpx 30rpx 0 30rpx;
padding-bottom: 30rpx;
border-bottom: 1rpx solid #E2E2E2;
display: flex;
align-items: center;
}
.restaurant-list-item .img-box{
width: 220rpx;
height: 280rpx;
border-radius: 20rpx;
overflow: hidden;
margin-right: 30rpx;
}
.restaurant-list-item .img-box image{
width: 100%;
}
.restaurant-list-item .restaurant-info{
width: 1px;
flex: 1;
}
.restaurant-list-item .restaurant-info .restaurant-name{
font-weight: 500;
color: #111111;
line-height: 30rpx;
font-size: 30rpx;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.restaurant-list-item .restaurant-info .restaurant-start{
margin:10rpx 0;
}
.restaurant-list-item .restaurant-info .restaurant-start .rate{
font-size: 30rpx;
font-weight: 500;
color: #999999;
line-height: 30rpx;
}
.restaurant-list-item .restaurant-info .restaurant-start .other-rate{
display: inline-block;
position: relative;
}
.restaurant-list-item .restaurant-info .restaurant-start .other-rate text{
position: relative;z-index: 2;
font-size: 30rpx;
line-height: 30rpx;
font-weight: 500;
color: #111;
}
.restaurant-list-item .restaurant-info .restaurant-start .other-rate .line{
background-color: #DFBE6E;
height: 6px;
bottom: 2px;
left: 0;
right: 0;
position: absolute;
z-index: 1;
}
.restaurant-list-item .restaurant-info .localtion{
font-size: 24rpx;
font-weight: 400;
color: #999999;
line-height: 30rpx;
text-overflow: -o-ellipsis-lastline;
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
margin-bottom: 10rpx;
}
.restaurant-list-item .restaurant-info .price{
margin-top: 10rpx;
font-weight: 500;
color: #111;
font-size: 20rpx;
text-align: right;
}
.restaurant-list-item .restaurant-info .price .money{
font-size: 36rpx;
}
</style>
This diff is collapsed.
<style lang="scss" scoped>
.Jiaheactivitydetails{
width: 100%;
height: 100vh;
background: #FFF;
font-family: aa;
.box{
width: 100%;
position: relative;
}
.details-box-top-z{
width: 100%;
height: 3px;
}
.details-box-top-f{
width: 100%;
height: 3px;
background: #e2e2e2;
}
.details-box-t-positions{
height: 40rpx;
font-size: 20rpx;
color: #FFF;
background: #B7A264;
display: flex;
align-items: center;
padding: 0 26rpx;
border-top-right-radius: 6px;
border-bottom-left-radius: 6px;
position: absolute;
right: 0;
top: 0;
}
.details-b-center{
width: 100%;
display: flex;
margin-top: 40rpx;
}
.details-b-center-l{
width: 120rpx;
height: 120rpx;
display: flex;
flex-direction: column;
align-items: center;
justify-content: space-between;
}
.details-b-center-r{
width: 1px;
flex:1;
padding: 0 15px;
}
.details-b-title{
width: 100%;
font-size: 28rpx;
color: #111111;
font-weight: bold;
font-family: PingFang SC;
}
.details-b-time{
font-size: 22rpx;
color: #999999;
margin-top: 18rpx;
}
.addressStyle{
width: 690rpx;
height: 45px;
background: #FFFFFF;
box-shadow: 0px 3px 6px 0px rgba(139, 115, 64, 0.16);
border-radius: 6px;
font-size: 12px;
color: #999999;
display: flex;
padding: 0 15px;
align-items: center;
margin-top: 20px;
margin-left: 30rpx;
}
.addressStyle-r{
width: 1px;
flex:1;
overflow: hidden;
text-overflow:ellipsis;
white-space: nowrap;
}
.positionb{
width: 100%;
height: 120rpx;
position: fixed;
left: 0;
bottom: 0;
display: flex;
align-items: center;
justify-content: space-between;
padding: 0 15px;
background: #FFF;
}
.btnc{
width: 220rpx;
height: 80rpx;
border-radius: 4px;
display: flex;
align-items: center;
justify-content: center;
font-size: 14px;
color: #FFFFFF;
background: #CCCCCC;
}
}
</style>
<template>
<view class="Jiaheactivitydetails">
<view style="width: 100%;height: 450rpx;" @click="previewImage(detial.CoverImg)">
<image :src="detial.CoverImg" style="width: 100%;height: 100%;" mode="aspectFill"></image>
</view>
<view class="box">
<view v-if="detial.IsJoinActivity==0">
<view class="details-box-top-z" v-if="(detial.TotalMan- detial.JoinNum)>0" :style="{background:mainColor}"></view>
<view class="details-box-top-f" v-if="(detial.TotalMan- detial.JoinNum)==0" ></view>
<view class="details-box-t-positions" v-if="(detial.TotalMan- detial.JoinNum)>0 && detial.IsSignUp==1" :style="{background:mainColor}">
<text>{{(detial.TotalMan- detial.JoinNum)>=6?'可预约':(detial.TotalMan- detial.JoinNum)<6?'剩余'+(detial.TotalMan- detial.JoinNum)+'个空位':''}}</text>
</view>
<view class="details-box-t-positions" v-if="(detial.TotalMan- detial.JoinNum)==0" style="background:#e2e2e2;color: #999999;">
爆满
</view>
</view>
<view v-if="detial.IsJoinActivity==1">
<view class="details-box-top-f" style="background: #40766E;" ></view>
<view class="details-box-t-positions" :style="{background:'#40766E'}">
已报名
</view>
</view>
<view class="details-b-center">
<view class="details-b-center-l">
<view style="font-size: 28rpx;color: #999999;font-weight: 500;font-family: PingFang SC;">
{{detial.MonthStr}}
</view>
<view style="font-size: 50rpx;color: #1B1D1E;font-weight: 800;font-family: PingFang SC;">
{{detial.DayStr}}
</view>
<view style="font-size: 28rpx;color: #999999;font-weight: 500;font-family: PingFang SC;">
{{detial.WeekStr}}
</view>
</view>
<view style="width: 1px;background: #E2E2E2;height: 86px;"></view>
<view class="details-b-center-r">
<view class="details-b-title">
{{detial.ActivityName}}
</view>
<view class="details-b-time">
报名时间:{{detial.BMStart}}-{{detial.BMEnd}}
</view>
<view class="details-b-time">
活动时间:{{detial.HDStart}}-{{detial.HDEnd}}
</view>
<view class="details-b-time" >
<text v-if="detial.Distinguish==1">报名人数:{{detial.TotalMan}}</text>
<text v-if="detial.Distinguish==0">报名人数:男性{{detial.ManNum}}<text style="margin-left: 10px;">女性{{detial.WoManNum}}</text> </text>
</view>
<view class="details-b-time" v-if="detial.AgeLimit==0">
<text >年龄范围:{{detial.StartAge}}岁 ~ {{detial.EndAge}}</text>
</view>
<view class="details-b-time" v-if="detial.LnsideLimit==1">
<text>只针对甲鹤学员</text>
</view>
</view>
</view>
<view class="addressStyle" @click="goopenlocation(detial)">
<image src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/jiaheaddress.png" style="width: 12px;height: 15px;margin-right: 15px;"></image>
<view class="addressStyle-r">
{{detial.LocationName}}
</view>
</view>
<view style="width: 100%;padding: 15px;margin-bottom: 150rpx;">
<view class="acdetail_Intro" v-html="richtext"></view>
</view>
<view class="positionb">
<view :style="{color:pricecolor,'font-size':'40rpx'}">
<text v-if="detial.IsFree==1">免费</text>
<view v-if="detial.IsFree==2 && (detial.Price>0 || detial.PointNum>0)" style="display: flex;align-items: center;" >
<view style="display: flex;align-items: flex-end;">
<text v-if="detial.Price>0" style="font-size: 22rpx;margin-bottom: 6rpx;"></text>
<text v-if="detial.Price>0">{{detial.Price}}</text>
<text v-if="detial.Price>0" style="font-size: 22rpx;margin-bottom: 6rpx;"></text>
</view>
<text v-if="detial.Price>0 && detial.PointNum>0" style="font-size: 12px;margin: 0 5px;"></text>
<view style="display: flex;align-items: flex-end;">
<text v-if="detial.PointNum>0">{{detial.PointNum}}</text>
<text v-if="detial.PointNum>0" style="font-size: 22rpx;margin-bottom: 6rpx;"></text>
</view>
</view>
<!-- <view v-if="detial.IsFree==2 && detial.Price==0 && detial.PointNum>0" style="display: flex;align-items: flex-end;" >
<text>{{detial.PointNum}}</text>
<text style="font-size: 22rpx;"></text>
</view> -->
</view>
<view v-if="detial.IsJoinActivity==0">
<view class="btnc" v-if="detial.IsSignUp==1 && (detial.TotalMan- detial.JoinNum)>0" :style="{background:mainColor}" @click="gosignUp()">立即预约</view>
<view class="btnc" v-if="detial.IsSignUp==0 || (detial.TotalMan- detial.JoinNum)==0">不可预约</view>
</view>
<view v-if="detial.IsJoinActivity==1">
<view class="btnc" v-if="detial.IsSignUp==1">已报名</view>
</view>
</view>
</view>
</view>
</template>
<script>
export default{
data(){
return{
pageTitle: "活动详情",
mainColor:'',
pricecolor:'',
Id:0,
detial:{},
richtext:""
}
},
onLoad(options) {
if(options && options.Id){
this.Id = options.Id
}
this.GetActivityDetial()
},
created() {
this.mainColor = this.$uiConfig.mainColor;
this.pricecolor = this.$uiConfig.pricecolor;
uni.setNavigationBarTitle({
title: this.pageTitle,
});
},
methods:{
GetActivityDetial(){
this.request2({
url: '/api/AppletEducation/GetActivityDetial',
data: {Id:this.Id}
},
res => {
this.detial = res.data;
let tempRichtext=""
tempRichtext = this.detial.ActivityInfo.replace(/<img[^>]*>/gi, function(match, capture) {
var match = match.replace(/style=\"(.*)\"/gi,
'style="width:100% !important"');
return match;
});
this.richtext=tempRichtext
}
);
},
goopenlocation(x){
uni.openLocation({
address:x.LocationName,
latitude: Number(x.LonLat.split(',')[0]) ,
longitude: Number(x.LonLat.split(',')[1]),
success: function () {
console.log('success');
},
fail:function(err){
console.log(err)
}
});
},
gosignUp(){
let dataList = encodeURIComponent(JSON.stringify(this.detial))
uni.navigateTo({
url: '/pages/school/jieheactivityBM?details=' + dataList
})
},
previewImage(x){
uni.previewImage({
urls: [x],
current: 0,
});
}
}
}
</script>
This diff is collapsed.
<template>
<view class="articleDetails">
<view class="ad-box">
<view style="font-size: 21px;color: #1C1E1F;font-weight: bold;">{{article.Name}}</view>
<view class="ad-box-tx">
<u-avatar :src="article.TeacherLogo" size="60" v-if="article.TeacherLogo!=null && article.TeacherLogo!=''"></u-avatar>
<u-avatar :src="mall.setting.share_pic" size="60" v-if="article.TeacherLogo==null || article.TeacherLogo==''"></u-avatar>
<view class="ad-box-txr">
<text style="font-weight: bold;" v-if="article.TeacherName!=null && article.TeacherName!=''">{{article.TeacherName}}</text>
<text style="font-weight: bold;" v-if="article.TeacherName==null || article.TeacherName==''">{{mall.name!=null?mall.name:'无'}}</text>
<text style="font-size: 11px;color: #9A9A9A;">{{article.CreateDate}}</text>
</view>
</view>
<view style="padding-top: 15px;">
<h-parse :content="article.Describe" @navigate="clickDescription"></h-parse>
</view>
</view>
<view style="width: 100%;height: 15px;background: #F5F6F7;"></view>
<view class="tiaoti">
<view style="display: flex;flex-direction: row;align-items: center;">
<view class="tiaoti-l"></view>
<text style="font-size: 12px;color: #1C1E1F;margin-left: 5px;font-weight: bold;">{{count}}条留言</text>
</view>
<view style="display: flex;flex-direction: row;align-items: center;" v-if="count>5" @click="gocomList">
<text style="font-size: 13px;color: #909399;margin-right: 5px;">查看更多</text>
<u-icon name="arrow" size='24' color='#909399' ></u-icon>
</view>
</view>
<view style="margin-bottom: 60px;font-family: aa;">
<view class="comlist" v-for="(cx, ci) in commentList" :key="ci">
<view style="width: 100%;display: flex;flex-direction: row;align-items: center;justify-content: space-between;">
<view style="display: flex;flex-direction: row;align-items: center">
<u-avatar :src="cx.UserPhotoPath" size="50" ></u-avatar>
<text style="font-size: 13px;color: #121212;margin-left: 5px;width: calc(100vw - 165px);
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 1;
-webkit-box-orient: vertical;">{{cx.UserName}}</text>
</view>
<text style="font-size: 11px;color: #9A9A9A;">{{cx.CreateDate}}</text>
</view>
<view style="width: 100%;margin-top: 10px;font-size: 11px;color: #121212;line-height: 18px;">
{{cx.Content}}
</view>
<view class="comment-dao" style="flex-wrap: wrap;margin-top: 5px;" v-if="cx.CommentImgList.length>0">
<image
v-for="(item, index) in cx.CommentImgList" :key="index"
mode="aspectFill"
:src="item"
@click="previewImage2(index,cx.CommentImgList)"
:style="{'width':san,'height':san}"
/>
</view>
</view>
</view>
<view style="width: 100%;height: 40px;display: flex;align-items: center;justify-content: center;color: #5A5A5A;margin-bottom: 60px;" v-if="commentList.length==0">
暂无留言~
</view>
<view class="comment" v-if="article.IsComment==1">
<input type="text" v-model="commentMsg.Content" placeholder='留下您精彩的留言' class="commentinput" >
<view class="comment-pl" :style="{background:mainColor}" @click="addComment">留言</view>
</view>
<auth v-if="showAuth" @changeuserinfo="reloadUserinfo" @gbAuth="gbAuth"></auth>
</view>
</template>
<script>
import hParse from "@/components/u-parse/parse.vue";
import auth from "@/components/auth/index.vue";
export default {
components: {
auth,
hParse
},
data() {
return {
pageTitle:'详情',
g: [],
showAuth: false,
u: {},
mainColor: "",
pricecolor:'',
windowWidth:0,
ID:0,
article:{},
mall:{},
commentList:[],//留言列表
commentMsg:{
PlatformSource:1,
ArticleId:0,
Content:'',
CommentImgList:[],
},
san:'100px',
count:0,
};
},
mounted() {
this.mainColor = this.$uiConfig.mainColor;
this.pricecolor = this.$uiConfig.pricecolor;
this.windowWidth = this.$utils.SystemInfo().windowWidth;
this.mall = uni.getStorageSync("basedata")?uni.getStorageSync("basedata").mall:{};
uni.setNavigationBarTitle({
title: this.pageTitle,
});
},
onLoad(options) {
if(options && options.ID){
this.ID = options.ID;//资讯id
this.commentMsg.ArticleId = options.ID;
this.init();
this.getArticleCommentPageList()
}
let that = this
uni.getSystemInfo({
success(res) {
that.san = (res.windowWidth-20)/3+'px'
}
})
},
methods: {
init(){
this.request2({
url: '/api/AppletSchool/GetArticleModel',
data: {ID:this.ID}
},
res => {
this.loading = false;
this.isloading = false;
if (res.resultCode == 1) {
this.article= res.data;
this.article.CreateDate = this.article.CreateDate.replace('T',' ')
}
}
);
},
getArticleCommentPageList(){//留言列表
this.request2({
url: '/api/AppletSchool/GetArticleCommentPageList',
data: {pageIndex:1,pageSize:5,CommentGrade:0,ArticleId:this.ID}
},
res => {
this.commentList = res.data.pageData;
this.count = res.data.count;
}
);
},
addComment(){//新增留言
this.u = uni.getStorageSync("mall_UserInfo");
if (!this.u) {
this.u = {
nickName: "未登录",
avatarUrl: ""
};
this.showAuth = true;
} else{
this.request2({
url: '/api/AppletEducation/SetArticleCommentInfo',
data: this.commentMsg
},
res => {
uni.showToast({
title: res.message,
icon: 'none',
});
this.commentMsg.Content = '';
this.getArticleCommentPageList()//留言了之后调取留言列表
}
);
}
},
//图片预览
previewImage2(index, images) {
uni.previewImage({
urls: images,
current: index,
});
},
gocomList(){//跳转全部留言
uni.navigateTo({ url: "/pages/school/commentPageList?ID=" + this.ID });
},
clickDescription(e) {
console.log(e);
},
reloadUserinfo() {
this.u = uni.getStorageSync("mall_UserInfo");
},
//关闭登录窗口
gbAuth() {
this.showAuth = false;
},
},
};
</script>
<style>
.articleDetails{
width: 100%;
height: 100vh;
background: #FFF;
font-family: aa;
}
.articleDetails .ad-box{
width: 100%;
padding: 15px;
}
.articleDetails .ad-box-tx{
width: 100%;
display: flex;
flex-direction: row;
align-items: center;
margin-top: 25px;
}
.articleDetails .ad-box-txr{
margin-left: 10px;
width: calc(100vw - 70px);
height: 35px;
font-size: 13px;
color: #121212;
display: flex;
flex-direction: column;
justify-content: space-between;
}
.articleDetails .tiaoti{
width: 100%;
height: 35px;
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
padding: 0 12px;
}
.articleDetails .tiaoti-l{
width: 3px;
height: 14px;
background-image: linear-gradient(
to bottom,
#00D6A6,
#B5FFEE
);
}
.articleDetails .comment{
width: 100%;
height: 55px;
padding: 0 15px;
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
position: fixed;
left: 0;
bottom: 0;
background: #FFF;
}
.comment .comment-pl{
width: 56px;
height: 26px;
font-size: 13px;
color: #FFF;
display: flex;
align-items: center;
justify-content: center;
border-radius: 3px;
}
.articleDetails .commentinput{
width: calc(100vw - 120px);
height: 30px;
background: #F3FAF8;
border-radius: 15px;
font-size: 13px;
padding: 0 10px;
}
.articleDetails .comlist{
padding: 10px;
width: 100%;
}
.articleDetails .comment-dao{
width: 100%;
display: flex;
flex-direction: row;
align-items: center;
}
</style>
<template>
<view class="articleList">
<view v-if="g.length > 0" style="
height: calc(100vh);
width: 100%;
overflow: hidden;
">
<scroll-view :scroll-y="true" @scrolltolower="lower" :enable-back-to-top="true" :enable-flex="true"
style="height: 100%; padding-bottom: 10px;">
<view class="school-list">
<view class="good" v-for="(cx, ci) in g" :key="ci" @click="clickHandler(cx)">
<view class="good-r" :style="{'width': (windowWidth -15 - 125 -26)+'px'}">
<view class="good-name">
{{ cx.Name }}
</view>
<view class="good-r-b">
<text>浏览数{{cx.BrowseNum+cx.FictitiousBrowseNum}}</text>
<text style="margin-left: 10px;">{{cx.CommentNum}}留言</text>
</view>
</view>
<view class="good-img">
<image mode="aspectFill" :src="cx.ArticlePic" style="width: 100%; height: 100%;border-radius: 4px;" ></image>
</view>
</view>
</view>
<u-loadmore v-if="showLoading" :status="status" :load-text="loadText" :font-size="24" :margin-top="20"
:margin-bottom="20" bg-color="#FFF" />
</scroll-view>
</view>
<view v-if="!loading && g.length== 0 " style="
height: calc(100vh);
width: calc(100vw - 20px);
padding-top: 10px;
">
<u-empty text="没有找到资讯" font-size="36" mode="list" ></u-empty>
</view>
</view>
</template>
<script>
export default {
data() {
return {
pageTitle:'教育资讯',
status: "loadmore",
sortStatus: 1,
mainColor: "",
isover: false,
loading: true,
page: 1,
page_count: 1,
g: [],
loadText: {
loadmore: "轻轻上拉,加载更多",
loading: "努力加载中",
nomore: "没有更多资讯了",
},
showLoading: true,
sortShowType: 1,
coupon_id: 0,
msg: {
pageIndex: 1,
pageSize: 10,
},
windowWidth:0,
};
},
onLoad(option) {
this.mainColor = this.$uiConfig.mainColor;
this.windowWidth = this.$utils.SystemInfo().windowWidth;
uni.setNavigationBarTitle({
title: this.pageTitle,
});
},
mounted() {
this.init();
},
methods: {
init() {
this.isover = false;
this.loading = true;
this.request2({
url: '/api/AppletSchool/GetArticlePageList',
data: this.msg
},
res => {
this.loading = false;
this.isloading = false;
if (res.resultCode == 1) {
this.g = this.g.concat(res.data.pageData);
this.page_count = res.data.pageCount;
if (this.page_count == 1) {
this.isover = true;
this.status = "nomore";
} else {
this.status = "loadmore";
}
}
uni.hideNavigationBarLoading();
}
);
},
lower(e) {
if (this.msg.pageIndex < this.page_count) {
this.status = "loading";
this.msg.pageIndex++;
this.init();
} else {
this.isover = true;
this.status = "nomore";
}
},
clickHandler(item){
uni.navigateTo({ url: "/pages/school/articleDetails?ID=" + item.ID });
}
},
};
</script>
<style>
.articleList {
height: 100%;
background: #fff;
position: relative;
}
.articleList .quick {
right: 50rpx;
bottom: 50rpx;
position: absolute;
}
.articleList .quick .item {
background: #fff;
border: 1px solid #aaa;
height: 90rpx;
width: 90rpx;
color: #333;
border-radius: 90rpx;
margin-top: 40rpx;
display: flex;
align-items: center;
justify-content: center;
}
.articleList .sortbox {
display: flex;
background: #fff;
}
.articleList .sortbox .item {
height: 40px;
line-height: 40px;
flex: 1;
text-align: center;
}
.school-list .good{
background: #fff;
padding: 10px 13px;
display: flex;
flex-direction: row;
font-family: aa;
justify-content: space-between;
}
.school-list .good-img{
width: 125px;
height: 70px;
border-radius: 4px;
box-shadow:0 4px 10px 1px #D2D2D2;
}
.school-list .good-r{
display: flex;
flex-direction: column;
justify-content: space-between;
padding: 3px;
}
.school-list .good .good-name {
/* height: 37px; */
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
margin-bottom: 3px;
font-size: 14px;
color: #1B1D1E;
}
.school-list .good-r-b{
display: flex;
flex-direction: row;
align-items: center;
font-size: 11px;color: #9A9A9A;
}
</style>
<template>
<view class="commentPageList">
<view v-if="g.length > 0" style="
height: calc(100vh);
width: 100%;
overflow: hidden;
">
<scroll-view :scroll-y="true" @scrolltolower="lower" :enable-back-to-top="true" :enable-flex="true"
style="height: 100%; padding-bottom: 10px;">
<view style="font-family: aa;">
<view class="comlist" v-for="(cx, ci) in g" :key="ci">
<view style="width: 100%;display: flex;flex-direction: row;align-items: center;justify-content: space-between;">
<view style="display: flex;flex-direction: row;align-items: center">
<u-avatar :src="cx.UserPhotoPath" size="50" ></u-avatar>
<text style="font-size: 13px;color: #121212;margin-left: 5px;width: calc(100vw - 165px);
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 1;
-webkit-box-orient: vertical;">{{cx.UserName}}</text>
</view>
<text style="font-size: 11px;color: #9A9A9A;">{{cx.CreateDate}}</text>
</view>
<view style="width: 100%;margin-top: 15px;font-size: 11px;color: #121212;">
{{cx.Content}}
</view>
<view class="comment-dao" style="flex-wrap: wrap;margin-top: 5px;" v-if="cx.CommentImgList.length>0">
<image
v-for="(item, index) in cx.CommentImgList" :key="index"
mode="aspectFill"
:src="item"
@click="previewImage2(index,cx.CommentImgList)"
:style="{'width':san,'height':san}"
/>
</view>
</view>
</view>
<u-loadmore v-if="showLoading" :status="status" :load-text="loadText" :font-size="24" :margin-top="20"
:margin-bottom="20" bg-color="#FFF" />
</scroll-view>
</view>
<view v-if="!loading && g.length== 0 " style="
height: calc(100vh);
width: calc(100vw - 20px);
padding-top: 10px;
">
<u-empty text="没有找留言信息" font-size="36" mode="list" ></u-empty>
</view>
</view>
</template>
<script>
export default {
data() {
return {
pageTitle:'留言列表',
status: "loadmore",
mainColor: "",
isover: false,
loading: true,
page: 1,
page_count: 1,
g: [],
loadText: {
loadmore: "轻轻上拉,加载更多",
loading: "努力加载中",
nomore: "没有更多留言了",
},
showLoading: true,
sortShowType: 1,
coupon_id: 0,
msg: {
pageIndex: 1,
pageSize: 10,
CommentGrade:0,
ArticleId:0,
},
windowWidth:0,
san:'100px',
};
},
onLoad(options) {
this.mainColor = this.$uiConfig.mainColor;
this.windowWidth = this.$utils.SystemInfo().windowWidth;
this.san = (this.windowWidth-20)/3+'px';
console.log(this.san)
if(options && options.ID){
this.msg.ArticleId = options.ID;//资讯id
this.init();
}
uni.setNavigationBarTitle({
title: this.pageTitle,
});
},
mounted() {
},
methods: {
init() {
this.isover = false;
this.loading = true;
this.request2({
url: '/api/AppletSchool/GetArticleCommentPageList',
data: this.msg
},
res => {
this.loading = false;
this.isloading = false;
if (res.resultCode == 1) {
this.g = this.g.concat(res.data.pageData);
this.page_count = res.data.pageCount;
if (this.page_count == 1) {
this.isover = true;
this.status = "nomore";
} else {
this.status = "loadmore";
}
}
uni.hideNavigationBarLoading();
}
);
},
lower(e) {
if (this.msg.pageIndex < this.page_count) {
this.status = "loading";
this.msg.pageIndex++;
this.init();
} else {
this.isover = true;
this.status = "nomore";
}
},
//图片预览
previewImage2(index, images) {
uni.previewImage({
urls: images,
current: index,
});
},
},
};
</script>
<style>
.commentPageList {
height: 100%;
background: #fff;
position: relative;
}
.commentPageList .comlist{
padding: 10px;
width: 100%;
}
.commentPageList .comment-dao{
width: 100%;
display: flex;
flex-direction: row;
align-items: center;
}
</style>
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -4,8 +4,8 @@ export default {
// Vue.prototype.host2 = "http://192.168.0.110:8200"
// Vue.prototype.host2 = "https://mallApi.oytour.com"
// Vue.prototype.host2 = "http://192.168.1.5:8088"
Vue.prototype.host2 = "http://192.168.20.17:8014"
//Vue.prototype.host2 = "http://192.168.20.13:8088"
// Vue.prototype.host2 = "http://192.168.20.17:8014"
Vue.prototype.host2 = "http://192.168.20.24:8400"
// Vue.prototype.host2 = "http://testmall.oytour.com/"
Vue.prototype.host3 = "http://reborn.oytour.com"
// Vue.prototype.host3 = "http://192.168.20.24"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment