Commit 995c4ad1 authored by 潘永坪's avatar 潘永坪

产品选择页面开发

parent de77dc5e
......@@ -20,7 +20,7 @@ export default {
}
let path = options.path
uni.setStorageSync('enterOptions', options)
let token = uni.getStorageSync('token')
let token = uni.getStorageSync('token')||''
if (!token && path.indexOf('pages/payment/ourPayment/ourPayment') == -1) { //扫码支付页面不需要在此登录
setTimeout(() => { //解决关联普通二维码扫码首次进入时一直显示登录中
uni.navigateTo({
......@@ -136,4 +136,11 @@ export default {
/* -webkit-line-clamp: 2; */
-webkit-box-orient: vertical;
}
//设置checkbox背景色
checkbox.blue[checked] .wx-checkbox-input,
checkbox.blue.checked .uni-checkbox-input{
background-color: #3688FF !important;
border-color: #3688FF !important;
color: #ffffff !important;
}
</style>
MIT License
Copyright (c) 2020 www.uviewui.com
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
\ No newline at end of file
<p align="center">
<img alt="logo" src="https://uviewui.com/common/logo.png" width="120" height="120" style="margin-bottom: 10px;">
</p>
<h3 align="center" style="margin: 30px 0 30px;font-weight: bold;font-size:40px;">uView</h3>
<h3 align="center">多平台快速开发的UI框架</h3>
## 说明
uView UI,是[uni-app](https://uniapp.dcloud.io/)生态优秀的UI框架,全面的组件和便捷的工具会让您信手拈来,如鱼得水
## 特性
- 兼容安卓,iOS,微信小程序,H5,QQ小程序,百度小程序,支付宝小程序,头条小程序
- 60+精选组件,功能丰富,多端兼容,让您快速集成,开箱即用
- 众多贴心的JS利器,让您飞镖在手,召之即来,百步穿杨
- 众多的常用页面和布局,让您专注逻辑,事半功倍
- 详尽的文档支持,现代化的演示效果
- 按需引入,精简打包体积
## 安装
```bash
# npm方式安装
npm i uview-ui
```
## 快速上手
1. `main.js`引入uView库
```js
// main.js
import uView from 'uview-ui';
Vue.use(uView);
```
2. `App.vue`引入基础样式(注意style标签需声明scss属性支持)
```css
/* App.vue */
<style lang="scss">
@import "uview-ui/index.scss";
</style>
```
3. `uni.scss`引入全局scss变量文件
```css
/* uni.scss */
@import "uview-ui/theme.scss";
```
4. `pages.json`配置easycom规则(按需引入)
```js
// pages.json
{
"easycom": {
// npm安装的方式不需要前面的"@/",下载安装的方式需要"@/"
// npm安装方式
"^u-(.*)": "uview-ui/components/u-$1/u-$1.vue"
// 下载安装方式
// "^u-(.*)": "@/uview-ui/components/u-$1/u-$1.vue"
},
// 此为本身已有的内容
"pages": [
// ......
]
}
```
请通过[快速上手](https://uviewui.com/components/quickstart.html)了解更详细的内容
## 使用方法
配置easycom规则后,自动按需引入,无需`import`组件,直接引用即可。
```html
<template>
<u-button>按钮</u-button>
</template>
```
请通过[快速上手](https://uviewui.com/components/quickstart.html)了解更详细的内容
## 链接
- [官方文档](https://uviewui.com/)
- [更新日志](https://uviewui.com/components/changelog.html)
- [升级指南](https://uviewui.com/components/changelog.html)
- [关于我们](https://uviewui.com/cooperation/about.html)
## 预览
您可以通过**微信**扫码,查看最佳的演示效果。
<br>
<br>
<img src="https://uviewui.com/common/weixin_mini_qrcode.png" width="220" height="220" >
<!-- ## 捐赠uView的研发
uView文档和源码全部开源免费,如果您认为uView帮到了您的开发工作,您可以捐赠uView的研发工作,捐赠无门槛,哪怕是一杯可乐也好(相信这比打赏主播更有意义)。
<img src="https://uviewui.com/common/wechat.png" width="220" >
<img style="margin-left: 100px;" src="https://uviewui.com/common/alipay.png" width="220" >
-->
## 版权信息
uView遵循[MIT](https://en.wikipedia.org/wiki/MIT_License)开源协议,意味着您无需支付任何费用,也无需授权,即可将uView应用到您的产品中。
<template>
<!-- 客服 -->
<u-popup v-model="showPop" mode="bottom" border-radius="14" closeable >
<view class="wrap">
<view class="title">
客服电话
</view>
<view class="middle">
<view class="list" v-for="(item,index) in scenicList" :key='index' @click="makePhone(item.phone)">
<text>
{{item.name}}:
</text>
<text>
{{item.phone}}
</text>
</view>
</view>
</view>
</u-popup>
</template>
<script>
export default{
props:['scenicList'],
data(){
return{
showPop:false,//控制弹窗显示隐藏
}
},
methods:{
//---拨打电话
makePhone(phoneNumber){
uni.makePhoneCall({
phoneNumber
})
}
}
}
</script>
<style scoped lang="scss">
.title{
text-align: center;
font-size: 32rpx;
font-weight: bold;
padding: 30rpx 0;
position:fixed;
top: 0;
width: 100%;
background: #fff;
z-index: 1;
}
.middle{
padding-top: 100rpx;
}
.list{
height:100rpx;
border-bottom: 1px solid #E6E6E6;
padding: 0 24rpx;
display: flex;
align-items: center;
justify-content: space-between;
}
.wrap{
overflow-y: auto;
position: relative;
}
@media only screen and (max-height: 900px) {
.wrap{
max-height: 750px;
}
}
@media only screen and (max-height: 750px) {
.wrap{
max-height: 600px;
}
}
@media only screen and (max-height: 600px) {
.wrap{
max-height: 500px;
}
}
</style>
\ No newline at end of file
<template>
<!-- 商家详情弹窗 -->
<u-popup v-model="showPop" mode="bottom" border-radius="14" closeable >
<view class="buy-wrap">
<view class="head">
{{detailData.name}}
</view>
<view style="padding-top: 100rpx;">
<u-swiper :list="detailData.imgList" mode="number" height="350" name="url"></u-swiper>
</view>
<view class="middle">
<!-- 景区介绍 -->
<view class="introduce">
<view class="middle-title">
介绍
</view>
<view v-html="detailData.introduce">
</view>
<view class="middle-title" style="margin-top: 20rpx;">
用时参考
</view>
<view>
建议游玩时长:{{detailData.timeSpent}}
</view>
</view>
<!-- 开放时间 -->
<view class="opentime">
<view class="middle-title">开放时间</view>
<u-table border-color="#04a7f4" >
<u-tr v-if="!times">
<u-td>每天</u-td>
</u-tr>
<u-tr v-if="!times">
<u-td>
{{detailData.businessStart?detailData.businessStart.substr(0,5):""}}
~{{detailData.businessEnd?detailData.businessEnd.substr(0,5):""}}
</u-td>
</u-tr>
<u-tr v-if="times">
<u-td colspan="2">开放时间</u-td>
</u-tr>
<u-tr v-for="(item,index) of times" :key="index" v-if="times">
<u-td v-for="(items,b) of item" :key="b" v-if="items!=''">
{{items}}
</u-td>
</u-tr>
</u-table>
</view>
<!-- 优待政策 -->
<view class="policy" v-if="policy">
<view class="middle-title" style="padding-bottom: 4rpx;">
{{policy.childTitle}}
</view>
<view v-for="(item,index) of policy.contentList" :key="index" style="margin-top: 20rpx;">
{{item.content}}
</view>
</view>
<!--景区设施 -->
<view class="facilities" v-if="facilities">
<view class="middle-title" style="padding-bottom: 4rpx;">
{{facilities.title}}
</view>
<view class="fac-content" v-for="(item,a) of facilities.merchantChildTitleData" :key="a">
<text class="fac-left">
{{item.childTitle}}
</text>
<view class="fac-right">
<text v-for="(items,b) of item.contentList" :key="b">
{{items.content}}
</text>
</view>
</view>
</view>
<!-- 出行贴士 -->
<view class="travelTips" v-if="travelTips">
<view class="middle-title" style="padding-bottom: 4rpx;">
{{travelTips.title}}
</view>
<view class="travel-content" v-for="(item,a) of travelTips.merchantChildTitleData" :key="a">
<text class="travel-left">
{{item.childTitle}}
</text>
<view class="travel-right">
<text v-for="(items,b) of item.contentList" :key="b">
{{items.content}}
</text>
</view>
</view>
</view>
</view>
</view>
</u-popup>
</template>
<script>
export default {
props: ['detailData'],
data() {
return {
showPop: false, //控制弹窗显示隐藏
times: '', //时间数组
policy:'', //优待政策列表
facilities: '', //景区设施
travelTips: '' //游玩提示
}
},
watch: {
detailData: {
handler(newValue, oldValue) {
if (newValue) {
this.times = ''
this.policy =''
this.facilities = ''
this.travelTips = ''
if (newValue.merchantTitleData && newValue.merchantTitleData.length > 0) {
let openTime = ''
newValue.merchantTitleData.forEach((item, index) => {
if (item.titleCode == 'scenic_base_info') {
//基本信息
item.merchantChildTitleData.forEach((items, index) => {
if (items.childTitleCode == '101001') {
//开放时间
openTime = items.contentList
}
if (items.childTitleCode == '101003') {
//优待政策
this.policy = items
}
})
}
if (item.titleCode == 'scenic_facilities') {
//景区设施,携程同步的数据没有这个模块
this.facilities = item
}
if (item.titleCode == 'scenic_travel_tips') {
//游玩贴士,携程同步的数据没有这个模块
this.travelTips = item
}
})
if (openTime.length > 0) {
this.times = openTime.map((item, index) => {
return item.content.split(';')
})
}
}
}
},
deep: true,
immediate: true
}
},
methods: {}
}
</script>
<style scoped="scoped">
.head{
text-align: center;
font-size: 32rpx;
font-weight: bold;
padding: 30rpx 0;
position:fixed;
top: 0;
width: 100%;
background: #fff;
z-index: 1;
}
.middle{
padding: 24rpx 24rpx 80rpx 24rpx;
background: #f5f5f5;
font-size: 24rpx;
}
.introduce{
padding: 30rpx 16rpx;
background: #fff;
}
.middle-title{
font-size: 30rpx;
font-weight: bold;
padding-bottom: 24rpx;
}
.introduce image{
width: 100%;
}
.opentime{
padding: 30rpx 16rpx;
background: #fff;
margin-top: 24rpx;
}
.policy{
padding: 30rpx 16rpx;
background: #fff;
margin-top: 24rpx;
}
.facilities{
background: #fff;
margin-top: 24rpx;
padding: 30rpx 16rpx;
}
.fac-content{
display: flex;
margin-top: 20rpx;
}
.fac-left{
width: 100rpx;
flex-shrink: 0;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
margin-right: 10rpx;
}
.travelTips{
background: #fff;
margin-top: 24rpx;
padding: 30rpx 16rpx;
}
.travel-content{
display: flex;
margin-top: 20rpx;
}
.travel-left{
width: 100rpx;
flex-shrink: 0;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
margin-right: 10rpx;
}
.buy-wrap{
overflow-y: auto;
position: relative;
}
@media only screen and (max-height: 900px) {
.buy-wrap{
max-height: 750px;
}
}
@media only screen and (max-height: 750px) {
.buy-wrap{
max-height: 600px;
}
}
@media only screen and (max-height: 600px) {
.buy-wrap{
max-height: 500px;
}
}
</style>
\ No newline at end of file
This diff is collapsed.
// 引入全局mixin
import mixin from './libs/mixin/mixin.js'
// 引入关于是否mixin集成小程序分享的配置
// import wxshare from './libs/mixin/mpShare.js'
// 全局挂载引入http相关请求拦截插件
import http from './libs/request'
function wranning(str) {
// 开发环境进行信息输出,主要是一些报错信息
// 这个环境的来由是在程序编写时候,点击hx编辑器运行调试代码的时候,详见:
// https://uniapp.dcloud.io/frame?id=%e5%bc%80%e5%8f%91%e7%8e%af%e5%a2%83%e5%92%8c%e7%94%9f%e4%ba%a7%e7%8e%af%e5%a2%83
if (process.env.NODE_ENV === 'development') {
console.warn(str)
}
}
// 尝试判断在根目录的/store中是否有$u.mixin.js,此文件uView默认为需要挂在到全局的vuex的state变量
// HX2.6.11版本,放到try中,控制台依然会警告,暂时不用此方式,
// let vuexStore = {};
// try {
// vuexStore = require("@/store/$u.mixin.js");
// } catch (e) {
// //TODO handle the exception
// }
// post类型对象参数转为get类型url参数
import queryParams from './libs/function/queryParams.js'
// 路由封装
import route from './libs/function/route.js'
// 时间格式化
import timeFormat from './libs/function/timeFormat.js'
// 时间戳格式化,返回多久之前
import timeFrom from './libs/function/timeFrom.js'
// 颜色渐变相关,colorGradient-颜色渐变,hexToRgb-十六进制颜色转rgb颜色,rgbToHex-rgb转十六进制
import colorGradient from './libs/function/colorGradient.js'
// 生成全局唯一guid字符串
import guid from './libs/function/guid.js'
// 主题相关颜色,info|success|warning|primary|default|error,此颜色已在uview.scss中定义,但是为js中也能使用,故也定义一份
import color from './libs/function/color.js'
// 根据type获取图标名称
import type2icon from './libs/function/type2icon.js'
// 打乱数组的顺序
import randomArray from './libs/function/randomArray.js'
// 对象和数组的深度克隆
import deepClone from './libs/function/deepClone.js'
// 对象深度拷贝
import deepMerge from './libs/function/deepMerge.js'
// 添加单位
import addUnit from './libs/function/addUnit.js'
// 规则检验
import test from './libs/function/test.js'
// 随机数
import random from './libs/function/random.js'
// 去除空格
import trim from './libs/function/trim.js'
// toast提示,对uni.showToast的封装
import toast from './libs/function/toast.js'
// 获取父组件参数
import getParent from './libs/function/getParent.js'
// 获取整个父组件
import $parent from './libs/function/$parent.js'
// 获取sys()和os()工具方法
// 获取设备信息,挂载到$u的sys()(system的缩写)属性中,
// 同时把安卓和ios平台的名称"ios"和"android"挂到$u.os()中,方便取用
import {sys, os} from './libs/function/sys.js'
// 防抖方法
import debounce from './libs/function/debounce.js'
// 节流方法
import throttle from './libs/function/throttle.js'
// 配置信息
import config from './libs/config/config.js'
// 各个需要fixed的地方的z-index配置文件
import zIndex from './libs/config/zIndex.js'
const $u = {
queryParams: queryParams,
route: route,
timeFormat: timeFormat,
date: timeFormat, // 另名date
timeFrom,
colorGradient: colorGradient.colorGradient,
colorToRgba: colorGradient.colorToRgba,
guid,
color,
sys,
os,
type2icon,
randomArray,
wranning,
get: http.get,
post: http.post,
put: http.put,
'delete': http.delete,
hexToRgb: colorGradient.hexToRgb,
rgbToHex: colorGradient.rgbToHex,
test,
random,
deepClone,
deepMerge,
getParent,
$parent,
addUnit,
trim,
type: ['primary', 'success', 'error', 'warning', 'info'],
http,
toast,
config, // uView配置信息相关,比如版本号
zIndex,
debounce,
throttle,
}
// $u挂载到uni对象上
uni.$u = $u
const install = Vue => {
Vue.mixin(mixin)
if (Vue.prototype.openShare) {
Vue.mixin(mpShare);
}
// Vue.mixin(vuexStore);
// 时间格式化,同时两个名称,date和timeFormat
Vue.filter('timeFormat', (timestamp, format) => {
return timeFormat(timestamp, format)
})
Vue.filter('date', (timestamp, format) => {
return timeFormat(timestamp, format)
})
// 将多久以前的方法,注入到全局过滤器
Vue.filter('timeFrom', (timestamp, format) => {
return timeFrom(timestamp, format)
})
Vue.prototype.$u = $u
}
export default {
install
}
\ No newline at end of file
// 引入公共基础类
@import "./libs/css/common.scss";
@import "./libs/css/color.scss";
// 非nvue的样式
/* #ifndef APP-NVUE */
@import "./libs/css/style.vue.scss";
/* #endif */
// nvue的特有样式
/* #ifdef APP-NVUE */
@import "./libs/css/style.nvue.scss";
/* #endif */
// 小程序特有的样式
/* #ifdef MP */
@import "./libs/css/style.mp.scss";
/* #endif */
// H5特有的样式
/* #ifdef H5 */
@import "./libs/css/style.h5.scss";
/* #endif */
\ No newline at end of file
......@@ -3,8 +3,8 @@ import App from './App'
import uView from 'uview-ui'
import './flitter'
import request from 'common/request.js'
import "./common/icon/iconfont.css"
import commonjs from "common/common.js"
import './common/icon/iconfont.css'
import commonjs from 'common/common.js'
Vue.prototype.$commonjs = commonjs
Vue.prototype.$request = request
......@@ -13,32 +13,32 @@ Vue.use(uView)
Vue.config.productionTip = false
App.mpType = 'app'
const app = new Vue({
...App
...App
})
app.$mount()
//更改toFixed方法,解决toFixed bug
Number.prototype.toFixed=function (d) {
var s=this+"";
if(!d)d=0;
if(s.indexOf(".")==-1)s+=".";
s+=new Array(d+1).join("0");
if(new RegExp("^(-|\\+)?(\\d+(\\.\\d{0,"+(d+1)+"})?)\\d*$").test(s)){
var s="0"+RegExp.$2,pm=RegExp.$1,a=RegExp.$3.length,b=true;
if(a==d+2){
a=s.match(/\d/g);
if(parseInt(a[a.length-1])>4){
for(var i=a.length-2;i>=0;i--){
a[i]=parseInt(a[i])+1;
if(a[i]==10){
a[i]=0;
b=i!=1;
}else break;
}
}
s=a.join("").replace(new RegExp("(\\d+)(\\d{"+d+"})\\d$"),"$1.$2");
var s=this+''
if(!d)d=0
if(s.indexOf('.')==-1)s+='.'
s+=new Array(d+1).join('0')
if(new RegExp('^(-|\\+)?(\\d+(\\.\\d{0,'+(d+1)+'})?)\\d*$').test(s)){
var s='0'+RegExp.$2,pm=RegExp.$1,a=RegExp.$3.length,b=true
if(a==d+2){
a=s.match(/\d/g)
if(parseInt(a[a.length-1])>4){
for(var i=a.length-2;i>=0;i--){
a[i]=parseInt(a[i])+1
if(a[i]==10){
a[i]=0
b=i!=1
}else break
}
}
s=a.join('').replace(new RegExp('(\\d+)(\\d{'+d+'})\\d$'),'$1.$2')
}if(b)s=s.substr(1);
return (pm+s).replace(/\.$/,"");
}return this+"";
}if(b)s=s.substr(1)
return (pm+s).replace(/\.$/,'')
}return this+''
}
......@@ -70,7 +70,10 @@
},
"uniStatistics" : {
"enable" : true
}
},
"requiredPrivateInfos":[
"getLocation"
]
},
"mp-alipay" : {
"usingComponents" : true,
......
{
"name": "uView",
"version": "1.8.6",
"description": "uView UI,是uni-app生态优秀的UI框架,全面的组件和便捷的工具会让您信手拈来,如鱼得水",
"main": "index.js",
"keywords": [
"uview",
"ui",
"uni-app"
],
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": {
"type": "git",
"url": ""
},
"devDependencies": {
"node-sass": "^4.14.0",
"sass-loader": "^8.0.2"
},
"author": "uView",
"license": "MIT",
"id": "uview-v1",
"dcloudext": {
"category": [
"前端组件",
"通用组件"
]
}
}
\ No newline at end of file
......@@ -14,7 +14,7 @@
<view class="search-right">
<input class="search-input" placeholder="景区/商品/关键词搜索" v-model="searchData" />
<text class="search-btn" @click="initList(true)">搜索</text>
<text class="search-btn" @click="initList('','',true)">搜索</text>
</view>
</view>
</view>
......@@ -26,7 +26,7 @@
<swiper :current="swiperCurrent" @transition="transition" @animationfinish="animationfinish" class="swiper-box">
<swiper-item class="swiper-item">
<scroll-view scroll-y style="height:100%;width: 100%;">
<view class="merchant-list" v-for="(item,index) in scenicList" :key='index'>
<view class="merchant-list" v-for="(item,index) in scenicList" :key='index' @click="clikDetail(item.id)">
<view class="list-left">
<image :src="item.imgUrl"></image>
</view>
......@@ -41,8 +41,8 @@
<text v-for="(items, index) of item.tag.slice(0, 3)" :key="index" v-if="items">{{items}}</text>
</view>
<view class="right2-right">
距您8km
<view class="right2-right" v-if="showDistance">
距您{{item.distance?parseFloat((item.distance/1000).toFixed(2)):0}}km
</view>
</view>
......@@ -51,9 +51,9 @@
{{items}}
</text>
<text>
购买须知
<u-icon name="arrow-right"></u-icon>
详情
</text>
<u-icon name="arrow-right"></u-icon>
</view>
<view class="right4">
......@@ -85,13 +85,19 @@
</swiper-item>
</swiper>
</view>
<merchantDetail :detailData='detailData' ref='merchantDetail'></merchantDetail>
</view>
</template>
<script>
import merchantDetail from '@/components/merchantDetail' //详情弹窗
export default {
components: {
merchantDetail
},
data() {
return {
detailData:'',//详情数据
scenicList:[],//景区数据
list: [
{
......@@ -118,10 +124,28 @@ export default {
current: 0, // tabs组件的current值,表示当前活动的tab选项
swiperCurrent: 0, // swiper组件的current值,表示当前那个swiper-item是活动的
searchData:'',//搜索框的值
showDistance:false,//定位成功显示距离
}
},
onLoad(option) {
this.initList()
let token = uni.getStorageSync('token')
if(token){
uni.getLocation({
type: 'wgs84',
success:res=> {
let latitude = res.latitude//纬度
let longitude = res.longitude //经度
this.showDistance=true
this.initList(latitude,longitude,false)
},
fail:res=>{
let latitude=''
let longitude=''
this.initList(latitude,longitude,false)
}
})
this.giveCoupon()
}
},
methods: {
//---tabs通知swiper切换
......@@ -142,8 +166,10 @@ export default {
this.current = current
},
//---加载数据
initList(click){
initList(latitude,longitude,click){
let data = {
userlongitude:longitude, //经度
userlatitude:latitude, //纬度
type: 1, //类型:1景区、2酒店、餐饮
pageIndex:1,//第几页
pageSize:20, //每页有多少条
......@@ -165,7 +191,51 @@ export default {
})
}
})
}
},
//---送券
giveCoupon(){
let data={
pageCode:'SD_GROUP',
marketingStatus:1,
userId:uni.getStorageSync('userId')||'',
openid:uni.getStorageSync('openid')||''
}
this.$request('scenic/market/findPageMarket',data).then((res)=>{
if(res.data.length>0){
// this.firstCoupon=true
// this.couponData=res.data.data[0]
// setTimeout(()=>{
// this.firstCoupon=false
// this.smallCoupon=true
// },1500)
}
})
},
//---点击购买须知
clikDetail(merchantId){
this.$refs.merchantDetail.showPop=true
this.initDetail(merchantId)
},
//---初始化详情
initDetail(merchantId){
let data={
userId:uni.getStorageSync('userId')||'',
openid:uni.getStorageSync('openid')||'',
id:merchantId,//商户id
isDetail:1,//商户详情
}
this.detailData=''
this.$request('scenic/user/merchant/findDetailInfo',data).then((res)=>{
if(res.code=='00'){
this.detailData=res.data
}else{
uni.showToast({
title: res.message,
icon: 'none'
})
}
})
},
}
}
</script>
......
<template>
<!-- 详情 -->
</template>
<script>
</script>
<style>
</style>
\ No newline at end of file
// 此文件为uView的主题变量,这些变量目前只能通过uni.scss引入才有效,另外由于
// uni.scss中引入的样式会同时混入到全局样式文件和单独每一个页面的样式中,造成微信程序包太大,
// 故uni.scss只建议放scss变量名相关样式,其他的样式可以通过main.js或者App.vue引入
$u-main-color: #303133;
$u-content-color: #606266;
$u-tips-color: #909399;
$u-light-color: #c0c4cc;
$u-border-color: #e4e7ed;
$u-bg-color: #f3f4f6;
$u-type-primary: #2979ff;
$u-type-primary-light: #ecf5ff;
$u-type-primary-disabled: #a0cfff;
$u-type-primary-dark: #2b85e4;
$u-type-warning: #ff9900;
$u-type-warning-disabled: #fcbd71;
$u-type-warning-dark: #f29100;
$u-type-warning-light: #fdf6ec;
$u-type-success: #19be6b;
$u-type-success-disabled: #71d5a1;
$u-type-success-dark: #18b566;
$u-type-success-light: #dbf1e1;
$u-type-error: #fa3534;
$u-type-error-disabled: #fab6b6;
$u-type-error-dark: #dd6161;
$u-type-error-light: #fef0f0;
$u-type-info: #909399;
$u-type-info-disabled: #c8c9cc;
$u-type-info-dark: #82848a;
$u-type-info-light: #f4f4f5;
$u-form-item-height: 70rpx;
$u-form-item-border-color: #dcdfe6;
......@@ -288,6 +288,10 @@
},
init() {
let now = new Date();
let minDate = new Date(this.minDate);
let maxDate = new Date(this.maxDate);
if (now < minDate) now = minDate;
if (now > maxDate) now = maxDate;
this.year = now.getFullYear();
this.month = now.getMonth() + 1;
this.day = now.getDate();
......@@ -636,4 +640,4 @@
}
}
}
</style>
\ No newline at end of file
</style>
......@@ -110,7 +110,8 @@
this.parent = this.$u.$parent.call(this, 'u-collapse');
if(this.parent) {
this.nameSync = this.name ? this.name : this.parent.childrens.length;
this.parent.childrens.push(this);
// 不存在时才添加本实例
!this.parent.childrens.includes(this) && this.parent.childrens.push(this);
this.headStyle = this.parent.headStyle;
this.bodyStyle = this.parent.bodyStyle;
this.arrowColor = this.parent.arrowColor;
......
......@@ -68,7 +68,7 @@
return {
active: false, // 当前项是否处于展开状态
activeColor: '#2979ff', // 激活时左边文字和右边对勾图标的颜色
inactiveColor: '#606266' // 未激活时左边文字和右边对勾图标的颜色
inactiveColor: '#606266', // 未激活时左边文字和右边对勾图标的颜色
}
},
computed: {
......
......@@ -172,6 +172,7 @@ export default {
this.loading = false;
} else {
this.isError = false;
this.loading = true;
}
}
}
......
......@@ -50,6 +50,7 @@
:selection-end="uSelectionEnd"
:selection-start="uSelectionStart"
:show-confirm-bar="showConfirmbar"
:adjust-position="adjustPosition"
@focus="onFocus"
@blur="handleBlur"
@input="handleInput"
......@@ -213,6 +214,11 @@ export default {
showConfirmbar:{
type:Boolean,
default:true
},
// 弹出键盘时是否自动调节高度,uni-app默认值是true
adjustPosition: {
type: Boolean,
default: true
}
},
data() {
......@@ -300,11 +306,12 @@ export default {
handleBlur(event) {
// 最开始使用的是监听图标@touchstart事件,自从hx2.8.4后,此方法在微信小程序出错
// 这里改为监听点击事件,手点击清除图标时,同时也发生了@blur事件,导致图标消失而无法点击,这里做一个延时
let value = event.detail.value;
setTimeout(() => {
this.focused = false;
}, 100)
// vue 原生的方法 return 出去
this.$emit('blur', event.detail.value);
this.$emit('blur', value);
setTimeout(() => {
// 头条小程序由于自身bug,导致中文下,每按下一个键(尚未完成输入),都会触发一次@input,导致错误,这里进行判断处理
// #ifdef MP-TOUTIAO
......@@ -312,7 +319,7 @@ export default {
this.lastValue = value;
// #endif
// 将当前的值发送到 u-form-item 进行校验
this.dispatch('u-form-item', 'on-form-blur', event.detail.value);
this.dispatch('u-form-item', 'on-form-blur', value);
}, 40)
},
onFormItemError(status) {
......
......@@ -10,7 +10,7 @@
</view>
<input :disabled="disabledInput || disabled" :cursor-spacing="getCursorSpacing" :class="{ 'u-input-disabled': disabled }"
v-model="inputVal" class="u-number-input" @blur="onBlur" @focus="onFocus"
type="number" :style="{
type="digit" :style="{
color: color,
fontSize: size + 'rpx',
background: bgColor,
......
......@@ -36,7 +36,7 @@
</view>
</view>
<view class="u-select__body">
<picker-view @change="columnChange" class="u-select__body__picker-view" :value="defaultSelector" @pickstart="pickstart" @pickend="pickend">
<picker-view @change="columnChange" class="u-select__body__picker-view" :value="defaultSelector" @pickstart="pickstart" @pickend="pickend" v-if="value">
<picker-view-column v-for="(item, index) in columnData" :key="index">
<view class="u-select__body__picker-view__item" v-for="(item1, index1) in item" :key="index1">
<view class="u-line-1">{{ item1[labelName] }}</view>
......@@ -278,12 +278,13 @@ export default {
let columnIndex = e.detail.value;
// 由于后面是需要push进数组的,所以需要先清空数组
this.selectValue = [];
this.defaultSelector = columnIndex;
if(this.mode == 'mutil-column-auto') {
// 对比前后两个数组,寻找变更的是哪一列,如果某一个元素不同,即可判定该列发生了变化
this.lastSelectIndex.map((val, idx) => {
if (val != columnIndex[idx]) index = idx;
});
this.defaultSelector = columnIndex;
for (let i = index + 1; i < this.columnNum; i++) {
// 当前变化列的下一列的数据,需要获取上一列的数据,同时需要指定是上一列的第几个的children,再往后的
// 默认是队列的第一个为默认选项
......@@ -333,6 +334,8 @@ export default {
},
close() {
this.$emit('input', false);
// 重置default-value默认值
this.$set(this, 'defaultSelector', [0]);
},
// 点击确定或者取消
getResult(event = null) {
......
......@@ -3,9 +3,9 @@
background: bgColor
}">
<!-- $u.getRect()对组件根节点无效,因为写了.in(this),故这里获取内层接点尺寸 -->
<view :id="id">
<view>
<scroll-view scroll-x class="u-scroll-view" :scroll-left="scrollLeft" scroll-with-animation>
<view class="u-scroll-box" :class="{'u-tabs-scorll-flex': !isScroll}">
<view class="u-scroll-box" :id="id" :class="{'u-tabs-scorll-flex': !isScroll}">
<view class="u-tab-item u-line-1" :id="'u-tab-item-' + index" v-for="(item, index) in list" :key="index" @tap="clickTab(index)"
:style="[tabItemStyle(index)]">
<u-badge :count="item[count] || item['count'] || 0" :offset="offset" size="mini"></u-badge>
......
......@@ -39,7 +39,7 @@
style.padding = this.parent.padding;
style.borderBottom = `solid 1px ${this.parent.borderColor}`;
style.borderRight = `solid 1px ${this.parent.borderColor}`;
Object.assign(style, this.parent.style);
Object.assign(style, this.parent.thStyle);
this.thStyle = style;
}
}
......
......@@ -21,7 +21,7 @@
<u-icon class="u-icon" :name="delIcon" size="20" :color="delColor"></u-icon>
</view>
<u-line-progress
v-if="showProgress && item.progress > 0 && !item.error"
v-if="showProgress && item.progress > 0 && item.progress != 100 && !item.error"
:show-percent="false"
height="16"
class="u-progress"
......@@ -421,6 +421,9 @@ export default {
name: this.name,
formData: this.formData,
header: this.header,
// #ifdef MP-ALIPAY
fileType:'image',
// #endif
success: res => {
// 判断是否json字符串,将其转为json格式
let data = this.toJson && this.$u.test.jsonString(res.data) ? JSON.parse(res.data) : res.data;
......@@ -498,7 +501,7 @@ export default {
// 执行移除图片的动作,上方代码只是判断是否可以移除
handlerDeleteItem(index) {
// 如果文件正在上传中,终止上传任务,进度在0 < progress < 100则意味着正在上传
if (this.lists[index].process < 100 && this.lists[index].process > 0) {
if (this.lists[index].progress < 100 && this.lists[index].progress > 0) {
typeof this.lists[index].uploadTask != 'undefined' && this.lists[index].uploadTask.abort();
}
this.lists.splice(index, 1);
......
// 此版本发布于2020-03-17
let version = '1.8.4';
// 此版本发布于2022-04-19
let version = '1.8.6';
export default {
v: version,
......@@ -12,4 +12,4 @@ export default {
'error',
'warning'
]
}
\ No newline at end of file
}
......@@ -6,7 +6,7 @@
* v-for的时候,推荐使用后端返回的id而不是循环的index
* @param {Number} len uuid的长度
* @param {Boolean} firstU 将返回的首字母置为"u"
* @param {Nubmer} radix 生成uuid的基数(意味着返回的字符串都是这个基数),2-二进制,8-八进制,10-十进制,16-十六进制
* @param {Number} radix 生成uuid的基数(意味着返回的字符串都是这个基数),2-二进制,8-八进制,10-十进制,16-十六进制
*/
function guid(len = 32, firstU = true, radix = null) {
let chars = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'.split('');
......@@ -29,7 +29,7 @@ function guid(len = 32, firstU = true, radix = null) {
}
}
}
// 移除第一个字符,并用u替代,因为第一个字符为数值时,该guuid不能用作id或者class
// 移除第一个字符,并用u替代,因为第一个字符为数值时,该guid不能用作id或者class
if (firstU) {
uuid.shift();
return 'u' + uuid.join('');
......
......@@ -2,7 +2,7 @@
* 验证电子邮箱格式
*/
function email(value) {
return /^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/.test(value);
return /[\w!#$%&'*+/=?^_`{|}~-]+(?:\.[\w!#$%&'*+/=?^_`{|}~-]+)*@(?:[\w](?:[\w-]*[\w])?\.)+[\w](?:[\w-]*[\w])?/.test(value);
}
/**
......@@ -37,7 +37,7 @@ function dateISO(value) {
* 验证十进制数字
*/
function number(value) {
return /^(?:-?\d+|-?\d{1,3}(?:,\d{3})+)?(?:\.\d+)?$/.test(value)
return /^[\+-]?(\d+\.?\d*|\.\d+|\d\.\d+e\+\d+)$/.test(value)
}
/**
......
......@@ -48,7 +48,7 @@ module.exports = {
uni.$emit('uOnReachBottom')
},
beforeDestroy() {
// 判断当前页面是否存在parent和chldren,一般在checkbox和checkbox-group父子联动的场景会有此情况
// 判断当前页面是否存在parent和children,一般在checkbox和checkbox-group父子联动的场景会有此情况
// 组件销毁时,移除子组件在父组件children数组中的实例,释放资源,避免数据混乱
if(this.parent && uni.$u.test.array(this.parent.children)) {
// 组件销毁时,移除父组件中的children数组中对应的实例
......
......@@ -437,7 +437,7 @@ function range(rule, value, source, errors, options) {
}
if (str) {
// 处理码点大于U+010000的文字length属性不准确的bug,如"𠮷𠮷𠮷".lenght !== 3
// 处理码点大于U+010000的文字length属性不准确的bug,如"𠮷𠮷𠮷".length !== 3
val = value.replace(spRegexp, '_').length;
}
......
{
"name": "uview-ui",
"version": "1.8.4",
"description": "uView UI,是uni-app生态优秀的UI框架,全面的组件和便捷的工具会让您信手拈来,如鱼得水",
"main": "index.js",
"keywords": [
"uview",
"uView",
"uni-app",
"uni-app ui",
"uniapp",
"uviewui",
"uview ui",
"uviewUI",
"uViewui",
"uViewUI",
"uView UI",
"uni ui",
"uni UI",
"uniapp ui",
"ui",
"UI框架",
"uniapp ui框架",
"uniapp UI"
],
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": {
"type": "git",
"url": ""
},
"devDependencies": {
"node-sass": "^4.14.0",
"sass-loader": "^8.0.2"
},
"author": "uView",
"license": "MIT"
}
"name": "uView",
"version": "1.8.6",
"description": "uView UI,是uni-app生态优秀的UI框架,全面的组件和便捷的工具会让您信手拈来,如鱼得水",
"main": "index.js",
"keywords": [
"uview",
"ui",
"uni-app"
],
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": {
"type": "git",
"url": ""
},
"devDependencies": {
"node-sass": "^4.14.0",
"sass-loader": "^8.0.2"
},
"author": "uView",
"license": "MIT",
"id": "uview-v1",
"dcloudext": {
"category": [
"前端组件",
"通用组件"
]
}
}
\ No newline at end of file
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