Browse Source

修改上传

yh
杨豪 3 years ago
parent
commit
6d7f57eb92
  1. 4
      .hbuilderx/launch.json
  2. 5
      common/config.js
  3. 21
      components/chose-city/chose-city.vue
  4. 37
      components/mask/task-home-list1.vue
  5. 151
      components/uni-badge/uni-badge.vue
  6. 4
      components/uni-countdown/uni-countdown.vue
  7. 227
      components/uni-goods-nav/uni-goods-nav.vue
  8. 132
      components/uni-icons/icons.js
  9. 67
      components/uni-icons/uni-icons.vue
  10. 15
      components/uni-list/changelog.md
  11. 107
      components/uni-list/components/uni-list-ad/uni-list-ad.vue
  12. 58
      components/uni-list/components/uni-list-chat/uni-list-chat.scss
  13. 534
      components/uni-list/components/uni-list-chat/uni-list-chat.vue
  14. 461
      components/uni-list/components/uni-list-item/uni-list-item.vue
  15. 106
      components/uni-list/components/uni-list/uni-list.vue
  16. 65
      components/uni-list/components/uni-list/uni-refresh.vue
  17. 87
      components/uni-list/components/uni-list/uni-refresh.wxs
  18. 91
      components/uni-list/package.json
  19. 347
      components/uni-list/readme.md
  20. 194
      components/uni-load-more/uni-load-more.vue
  21. 2
      main.js
  22. 8
      manifest.json
  23. 157
      pages.json
  24. 1704
      pages/index/index.vue
  25. 345
      pages/index/taskDetail.vue
  26. 964
      pages/index/tasksdetails.vue
  27. 4
      pages/member/cash.vue
  28. 494
      pages/member/feedback.vue
  29. 116
      pages/my/account.vue
  30. 82
      pages/my/cooperation.vue
  31. 4
      pages/my/customer.vue
  32. 441
      pages/my/index.vue
  33. 4
      pages/my/moneydetails.vue
  34. 587
      pages/my/myVIP.vue
  35. 68
      pages/my/setting.vue
  36. 53
      pages/my/zhifubao.vue
  37. 317
      pages/order/index.vue
  38. 113
      pages/order/release.vue
  39. 93
      pages/public/login.vue
  40. 5
      project.config.json
  41. BIN
      static/img/home/banner.png
  42. BIN
      static/img/home/chaoshi.png
  43. BIN
      static/img/home/coco.png
  44. BIN
      static/img/home/elme.png
  45. BIN
      static/img/home/fanli.png
  46. BIN
      static/img/home/guanggao.png
  47. BIN
      static/img/home/guanggao2.png
  48. BIN
      static/img/home/haoping.png
  49. BIN
      static/img/home/huangguan.png
  50. BIN
      static/img/home/kefuxin.png
  51. BIN
      static/img/home/mae.png
  52. BIN
      static/img/home/meishi.png
  53. BIN
      static/img/home/meituan.png
  54. BIN
      static/img/home/naicha.png
  55. BIN
      static/img/home/qianggou.png
  56. BIN
      static/img/home/search.png
  57. BIN
      static/img/home/shangjia.png
  58. BIN
      static/img/home/shaokao.png
  59. BIN
      static/img/home/waimai.png
  60. BIN
      static/img/home/welfare.png
  61. BIN
      static/img/home/xiangqing.png
  62. BIN
      static/img/my/alipay.png
  63. BIN
      static/img/my/callus.png
  64. BIN
      static/img/my/cash.png
  65. BIN
      static/img/my/huiyuantiao.png
  66. BIN
      static/img/my/money.png
  67. BIN
      static/img/my/mybackgorund.png
  68. BIN
      static/img/my/rules.png
  69. BIN
      static/img/my/setting.png
  70. BIN
      static/img/my/tequan.png
  71. BIN
      static/img/my/title-bg.png
  72. BIN
      static/img/my/vip-icon.png
  73. BIN
      static/img/my/vip.png
  74. BIN
      static/img/my/wchart.png
  75. BIN
      static/img/my/xieyi.png
  76. BIN
      static/img/my/yijian.png
  77. BIN
      static/img/my/zhifubaored.png
  78. BIN
      static/img/my/zhiwen.png
  79. BIN
      static/img/tabbar/home-selected.png
  80. BIN
      static/img/tabbar/home.png
  81. BIN
      static/img/tabbar/homeselected.png
  82. BIN
      static/img/tabbar/mine-selected.png
  83. BIN
      static/img/tabbar/mine.png
  84. BIN
      static/img/tabbar/order-selected.png
  85. BIN
      static/img/tabbar/order.png
  86. 4
      uni.scss
  87. 21
      uview-ui/LICENSE
  88. 106
      uview-ui/README.md
  89. 190
      uview-ui/components/u-action-sheet/u-action-sheet.vue
  90. 256
      uview-ui/components/u-alert-tips/u-alert-tips.vue
  91. 290
      uview-ui/components/u-avatar-cropper/u-avatar-cropper.vue
  92. 1265
      uview-ui/components/u-avatar-cropper/weCropper.js
  93. 244
      uview-ui/components/u-avatar/u-avatar.vue
  94. 153
      uview-ui/components/u-back-top/u-back-top.vue
  95. 216
      uview-ui/components/u-badge/u-badge.vue
  96. 596
      uview-ui/components/u-button/u-button.vue
  97. 639
      uview-ui/components/u-calendar/u-calendar.vue
  98. 257
      uview-ui/components/u-car-keyboard/u-car-keyboard.vue
  99. 299
      uview-ui/components/u-card/u-card.vue
  100. 70
      uview-ui/components/u-cell-group/u-cell-group.vue
  101. Some files were not shown because too many files have changed in this diff Show More

4
.hbuilderx/launch.json

@ -6,6 +6,10 @@
{
"launchtype" : "remote"
},
"h5" :
{
"launchtype" : "remote"
},
"mp-weixin" :
{
"launchtype" : "remote"

5
common/config.js

@ -1,5 +1,6 @@
const ROOTPATH1 = "http://waimai.admin.service.cyjyyjy.com/sqx_fast/";
const ROOTPATH = "http://waimai.admin.service.cyjyyjy.com/sqx_fast/";
const ROOTPATH1 = "http://192.168.0.111:8891/sqx_fast";
const ROOTPATH = "https://bwc.xianmxkj.com/sqx_fast";
module.exports = {
APIHOST: ROOTPATH,
APIHOST1: ROOTPATH1

21
components/chose-city/chose-city.vue

@ -114,11 +114,12 @@
cityJson.forEach(d => {
this.cityList.push(d);
})
console.log(JSON.stringify(this.cityList))
console.log(JSON.stringify(this.cityList),'iiiii')
},
watch: {
//
inputValue(newVal) {
console.log(newVal);
this.isClearBtn = newVal ? true : false;
if (this.timer) {
@ -129,14 +130,19 @@
this.searchData = [];
return;
}
console.log(this.cityList,'mmmmm')
this.timer = setTimeout(() => {
const result = [];
this.cityList.map(v => {
v.children.forEach((item) => {
if (item.name.includes(this.inputValue)) {
result.push(item);
}
});
console.log(v)
if (v.name.includes(this.inputValue)) {
result.push(v);
}
// v.children.forEach((item) => {
// if (item.name.includes(this.inputValue)) {
// result.push(item);
// }
// });
})
this.searchData = result;
if (this.searchData.length === 0) {
@ -159,7 +165,7 @@
console.log(res);
console.log('省份数据:', res.result[0]); //
console.log('城市数据:', res.result[1]); //
// _this.cityList = res.result[1];
_this.cityList = res.result[1];
},
fail: function(error) {
console.error(error);
@ -260,6 +266,7 @@
value
} = e.detail;
this.inputValue = value;
},
//
touchStart(e) {

37
components/mask/task-home-list1.vue

@ -8,18 +8,21 @@
<image :src="item.titleImg" class="item-storeImg"></image>
<view class="right">
<view class="tag-title">
<image v-if="item.classify == 2" class="item-Logo" mode="widthFix"
<image v-if="item.classify == 2" class="item-Logo" mode="aspectFill"
src="/static/img/home/storeLogo.png"></image>
<image v-if="item.classify == 1" class="item-Logo" mode="widthFix"
<image v-if="item.classify == 1" class="item-Logo" mode="aspectFill"
src="/static/img/my/eleicon.png"></image>
<view class="tag-titles">{{item.goodsTitle}}</view>
<!-- <view class="item-weizhi">{{item.city}}{{item.address}}</view> -->
</view>
<view class="item-wz">
<view style="width: 63%;display: flex;;">
<view style="width: 8%;">
<!-- <view style="width: 8%;">
<image src="../../static/img/home/weizhi.png" class="weizhi"></image>
</view>
<view class="item-weizhi">{{item.city}}{{item.address}}</view>
<view class="item-weizhi">{{item.city}}{{item.address}}</view> -->
<view class="item-yu" v-if="item.endNum > 0">剩余{{item.endNum}}</view>
</view>
<view v-if="item.distance" class="item-juli">距离{{item.distance}}</view>
</view>
@ -30,21 +33,21 @@
<view class='tag-item-orange'>非会员满{{item.price}}{{item.money}}</view>
</view>
</view>
<view style="border:1upx solid #f1f1f1;margin: 30rpx 0 20rpx;"></view>
<view style="display: flex;width: 100%;">
<!-- <view style="border:1upx solid #f1f1f1;margin: 30rpx 0 20rpx;"></view> -->
<!-- <view style="display: flex;width: 100%;">
<view class="avatar">
<view class="item-money" style="align-items: center;">
<image style="width: 32rpx;height: 32rpx;margin-right: 6upx;"
src="../../static/img/home/yingbi.png"></image>
<view class="jinbi-num">{{item.memberMoneys}}</view>
<view class="item-yu" v-if="item.endNum > 0">剩余{{item.endNum}}</view>
<view class="item-money" style="align-items: center;"> -->
<!-- <image style="width: 32rpx;height: 32rpx;margin-right: 6upx;"
src="../../static/img/home/yingbi.png"></image> -->
<!-- <view class="jinbi-num">{{item.memberMoneys}}</view> -->
<!-- <view class="item-yu" v-if="item.endNum > 0">剩余{{item.endNum}}</view>
<view class="item-yu" v-else>已售罄</view>
</view>
</view>
<view class="baoming">报名</view>
<!-- <view class="date">结束时间: {{item.endTime}}</view> -->
<!-- <view style="width: 40%;text-align: right;font-size: 28rpx;color: #FD6416;" v-if="item.channelMoney">每单返{{item.channelMoney}}积分</view> -->
</view>
</view> -->
<!-- <view class="baoming">报名</view> -->
<!-- <view class="date">结束时间: {{item.endTime}}</view> -->
<!-- <view style="width: 40%;text-align: right;font-size: 28rpx;color: #FD6416;" v-if="item.channelMoney">每单返{{item.channelMoney}}积分</view> -->
<!-- </view> -->
</view>
</view>
</block>
@ -125,7 +128,7 @@
// padding: 0 30upx;
// width: 100%;
width: 690rpx;
height: 311rpx;
height: 230rpx;
margin: 0 30rpx;
position: relative;
background: #FFFFFF;

151
components/uni-badge/uni-badge.vue

@ -1,151 +0,0 @@
<template>
<text v-if="text" :class="inverted ? 'uni-badge--' + type + ' uni-badge--' + size + ' uni-badge--' + type + '-inverted' : 'uni-badge--' + type + ' uni-badge--' + size"
:style="badgeStyle" class="uni-badge" @click="onClick()">{{ text }}</text>
</template>
<script>
/**
* Badge 数字角标
* @description 数字角标一般和其它控件列表9宫格等配合使用用于进行数量提示默认为实心灰色背景
* @tutorial https://ext.dcloud.net.cn/plugin?id=21
* @property {String} text 角标内容
* @property {String} type = [default|primary|success|warning|error] 颜色类型
* @value default 灰色
* @value primary 蓝色
* @value success 绿色
* @value warning 黄色
* @value error 红色
* @property {String} size = [normal|small] Badge 大小
* @value normal 一般尺寸
* @value small 小尺寸
* @property {String} inverted = [true|false] 是否无需背景颜色
* @event {Function} click 点击 Badge 触发事件
* @example <uni-badge text="1"></uni-badge>
*/
export default {
name: 'UniBadge',
props: {
type: {
type: String,
default: 'default'
},
inverted: {
type: Boolean,
default: false
},
text: {
type: [String, Number],
default: ''
},
size: {
type: String,
default: 'normal'
}
},
data() {
return {
badgeStyle: ''
};
},
watch: {
text() {
this.setStyle()
}
},
mounted() {
this.setStyle()
},
methods: {
setStyle() {
this.badgeStyle = `width: ${String(this.text).length * 8 + 12}px`
},
onClick() {
this.$emit('click');
}
}
};
</script>
<style lang="scss" scoped>
$bage-size: 12px;
$bage-small: scale(0.8);
$bage-height: 20px;
.uni-badge {
/* #ifndef APP-PLUS */
display: flex;
/* #endif */
justify-content: center;
flex-direction: row;
height: $bage-height;
line-height: $bage-height;
color: $uni-text-color;
border-radius: 100px;
background-color: $uni-bg-color-hover;
background-color: transparent;
text-align: center;
font-family: 'Helvetica Neue', Helvetica, sans-serif;
font-size: $bage-size;
padding: 0px 6px;
}
.uni-badge--inverted {
padding: 0 5px 0 0;
color: $uni-bg-color-hover;
}
.uni-badge--default {
color: $uni-text-color;
background-color: $uni-bg-color-hover;
}
.uni-badge--default-inverted {
color: $uni-text-color-grey;
background-color: transparent;
}
.uni-badge--primary {
color: $uni-text-color-inverse;
background-color: $uni-color-primary;
}
.uni-badge--primary-inverted {
color: $uni-color-primary;
background-color: transparent;
}
.uni-badge--success {
color: $uni-text-color-inverse;
background-color: $uni-color-success;
}
.uni-badge--success-inverted {
color: $uni-color-success;
background-color: transparent;
}
.uni-badge--warning {
color: $uni-text-color-inverse;
background-color: $uni-color-warning;
}
.uni-badge--warning-inverted {
color: $uni-color-warning;
background-color: transparent;
}
.uni-badge--error {
color: $uni-text-color-inverse;
background-color: $uni-color-error;
}
.uni-badge--error-inverted {
color: $uni-color-error;
background-color: transparent;
}
.uni-badge--small {
transform: $bage-small;
transform-origin: center center;
}
</style>

4
components/uni-countdown/uni-countdown.vue

@ -1,6 +1,6 @@
<template>
<view class="uni-countdown">
<text :style="{ color: splitorColor }" class="uni-countdown__splitor">仅剩</text>
<!-- <text :style="{ color: splitorColor }" class="uni-countdown__splitor">仅剩</text> -->
<text v-if="showDay" :style="{ borderColor: borderColor, color: color, backgroundColor: backgroundColor }" class="uni-countdown__number">{{ d }}</text>
<text :style="{ color: splitorColor }" class="uni-countdown__splitor">{{ showColon ? ':' : '天' }}</text>
<text :style="{ borderColor: borderColor, color: color, backgroundColor: backgroundColor }" class="uni-countdown__number">{{ h }}</text>
@ -9,7 +9,7 @@
<text :style="{ color: splitorColor }" class="uni-countdown__splitor">{{ showColon ? ':' : '分' }}</text>
<text :style="{ borderColor: borderColor, color: color, backgroundColor: backgroundColor }" class="uni-countdown__number">{{ s }}</text>
<text v-if="!showColon" :style="{ color: splitorColor }" class="uni-countdown__splitor"></text>
<text :style="{ color: splitorColor }" class="uni-countdown__splitor">结束</text>
<!-- <text :style="{ color: splitorColor }" class="uni-countdown__splitor">结束</text> -->
</view>
</template>
<script>

227
components/uni-goods-nav/uni-goods-nav.vue

@ -1,227 +0,0 @@
<template>
<view class="uni-goods-nav">
<!-- 底部占位 -->
<view class="uni-tab__seat" />
<view class="uni-tab__cart-box flex">
<view class="flex uni-tab__cart-sub-left">
<view v-for="(item,index) in options" :key="index" class="flex uni-tab__cart-button-left uni-tab__shop-cart" @click="onClick(index,item)">
<view class="uni-tab__icon">
<uni-icons :type="item.icon" size="20" color="#646566"></uni-icons>
<!-- <image class="image" :src="item.icon" mode="widthFix" /> -->
</view>
<text class="uni-tab__text">{{ item.text }}</text>
<view class="flex uni-tab__dot-box">
<text v-if="item.info" :class="{ 'uni-tab__dots': item.info > 9 }" class="uni-tab__dot " :style="{'backgroundColor':item.infoBackgroundColor?item.infoBackgroundColor:'#ff0000',
color:item.infoColor?item.infoColor:'#fff'
}">{{ item.info }}</text>
</view>
</view>
</view>
<view :class="{'uni-tab__right':fill}" class="flex uni-tab__cart-sub-right ">
<view v-for="(item,index) in buttonGroup" :key="index" :style="{backgroundColor:item.backgroundColor,color:item.color}"
class="flex uni-tab__cart-button-right" @click="buttonClick(index,item)"><text :style="{color:item.color}" class="uni-tab__cart-button-right-text">{{ item.text }}</text></view>
</view>
</view>
</view>
</template>
<script>
/**
* GoodsNav 商品导航
* @description 商品加入购物车立即购买等
* @tutorial https://ext.dcloud.net.cn/plugin?id=865
* @property {Array} options 组件参数
* @property {Array} buttonGroup 组件按钮组参数
* @property {Boolean} fill = [true | false] 组件按钮组参数
* @event {Function} click 左侧点击事件
* @event {Function} buttonClick 右侧按钮组点击事件
* @example <uni-goods-nav :fill="true" options="" buttonGroup="buttonGroup" @click="" @buttonClick="" />
*/
export default {
name: 'UniGoodsNav',
props: {
options: {
type: Array,
default () {
return [{
icon: 'shop',
text: '店铺',
}, {
icon: 'cart',
text: '购物车'
}]
}
},
buttonGroup: {
type: Array,
default () {
return [{
text: '加入购物车',
backgroundColor: '#ffa200',
color: '#fff'
},
{
text: '立即购买',
backgroundColor: '#ff0000',
color: '#fff'
}
]
}
},
fill: {
type: Boolean,
default: false
}
},
methods: {
onClick(index, item) {
this.$emit('click', {
index,
content: item,
})
},
buttonClick(index, item) {
if (uni.report) {
uni.report(item.text, item.text)
}
this.$emit('buttonClick', {
index,
content: item
})
}
}
}
</script>
<style lang="scss" scoped>
.flex {
/* #ifndef APP-NVUE */
display: flex;
/* #endif */
flex-direction: row;
}
.uni-goods-nav {
/* #ifndef APP-NVUE */
display: flex;
/* #endif */
flex: 1;
flex-direction: row;
}
.uni-tab__cart-box {
flex: 1;
height: 50px;
background-color: #fff;
z-index: 900;
}
.uni-tab__cart-sub-left {
padding: 0 5px;
}
.uni-tab__cart-sub-right {
flex: 1;
}
.uni-tab__right {
margin: 5px 0;
margin-right: 10px;
border-radius: 100px;
overflow: hidden;
}
.uni-tab__cart-button-left {
/* #ifndef APP-NVUE */
display: flex;
/* #endif */
// flex: 1;
position: relative;
justify-content: center;
align-items: center;
flex-direction: column;
margin: 0 10px;
/* #ifdef H5 */
cursor: pointer;
/* #endif */
}
.uni-tab__icon {
width: 18px;
height: 18px;
}
.image {
width: 18px;
height: 18px;
}
.uni-tab__text {
margin-top: 3px;
font-size: $uni-font-size-sm;
color: #646566;
}
.uni-tab__cart-button-right {
/* #ifndef APP-NVUE */
display: flex;
flex-direction: column;
/* #endif */
flex: 1;
justify-content: center;
align-items: center;
/* #ifdef H5 */
cursor: pointer;
/* #endif */
}
.uni-tab__cart-button-right-text {
font-size: $uni-font-size-base;
color: #fff;
}
.uni-tab__cart-button-right:active {
opacity: 0.7;
}
.uni-tab__dot-box {
/* #ifndef APP-NVUE */
display: flex;
flex-direction: column;
/* #endif */
position: absolute;
right: -2px;
top: 2px;
justify-content: center;
align-items: center;
// width: 0;
// height: 0;
}
.uni-tab__dot {
// width: 30rpx;
// height: 30rpx;
padding: 0 4px;
line-height: 15px;
color: #ffffff;
text-align: center;
font-size: 12px;
background-color: #ff0000;
border-radius: 15px;
}
.uni-tab__dots {
padding: 0 4px;
// width: auto;
border-radius: 15px;
}
.uni-tab__color-y {
background-color: #ffa200;
}
.uni-tab__color-r {
background-color: #ff0000;
}
</style>

132
components/uni-icons/icons.js

@ -1,132 +0,0 @@
export default {
"pulldown": "\ue588",
"refreshempty": "\ue461",
"back": "\ue471",
"forward": "\ue470",
"more": "\ue507",
"more-filled": "\ue537",
"scan": "\ue612",
"qq": "\ue264",
"weibo": "\ue260",
"weixin": "\ue261",
"pengyouquan": "\ue262",
"loop": "\ue565",
"refresh": "\ue407",
"refresh-filled": "\ue437",
"arrowthindown": "\ue585",
"arrowthinleft": "\ue586",
"arrowthinright": "\ue587",
"arrowthinup": "\ue584",
"undo-filled": "\ue7d6",
"undo": "\ue406",
"redo": "\ue405",
"redo-filled": "\ue7d9",
"bars": "\ue563",
"chatboxes": "\ue203",
"camera": "\ue301",
"chatboxes-filled": "\ue233",
"camera-filled": "\ue7ef",
"cart-filled": "\ue7f4",
"cart": "\ue7f5",
"checkbox-filled": "\ue442",
"checkbox": "\ue7fa",
"arrowleft": "\ue582",
"arrowdown": "\ue581",
"arrowright": "\ue583",
"smallcircle-filled": "\ue801",
"arrowup": "\ue580",
"circle": "\ue411",
"eye-filled": "\ue568",
"eye-slash-filled": "\ue822",
"eye-slash": "\ue823",
"eye": "\ue824",
"flag-filled": "\ue825",
"flag": "\ue508",
"gear-filled": "\ue532",
"reload": "\ue462",
"gear": "\ue502",
"hand-thumbsdown-filled": "\ue83b",
"hand-thumbsdown": "\ue83c",
"hand-thumbsup-filled": "\ue83d",
"heart-filled": "\ue83e",
"hand-thumbsup": "\ue83f",
"heart": "\ue840",
"home": "\ue500",
"info": "\ue504",
"home-filled": "\ue530",
"info-filled": "\ue534",
"circle-filled": "\ue441",
"chat-filled": "\ue847",
"chat": "\ue263",
"mail-open-filled": "\ue84d",
"email-filled": "\ue231",
"mail-open": "\ue84e",
"email": "\ue201",
"checkmarkempty": "\ue472",
"list": "\ue562",
"locked-filled": "\ue856",
"locked": "\ue506",
"map-filled": "\ue85c",
"map-pin": "\ue85e",
"map-pin-ellipse": "\ue864",
"map": "\ue364",
"minus-filled": "\ue440",
"mic-filled": "\ue332",
"minus": "\ue410",
"micoff": "\ue360",
"mic": "\ue302",
"clear": "\ue434",
"smallcircle": "\ue868",
"close": "\ue404",
"closeempty": "\ue460",
"paperclip": "\ue567",
"paperplane": "\ue503",
"paperplane-filled": "\ue86e",
"person-filled": "\ue131",
"contact-filled": "\ue130",
"person": "\ue101",
"contact": "\ue100",
"images-filled": "\ue87a",
"phone": "\ue200",
"images": "\ue87b",
"image": "\ue363",
"image-filled": "\ue877",
"location-filled": "\ue333",
"location": "\ue303",
"plus-filled": "\ue439",
"plus": "\ue409",
"plusempty": "\ue468",
"help-filled": "\ue535",
"help": "\ue505",
"navigate-filled": "\ue884",
"navigate": "\ue501",
"mic-slash-filled": "\ue892",
"search": "\ue466",
"settings": "\ue560",
"sound": "\ue590",
"sound-filled": "\ue8a1",
"spinner-cycle": "\ue465",
"download-filled": "\ue8a4",
"personadd-filled": "\ue132",
"videocam-filled": "\ue8af",
"personadd": "\ue102",
"upload": "\ue402",
"upload-filled": "\ue8b1",
"starhalf": "\ue463",
"star-filled": "\ue438",
"star": "\ue408",
"trash": "\ue401",
"phone-filled": "\ue230",
"compose": "\ue400",
"videocam": "\ue300",
"trash-filled": "\ue8dc",
"download": "\ue403",
"chatbubble-filled": "\ue232",
"chatbubble": "\ue202",
"cloud-download": "\ue8e4",
"cloud-upload-filled": "\ue8e5",
"cloud-upload": "\ue8e6",
"cloud-download-filled": "\ue8e9",
"headphones":"\ue8bf",
"shop":"\ue609"
}

67
components/uni-icons/uni-icons.vue

File diff suppressed because one or more lines are too long

15
components/uni-list/changelog.md

@ -0,0 +1,15 @@
## 1.1.3(2021-08-30)
- 修复 在vue3中to属性在发行应用的时候报错的bug
## 1.1.2(2021-07-30)
- 优化 vue3下事件警告的问题
## 1.1.1(2021-07-21)
- 修复 与其他组件嵌套使用时,点击失效的Bug
## 1.1.0(2021-07-13)
- 组件兼容 vue3,如何创建vue3项目,详见 [uni-app 项目支持 vue3 介绍](https://ask.dcloud.net.cn/article/37834)
## 1.0.17(2021-05-12)
- 新增 组件示例地址
## 1.0.16(2021-02-05)
- 优化 组件引用关系,通过uni_modules引用组件
## 1.0.15(2021-02-05)
- 调整为uni_modules目录规范
- 修复 uni-list-chat 角标显示不正常的问题

107
components/uni-list/components/uni-list-ad/uni-list-ad.vue

@ -0,0 +1,107 @@
<template>
<!-- #ifdef APP-NVUE -->
<cell>
<!-- #endif -->
<view class="uni-list-ad">
<view v-if="borderShow" :class="{'uni-list--border':border,'uni-list-item--first':isFirstChild}"></view>
<ad style="width: 200px;height: 300px;border-width: 1px;border-color: red;border-style: solid;" adpid="1111111111"
unit-id="" appid="" apid="" type="feed" @error="aderror" @close="closeAd"></ad>
</view>
<!-- #ifdef APP-NVUE -->
</cell>
<!-- #endif -->
</template>
<script>
// #ifdef APP-NVUE
const dom = uni.requireNativePlugin('dom');
// #endif
export default {
name: 'UniListAd',
props: {
title: {
type: String,
default: '',
}
},
// inject: ['list'],
data() {
return {
isFirstChild: false,
border: false,
borderShow: true,
}
},
mounted() {
this.list = this.getForm()
if (this.list) {
if (!this.list.firstChildAppend) {
this.list.firstChildAppend = true
this.isFirstChild = true
}
this.border = this.list.border
}
},
methods: {
/**
* 获取父元素实例
*/
getForm(name = 'uniList') {
let parent = this.$parent;
let parentName = parent.$options.name;
while (parentName !== name) {
parent = parent.$parent;
if (!parent) return false
parentName = parent.$options.name;
}
return parent;
},
aderror(e) {
console.log("aderror: " + JSON.stringify(e.detail));
},
closeAd(e) {
this.borderShow = false
}
}
}
</script>
<style lang="scss" scoped>
.uni-list-ad {
position: relative;
border: 1px red solid;
}
.uni-list--border {
position: relative;
padding-bottom: 1px;
/* #ifdef APP-PLUS */
border-top-color: $uni-border-color;
border-top-style: solid;
border-top-width: 0.5px;
/* #endif */
margin-left: $uni-spacing-row-lg;
}
/* #ifndef APP-NVUE */
.uni-list--border:after {
position: absolute;
top: 0;
right: 0;
left: 0;
height: 1px;
content: '';
-webkit-transform: scaleY(.5);
transform: scaleY(.5);
background-color: $uni-border-color;
}
.uni-list-item--first:after {
height: 0px;
}
/* #endif */
</style>

58
components/uni-list/components/uni-list-chat/uni-list-chat.scss

@ -0,0 +1,58 @@
/**
* 这里是 uni-list 组件内置的常用样式变量
* 如果需要覆盖样式这里提供了基本的组件样式变量您可以尝试修改这里的变量去完成样式替换而不用去修改源码
*
*/
// 背景色
$background-color : #fff;
// 分割线颜色
$divide-line-color : #e5e5e5;
// 默认头像大小如需要修改此值注意同步修改 js 中的值 const avatarWidth = xx 目前只支持方形头像
// nvue 页面不支持修改头像大小
$avatar-width : 45px ;
// 头像边框
$avatar-border-radius: 5px;
$avatar-border-color: #eee;
$avatar-border-width: 1px;
// 标题文字样式
$title-size : 16px;
$title-color : #3b4144;
$title-weight : normal;
// 描述文字样式
$note-size : 12px;
$note-color : #999;
$note-weight : normal;
// 右侧额外内容默认样式
$right-text-size : 12px;
$right-text-color : #999;
$right-text-weight : normal;
// 角标样式
// nvue 页面不支持修改圆点位置以及大小
// 角标在左侧时角标的位置默认为 0 负数左/下移动正数右/上移动
$badge-left: 0px;
$badge-top: 0px;
// 显示圆点时圆点大小
$dot-width: 10px;
$dot-height: 10px;
// 显示角标时角标大小和字体大小
$badge-size : 18px;
$badge-font : 12px;
// 显示角标时角标前景色
$badge-color : #fff;
// 显示角标时角标背景色
$badge-background-color : #ff5a5f;
// 显示角标时角标左右间距
$badge-space : 6px;
// 状态样式
// 选中颜色
$hover : #f5f5f5;

534
components/uni-list/components/uni-list-chat/uni-list-chat.vue

@ -0,0 +1,534 @@
<template>
<!-- #ifdef APP-NVUE -->
<cell>
<!-- #endif -->
<view :hover-class="!clickable && !link ? '' : 'uni-list-chat--hover'" class="uni-list-chat" @click.stop="onClick">
<view :class="{ 'uni-list--border': border, 'uni-list-chat--first': isFirstChild }"></view>
<view class="uni-list-chat__container">
<view class="uni-list-chat__header-warp">
<view v-if="avatarCircle || avatarList.length === 0" class="uni-list-chat__header" :class="{ 'header--circle': avatarCircle }">
<image class="uni-list-chat__header-image" :src="avatar" mode="aspectFill"></image>
</view>
<!-- 头像组 -->
<view v-else class="uni-list-chat__header">
<view v-for="(item, index) in avatarList" :key="index" class="uni-list-chat__header-box" :class="computedAvatar"
:style="{ width: imageWidth + 'px', height: imageWidth + 'px' }">
<image class="uni-list-chat__header-image" :style="{ width: imageWidth + 'px', height: imageWidth + 'px' }" :src="item.url"
mode="aspectFill"></image>
</view>
</view>
</view>
<view v-if="badgeText && badgePositon === 'left'" class="uni-list-chat__badge uni-list-chat__badge-pos" :class="[isSingle]">
<text class="uni-list-chat__badge-text">{{ badgeText === 'dot' ? '' : badgeText }}</text>
</view>
<view class="uni-list-chat__content">
<view class="uni-list-chat__content-main">
<text class="uni-list-chat__content-title uni-ellipsis">{{ title }}</text>
<text class="uni-list-chat__content-note uni-ellipsis">{{ note }}</text>
</view>
<view class="uni-list-chat__content-extra">
<slot>
<text class="uni-list-chat__content-extra-text">{{ time }}</text>
<view v-if="badgeText && badgePositon === 'right'" class="uni-list-chat__badge" :class="[isSingle, badgePositon === 'right' ? 'uni-list-chat--right' : '']">
<text class="uni-list-chat__badge-text">{{ badgeText === 'dot' ? '' : badgeText }}</text>
</view>
</slot>
</view>
</view>
</view>
</view>
<!-- #ifdef APP-NVUE -->
</cell>
<!-- #endif -->
</template>
<script>
//
const avatarWidth = 45;
/**
* ListChat 聊天列表
* @description 聊天列表,用于创建聊天类列表
* @tutorial https://ext.dcloud.net.cn/plugin?id=24
* @property {String} title 标题
* @property {String} note 描述
* @property {Boolean} clickable = [true|false] 是否开启点击反馈默认为false
* @property {String} badgeText 数字角标内容
* @property {String} badgePositon = [left|right] 角标位置默认为 right
* @property {String} link = [falsenavigateTo|redirectTo|reLaunch|switchTab] 是否展示右侧箭头并开启点击反馈默认为false
* @value false 不开启
* @value navigateTo uni.navigateTo()
* @value redirectTo uni.redirectTo()
* @value reLaunch uni.reLaunch()
* @value switchTab uni.switchTab()
* @property {String | PageURIString} to 跳转目标页面
* @property {String} time 右侧时间显示
* @property {Boolean} avatarCircle = [true|false] 是否显示圆形头像默认为false
* @property {String} avatar 头像地址avatarCircle 不填时生效
* @property {Array} avatarList 头像组格式为 [{url:''}]
* @event {Function} click 点击 uniListChat 触发事件
*/
export default {
name: 'UniListChat',
emits:['click'],
props: {
title: {
type: String,
default: ''
},
note: {
type: String,
default: ''
},
clickable: {
type: Boolean,
default: false
},
link: {
type: [Boolean, String],
default: false
},
to: {
type: String,
default: ''
},
badgeText: {
type: [String, Number],
default: ''
},
badgePositon: {
type: String,
default: 'right'
},
time: {
type: String,
default: ''
},
avatarCircle: {
type: Boolean,
default: false
},
avatar: {
type: String,
default: ''
},
avatarList: {
type: Array,
default () {
return [];
}
}
},
// inject: ['list'],
computed: {
isSingle() {
if (this.badgeText === 'dot') {
return 'uni-badge--dot';
} else {
const badgeText = this.badgeText.toString();
if (badgeText.length > 1) {
return 'uni-badge--complex';
} else {
return 'uni-badge--single';
}
}
},
computedAvatar() {
if (this.avatarList.length > 4) {
this.imageWidth = avatarWidth * 0.31;
return 'avatarItem--3';
} else if (this.avatarList.length > 1) {
this.imageWidth = avatarWidth * 0.47;
return 'avatarItem--2';
} else {
this.imageWidth = avatarWidth;
return 'avatarItem--1';
}
}
},
data() {
return {
isFirstChild: false,
border: true,
// avatarList: 3,
imageWidth: 50
};
},
mounted() {
this.list = this.getForm()
if (this.list) {
if (!this.list.firstChildAppend) {
this.list.firstChildAppend = true;
this.isFirstChild = true;
}
this.border = this.list.border;
}
},
methods: {
/**
* 获取父元素实例
*/
getForm(name = 'uniList') {
let parent = this.$parent;
let parentName = parent.$options.name;
while (parentName !== name) {
parent = parent.$parent;
if (!parent) return false
parentName = parent.$options.name;
}
return parent;
},
onClick() {
if (this.to !== '') {
this.openPage();
return;
}
if (this.clickable || this.link) {
this.$emit('click', {
data: {}
});
}
},
openPage() {
if (['navigateTo', 'redirectTo', 'reLaunch', 'switchTab'].indexOf(this.link) !== -1) {
this.pageApi(this.link);
} else {
this.pageApi('navigateTo');
}
},
pageApi(api) {
uni[api]({
url: this.to,
success: res => {
this.$emit('click', {
data: res
});
},
fail: err => {
this.$emit('click', {
data: err
});
console.error(err.errMsg);
}
});
}
}
};
</script>
<style lang="scss" scoped>
$background-color: #fff;
$divide-line-color: #e5e5e5;
$avatar-width: 45px;
$avatar-border-radius: 5px;
$avatar-border-color: #eee;
$avatar-border-width: 1px;
$title-size: 16px;
$title-color: #3b4144;
$title-weight: normal;
$note-size: 12px;
$note-color: #999;
$note-weight: normal;
$right-text-size: 12px;
$right-text-color: #999;
$right-text-weight: normal;
$badge-left: 0px;
$badge-top: 0px;
$dot-width: 10px;
$dot-height: 10px;
$badge-size: 18px;
$badge-font: 12px;
$badge-color: #fff;
$badge-background-color: #ff5a5f;
$badge-space: 6px;
$hover: #f5f5f5;
.uni-list-chat {
font-size: $uni-font-size-lg;
position: relative;
flex-direction: column;
justify-content: space-between;
background-color: $background-color;
}
// .uni-list-chat--disabled {
// opacity: 0.3;
// }
.uni-list-chat--hover {
background-color: $hover;
}
.uni-list--border {
position: relative;
margin-left: $uni-spacing-row-lg;
/* #ifdef APP-PLUS */
border-top-color: $divide-line-color;
border-top-style: solid;
border-top-width: 0.5px;
/* #endif */
}
/* #ifndef APP-NVUE */
.uni-list--border:after {
position: absolute;
top: 0;
right: 0;
left: 0;
height: 1px;
content: '';
-webkit-transform: scaleY(0.5);
transform: scaleY(0.5);
background-color: $divide-line-color;
}
.uni-list-item--first:after {
height: 0px;
}
/* #endif */
.uni-list-chat--first {
border-top-width: 0px;
}
.uni-ellipsis {
/* #ifndef APP-NVUE */
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
/* #endif */
/* #ifdef APP-NVUE */
lines: 1;
/* #endif */
}
.uni-ellipsis-2 {
/* #ifndef APP-NVUE */
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
/* #endif */
/* #ifdef APP-NVUE */
lines: 2;
/* #endif */
}
.uni-list-chat__container {
position: relative;
/* #ifndef APP-NVUE */
display: flex;
/* #endif */
flex-direction: row;
flex: 1;
padding: $uni-spacing-row-base $uni-spacing-row-lg;
position: relative;
overflow: hidden;
}
.uni-list-chat__header-warp {
position: relative;
}
.uni-list-chat__header {
/* #ifndef APP-NVUE */
display: flex;
align-content: center;
/* #endif */
flex-direction: row;
justify-content: center;
align-items: center;
flex-wrap: wrap-reverse;
/* #ifdef APP-NVUE */
width: 50px;
height: 50px;
/* #endif */
/* #ifndef APP-NVUE */
width: $avatar-width;
height: $avatar-width;
/* #endif */
border-radius: $avatar-border-radius;
border-color: $avatar-border-color;
border-width: $avatar-border-width;
border-style: solid;
overflow: hidden;
}
.uni-list-chat__header-box {
/* #ifndef APP-PLUS */
box-sizing: border-box;
display: flex;
width: $avatar-width;
height: $avatar-width;
/* #endif */
/* #ifdef APP-NVUE */
width: 50px;
height: 50px;
/* #endif */
overflow: hidden;
border-radius: 2px;
}
.uni-list-chat__header-image {
margin: 1px;
/* #ifdef APP-NVUE */
width: 50px;
height: 50px;
/* #endif */
/* #ifndef APP-NVUE */
width: $avatar-width;
height: $avatar-width;
/* #endif */
}
/* #ifndef APP-NVUE */
.uni-list-chat__header-image {
display: block;
width: 100%;
height: 100%;
}
.avatarItem--1 {
width: 100%;
height: 100%;
}
.avatarItem--2 {
width: 47%;
height: 47%;
}
.avatarItem--3 {
width: 32%;
height: 32%;
}
/* #endif */
.header--circle {
border-radius: 50%;
}
.uni-list-chat__content {
/* #ifndef APP-NVUE */
display: flex;
/* #endif */
flex-direction: row;
flex: 1;
overflow: hidden;
padding: 2px 0;
}
.uni-list-chat__content-main {
/* #ifndef APP-NVUE */
display: flex;
/* #endif */
flex-direction: column;
justify-content: space-between;
padding-left: $uni-spacing-row-base;
flex: 1;
overflow: hidden;
}
.uni-list-chat__content-title {
font-size: $title-size;
color: $title-color;
font-weight: $title-weight;
overflow: hidden;
}
.uni-list-chat__content-note {
margin-top: 3px;
color: $note-color;
font-size: $note-size;
font-weight: $title-weight;
overflow: hidden;
}
.uni-list-chat__content-extra {
/* #ifndef APP-NVUE */
flex-shrink: 0;
display: flex;
/* #endif */
flex-direction: column;
justify-content: space-between;
align-items: flex-end;
margin-left: 5px;
}
.uni-list-chat__content-extra-text {
color: $right-text-color;
font-size: $right-text-size;
font-weight: $right-text-weight;
overflow: hidden;
}
.uni-list-chat__badge-pos {
position: absolute;
/* #ifdef APP-NVUE */
left: 55px;
top: 3px;
/* #endif */
/* #ifndef APP-NVUE */
left: calc(#{$avatar-width} + 10px - #{$badge-space} + #{$badge-left});
top: calc(#{$uni-spacing-row-base}/ 2 + 1px + #{$badge-top});
/* #endif */
}
.uni-list-chat__badge {
/* #ifndef APP-NVUE */
display: flex;
/* #endif */
justify-content: center;
align-items: center;
border-radius: 100px;
background-color: $badge-background-color;
}
.uni-list-chat__badge-text {
color: $badge-color;
font-size: $badge-font;
}
.uni-badge--single {
/* #ifndef APP-NVUE */
// left: calc(#{$avatar-width} + 7px + #{$badge-left});
/* #endif */
width: $badge-size;
height: $badge-size;
}
.uni-badge--complex {
/* #ifdef APP-NVUE */
left: 50px;
/* #endif */
/* #ifndef APP-NVUE */
width: auto;
/* #endif */
height: $badge-size;
padding: 0 $badge-space;
}
.uni-badge--dot {
/* #ifdef APP-NVUE */
left: 60px;
top: 6px;
/* #endif */
/* #ifndef APP-NVUE */
left: calc(#{$avatar-width} + 15px - #{$dot-width}/ 2 + 1px + #{$badge-left});
/* #endif */
width: $dot-width;
height: $dot-height;
padding: 0;
}
.uni-list-chat--right {
/* #ifdef APP-NVUE */
left: 0;
/* #endif */
}
</style>

461
components/uni-list/components/uni-list-item/uni-list-item.vue

@ -0,0 +1,461 @@
<template>
<!-- #ifdef APP-NVUE -->
<cell>
<!-- #endif -->
<view :class="{ 'uni-list-item--disabled': disabled }"
:hover-class="(!clickable && !link) || disabled || showSwitch ? '' : 'uni-list-item--hover'"
class="uni-list-item" @click="onClick">
<view v-if="!isFirstChild" class="border--left" :class="{ 'uni-list--border': border }"></view>
<view class="uni-list-item__container"
:class="{ 'container--right': showArrow || link, 'flex--direction': direction === 'column' }">
<slot name="header">
<view class="uni-list-item__header">
<view v-if="thumb" class="uni-list-item__icon">
<image :src="thumb" class="uni-list-item__icon-img" :class="['uni-list--' + thumbSize]" />
</view>
<view v-else-if="showExtraIcon" class="uni-list-item__icon">
<uni-icons :color="extraIcon.color" :size="extraIcon.size" :type="extraIcon.type" />
</view>
</view>
</slot>
<slot name="body">
<view class="uni-list-item__content"
:class="{ 'uni-list-item__content--center': thumb || showExtraIcon || showBadge || showSwitch }">
<text v-if="title" class="uni-list-item__content-title"
:class="[ellipsis !== 0 && ellipsis <= 2 ? 'uni-ellipsis-' + ellipsis : '']">{{ title }}</text>
<text v-if="note" class="uni-list-item__content-note">{{ note }}</text>
</view>
</slot>
<slot name="footer">
<view v-if="rightText || showBadge || showSwitch" class="uni-list-item__extra"
:class="{ 'flex--justify': direction === 'column' }">
<text v-if="rightText" class="uni-list-item__extra-text">{{ rightText }}</text>
<uni-badge v-if="showBadge" :type="badgeType" :text="badgeText" />
<switch v-if="showSwitch" :disabled="disabled" :checked="switchChecked"
@change="onSwitchChange" />
</view>
</slot>
</view>
<uni-icons v-if="showArrow || link" :size="16" class="uni-icon-wrapper" color="#bbb" type="arrowright" />
</view>
<!-- #ifdef APP-NVUE -->
</cell>
<!-- #endif -->
</template>
<script>
/**
* ListItem 列表子组件
* @description 列表子组件
* @tutorial https://ext.dcloud.net.cn/plugin?id=24
* @property {String} title 标题
* @property {String} note 描述
* @property {String} thumb 左侧缩略图若thumb有值则不会显示扩展图标
* @property {String} thumbSize = [lg|base|sm] 略缩图大小
* @value lg 大图
* @value base 一般
* @value sm 小图
* @property {String} badgeText 数字角标内容
* @property {String} badgeType 数字角标类型参考[uni-icons](https://ext.dcloud.net.cn/plugin?id=21)
* @property {String} rightText 右侧文字内容
* @property {Boolean} disabled = [true|false] 是否禁用
* @property {Boolean} clickable = [true|false] 是否开启点击反馈
* @property {String} link = [navigateTo|redirectTo|reLaunch|switchTab] 是否展示右侧箭头并开启点击反馈
* @value navigateTo uni.navigateTo()
* @value redirectTo uni.redirectTo()
* @value reLaunch uni.reLaunch()
* @value switchTab uni.switchTab()
* @property {String | PageURIString} to 跳转目标页面
* @property {Boolean} showBadge = [true|false] 是否显示数字角标
* @property {Boolean} showSwitch = [true|false] 是否显示Switch
* @property {Boolean} switchChecked = [true|false] Switch是否被选中
* @property {Boolean} showExtraIcon = [true|false] 左侧是否显示扩展图标
* @property {Object} extraIcon 扩展图标参数格式为 {color: '#4cd964',size: '22',type: 'spinner'}
* @property {String} direction = [row|column] 排版方向
* @value row 水平排列
* @value column 垂直排列
* @event {Function} click 点击 uniListItem 触发事件
* @event {Function} switchChange 点击切换 Switch 时触发
*/
export default {
name: 'UniListItem',
emits: ['click', 'switchChange'],
props: {
direction: {
type: String,
default: 'row'
},
title: {
type: String,
default: ''
},
note: {
type: String,
default: ''
},
ellipsis: {
type: [Number],
default: 0
},
disabled: {
type: [Boolean, String],
default: false
},
clickable: {
type: Boolean,
default: false
},
showArrow: {
type: [Boolean, String],
default: false
},
link: {
type: [Boolean, String],
default: false
},
to: {
type: String,
default: ''
},
showBadge: {
type: [Boolean, String],
default: false
},
showSwitch: {
type: [Boolean, String],
default: false
},
switchChecked: {
type: [Boolean, String],
default: false
},
badgeText: {
type: String,
default: ''
},
badgeType: {
type: String,
default: 'success'
},
rightText: {
type: String,
default: ''
},
thumb: {
type: String,
default: ''
},
thumbSize: {
type: String,
default: 'base'
},
showExtraIcon: {
type: [Boolean, String],
default: false
},
extraIcon: {
type: Object,
default () {
return {
type: 'contact',
color: '#000000',
size: 20
};
}
},
border: {
type: Boolean,
default: true
}
},
// inject: ['list'],
data() {
return {
isFirstChild: false
};
},
mounted() {
this.list = this.getForm()
// uni-list
if (this.list) {
if (!this.list.firstChildAppend) {
this.list.firstChildAppend = true;
this.isFirstChild = true;
}
}
},
methods: {
/**
* 获取父元素实例
*/
getForm(name = 'uniList') {
let parent = this.$parent;
let parentName = parent.$options.name;
while (parentName !== name) {
parent = parent.$parent;
if (!parent) return false
parentName = parent.$options.name;
}
return parent;
},
onClick() {
if (this.to !== '') {
this.openPage();
return;
}
if (this.clickable || this.link) {
this.$emit('click', {
data: {}
});
}
},
onSwitchChange(e) {
this.$emit('switchChange', e.detail);
},
openPage() {
if (['navigateTo', 'redirectTo', 'reLaunch', 'switchTab'].indexOf(this.link) !== -1) {
this.pageApi(this.link);
} else {
this.pageApi('navigateTo');
}
},
pageApi(api) {
let callback = {
url: this.to,
success: res => {
this.$emit('click', {
data: res
});
},
fail: err => {
this.$emit('click', {
data: err
});
}
}
switch (api) {
case 'navigateTo':
uni.navigateTo(callback)
break
case 'redirectTo':
uni.redirectTo(callback)
break
case 'reLaunch':
uni.reLaunch(callback)
break
case 'switchTab':
uni.switchTab(callback)
break
default:
uni.navigateTo(callback)
}
}
}
};
</script>
<style lang="scss">
$list-item-pd: $uni-spacing-col-lg $uni-spacing-row-lg;
.uni-list-item {
/* #ifndef APP-NVUE */
display: flex;
/* #endif */
font-size: $uni-font-size-lg;
position: relative;
justify-content: space-between;
align-items: center;
background-color: #fff;
flex-direction: row;
/* #ifdef H5 */
cursor: pointer;
/* #endif */
}
.uni-list-item--disabled {
opacity: 0.3;
}
.uni-list-item--hover {
background-color: $uni-bg-color-hover;
}
.uni-list-item__container {
position: relative;
/* #ifndef APP-NVUE */
display: flex;
/* #endif */
flex-direction: row;
padding: $list-item-pd;
padding-left: $uni-spacing-row-lg;
flex: 1;
overflow: hidden;
// align-items: center;
}
.container--right {
padding-right: 0;
}
// .border--left {
// margin-left: $uni-spacing-row-lg;
// }
.uni-list--border {
position: absolute;
top: 0;
right: 0;
left: 0;
/* #ifdef APP-NVUE */
border-top-color: $uni-border-color;
border-top-style: solid;
border-top-width: 0.5px;
/* #endif */
}
/* #ifndef APP-NVUE */
.uni-list--border:after {
position: absolute;
top: 0;
right: 0;
left: 0;
height: 1px;
content: '';
-webkit-transform: scaleY(0.5);
transform: scaleY(0.5);
background-color: $uni-border-color;
}
/* #endif */
.uni-list-item__content {
/* #ifndef APP-NVUE */
display: flex;
/* #endif */
padding-right: 8px;
flex: 1;
color: #3b4144;
// overflow: hidden;
flex-direction: column;
justify-content: space-between;
overflow: hidden;
}
.uni-list-item__content--center {
justify-content: center;
}
.uni-list-item__content-title {
font-size: $uni-font-size-base;
color: #3b4144;
overflow: hidden;
}
.uni-list-item__content-note {
margin-top: 6rpx;
color: $uni-text-color-grey;
font-size: $uni-font-size-sm;
overflow: hidden;
}
.uni-list-item__extra {
// width: 25%;
/* #ifndef APP-NVUE */
display: flex;
/* #endif */
flex-direction: row;
justify-content: flex-end;
align-items: center;
}
.uni-list-item__header {
/* #ifndef APP-NVUE */
display: flex;
/* #endif */
flex-direction: row;
align-items: center;
}
.uni-list-item__icon {
margin-right: 18rpx;
flex-direction: row;
justify-content: center;
align-items: center;
}
.uni-list-item__icon-img {
/* #ifndef APP-NVUE */
display: block;
/* #endif */
height: $uni-img-size-base;
width: $uni-img-size-base;
margin-right: 10px;
}
.uni-icon-wrapper {
/* #ifndef APP-NVUE */
display: flex;
/* #endif */
align-items: center;
padding: 0 10px;
}
.flex--direction {
flex-direction: column;
/* #ifndef APP-NVUE */
align-items: initial;
/* #endif */
}
.flex--justify {
/* #ifndef APP-NVUE */
justify-content: initial;
/* #endif */
}
.uni-list--lg {
height: $uni-img-size-lg;
width: $uni-img-size-lg;
}
.uni-list--base {
height: $uni-img-size-base;
width: $uni-img-size-base;
}
.uni-list--sm {
height: $uni-img-size-sm;
width: $uni-img-size-sm;
}
.uni-list-item__extra-text {
color: $uni-text-color-grey;
font-size: $uni-font-size-sm;
}
.uni-ellipsis-1 {
/* #ifndef APP-NVUE */
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
/* #endif */
/* #ifdef APP-NVUE */
lines: 1;
/* #endif */
}
.uni-ellipsis-2 {
/* #ifndef APP-NVUE */
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
/* #endif */
/* #ifdef APP-NVUE */
lines: 2;
/* #endif */
}
</style>

106
components/uni-list/components/uni-list/uni-list.vue

@ -0,0 +1,106 @@
<template>
<!-- #ifndef APP-NVUE -->
<view class="uni-list uni-border-top-bottom">
<view v-if="border" class="uni-list--border-top"></view>
<slot />
<view v-if="border" class="uni-list--border-bottom"></view>
</view>
<!-- #endif -->
<!-- #ifdef APP-NVUE -->
<list class="uni-list" :class="{ 'uni-list--border': border }" :enableBackToTop="enableBackToTop" loadmoreoffset="15"><slot /></list>
<!-- #endif -->
</template>
<script>
/**
* List 列表
* @description 列表组件
* @tutorial https://ext.dcloud.net.cn/plugin?id=24
* @property {String} border = [true|false] 标题
*/
export default {
name: 'uniList',
'mp-weixin': {
options: {
multipleSlots: false
}
},
props: {
enableBackToTop: {
type: [Boolean, String],
default: false
},
scrollY: {
type: [Boolean, String],
default: false
},
border: {
type: Boolean,
default: true
}
},
// provide() {
// return {
// list: this
// };
// },
created() {
this.firstChildAppend = false;
},
methods: {
loadMore(e) {
this.$emit('scrolltolower');
}
}
};
</script>
<style lang="scss" scoped>
.uni-list {
/* #ifndef APP-NVUE */
display: flex;
/* #endif */
background-color: $uni-bg-color;
position: relative;
flex-direction: column;
}
.uni-list--border {
position: relative;
/* #ifdef APP-NVUE */
border-top-color: $uni-border-color;
border-top-style: solid;
border-top-width: 0.5px;
border-bottom-color: $uni-border-color;
border-bottom-style: solid;
border-bottom-width: 0.5px;
/* #endif */
z-index: -1;
}
/* #ifndef APP-NVUE */
.uni-list--border-top {
position: absolute;
top: 0;
right: 0;
left: 0;
height: 1px;
-webkit-transform: scaleY(0.5);
transform: scaleY(0.5);
background-color: $uni-border-color;
z-index: 1;
}
.uni-list--border-bottom {
position: absolute;
bottom: 0;
right: 0;
left: 0;
height: 1px;
-webkit-transform: scaleY(0.5);
transform: scaleY(0.5);
background-color: $uni-border-color;
}
/* #endif */
</style>

65
components/uni-list/components/uni-list/uni-refresh.vue

@ -0,0 +1,65 @@
<template>
<!-- #ifdef APP-NVUE -->
<refresh :display="display" @refresh="onrefresh" @pullingdown="onpullingdown">
<slot />
</refresh>
<!-- #endif -->
<!-- #ifndef APP-NVUE -->
<view ref="uni-refresh" class="uni-refresh" v-show="isShow">
<slot />
</view>
<!-- #endif -->
</template>
<script>
export default {
name: 'UniRefresh',
props: {
display: {
type: [String],
default: "hide"
}
},
data() {
return {
pulling: false
}
},
computed: {
isShow() {
if (this.display === "show" || this.pulling === true) {
return true;
}
return false;
}
},
created() {},
methods: {
onchange(value) {
this.pulling = value;
},
onrefresh(e) {
this.$emit("refresh", e);
},
onpullingdown(e) {
// #ifdef APP-NVUE
this.$emit("pullingdown", e);
// #endif
// #ifndef APP-NVUE
var detail = {
viewHeight: 90,
pullingDistance: e.height
}
this.$emit("pullingdown", detail);
// #endif
}
}
}
</script>
<style>
.uni-refresh {
height: 0;
overflow: hidden;
}
</style>

87
components/uni-list/components/uni-list/uni-refresh.wxs

@ -0,0 +1,87 @@
var pullDown = {
threshold: 95,
maxHeight: 200,
callRefresh: 'onrefresh',
callPullingDown: 'onpullingdown',
refreshSelector: '.uni-refresh'
};
function ready(newValue, oldValue, ownerInstance, instance) {
var state = instance.getState()
state.canPullDown = newValue;
// console.log(newValue);
}
function touchStart(e, instance) {
var state = instance.getState();
state.refreshInstance = instance.selectComponent(pullDown.refreshSelector);
state.canPullDown = (state.refreshInstance != null && state.refreshInstance != undefined);
if (!state.canPullDown) {
return
}
// console.log("touchStart");
state.height = 0;
state.touchStartY = e.touches[0].pageY || e.changedTouches[0].pageY;
state.refreshInstance.setStyle({
'height': 0
});
state.refreshInstance.callMethod("onchange", true);
}
function touchMove(e, ownerInstance) {
var instance = e.instance;
var state = instance.getState();
if (!state.canPullDown) {
return
}
var oldHeight = state.height;
var endY = e.touches[0].pageY || e.changedTouches[0].pageY;
var height = endY - state.touchStartY;
if (height > pullDown.maxHeight) {
return;
}
var refreshInstance = state.refreshInstance;
refreshInstance.setStyle({
'height': height + 'px'
});
height = height < pullDown.maxHeight ? height : pullDown.maxHeight;
state.height = height;
refreshInstance.callMethod(pullDown.callPullingDown, {
height: height
});
}
function touchEnd(e, ownerInstance) {
var state = e.instance.getState();
if (!state.canPullDown) {
return
}
state.refreshInstance.callMethod("onchange", false);
var refreshInstance = state.refreshInstance;
if (state.height > pullDown.threshold) {
refreshInstance.callMethod(pullDown.callRefresh);
return;
}
refreshInstance.setStyle({
'height': 0
});
}
function propObserver(newValue, oldValue, instance) {
pullDown = newValue;
}
module.exports = {
touchmove: touchMove,
touchstart: touchStart,
touchend: touchEnd,
propObserver: propObserver
}

91
components/uni-list/package.json

@ -0,0 +1,91 @@
{
"id": "uni-list",
"displayName": "uni-list 列表",
"version": "1.1.3",
"description": "List 组件 ,帮助使用者快速构建列表。",
"keywords": [
"",
"uni-ui",
"uniui",
"列表",
"",
"list"
],
"repository": "https://github.com/dcloudio/uni-ui",
"engines": {
"HBuilderX": ""
},
"directories": {
"example": "../../temps/example_temps"
},
"dcloudext": {
"category": [
"前端组件",
"通用组件"
],
"sale": {
"regular": {
"price": "0.00"
},
"sourcecode": {
"price": "0.00"
}
},
"contact": {
"qq": ""
},
"declaration": {
"ads": "无",
"data": "无",
"permissions": "无"
},
"npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui"
},
"uni_modules": {
"dependencies": [
"uni-badge",
"uni-icons"
],
"encrypt": [],
"platforms": {
"cloud": {
"tcb": "y",
"aliyun": "y"
},
"client": {
"App": {
"app-vue": "y",
"app-nvue": "y"
},
"H5-mobile": {
"Safari": "y",
"Android Browser": "y",
"微信浏览器(Android)": "y",
"QQ浏览器(Android)": "y"
},
"H5-pc": {
"Chrome": "y",
"IE": "y",
"Edge": "y",
"Firefox": "y",
"Safari": "y"
},
"小程序": {
"微信": "y",
"阿里": "y",
"百度": "y",
"字节跳动": "y",
"QQ": "y"
},
"快应用": {
"华为": "u",
"联盟": "u"
},
"Vue": {
"vue2": "y",
"vue3": "u"
}
}
}
}
}

347
components/uni-list/readme.md

@ -0,0 +1,347 @@
## List 列表
> **组件名:uni-list**
> 代码块: `uList`、`uListItem`
> 关联组件:`uni-list-item`、`uni-badge`、`uni-icons`、`uni-list-chat`、`uni-list-ad`
List 列表组件,包含基本列表样式、可扩展插槽机制、长列表性能优化、多端兼容。
在vue页面里,它默认使用页面级滚动。在app-nvue页面里,它默认使用原生list组件滚动。这样的长列表,在滚动出屏幕外后,系统会回收不可见区域的渲染内存资源,不会造成滚动越长手机越卡的问题。
uni-list组件是父容器,里面的核心是uni-list-item子组件,它代表列表中的一个可重复行,子组件可以无限循环。
uni-list-item有很多风格,uni-list-item组件通过内置的属性,满足一些常用的场景。当内置属性不满足需求时,可以通过扩展插槽来自定义列表内容。
内置属性可以覆盖的场景包括:导航列表、设置列表、小图标列表、通信录列表、聊天记录列表。
涉及很多大图或丰富内容的列表,比如类今日头条的新闻列表、类淘宝的电商列表,需要通过扩展插槽实现。
下文均有样例给出。
uni-list不包含下拉刷新和上拉翻页。上拉翻页另见组件:[uni-load-more](https://ext.dcloud.net.cn/plugin?id=29)
### 安装方式
本组件符合[easycom](https://uniapp.dcloud.io/collocation/pages?id=easycom)规范,`HBuilderX 2.5.5`起,只需将本组件导入项目,在页面`template`中即可直接使用,无需在页面中`import`和注册`components`。
如需通过`npm`方式使用`uni-ui`组件,另见文档:[https://ext.dcloud.net.cn/plugin?id=55](https://ext.dcloud.net.cn/plugin?id=55)
> **注意事项**
> 为了避免错误使用,给大家带来不好的开发体验,请在使用组件前仔细阅读下面的注意事项,可以帮你避免一些错误。
> - 组件需要依赖 `sass` 插件 ,请自行手动安装
> - 组件内部依赖 `'uni-icons'` 、`uni-badge` 组件
> - `uni-list``uni-list-item` 需要配套使用,暂不支持单独使用 `uni-list-item`
> - 只有开启点击反馈后,会有点击选中效果
> - 使用插槽时,可以完全自定义内容
> - note 、rightText 属性暂时没做限制,不支持文字溢出隐藏,使用时应该控制长度显示或通过默认插槽自行扩展
> - 支付宝小程序平台需要在支付宝小程序开发者工具里开启 component2 编译模式,开启方式: 详情 --> 项目配置 --> 启用 component2 编译
> - 如果需要修改 `switch`、`badge` 样式,请使用插槽自定义
> - 在 `HBuilderX` 低版本中,可能会出现组件显示 `undefined` 的问题,请升级最新的 `HBuilderX` 或者 `cli`
> - 如使用过程中有任何问题,或者您对uni-ui有一些好的建议,欢迎加入 uni-ui 交流群:871950839
### 基本用法
- 设置 `title` 属性,可以显示列表标题
- 设置 `disabled` 属性,可以禁用当前项
```html
<uni-list>
<uni-list-item title="列表文字" ></uni-list-item>
<uni-list-item :disabled="true" title="列表禁用状态" ></uni-list-item>
</uni-list>
```
### 多行内容显示
- 设置 `note` 属性 ,可以在第二行显示描述文本信息
```html
<uni-list>
<uni-list-item title="列表文字" note="列表描述信息"></uni-list-item>
<uni-list-item :disabled="true" title="列表文字" note="列表禁用状态"></uni-list-item>
</uni-list>
```
### 右侧显示角标、switch
- 设置 `show-badge` 属性 ,可以显示角标内容
- 设置 `show-switch` 属性,可以显示 switch 开关
```html
<uni-list>
<uni-list-item title="列表右侧显示角标" :show-badge="true" badge-text="12" ></uni-list-item>
<uni-list-item title="列表右侧显示 switch" :show-switch="true" @switchChange="switchChange" ></uni-list-item>
</uni-list>
```
### 左侧显示略缩图、图标
- 设置 `thumb` 属性 ,可以在列表左侧显示略缩图
- 设置 `show-extra-icon` 属性,并指定 `extra-icon` 可以在左侧显示图标
```html
<uni-list>
<uni-list-item title="列表左侧带略缩图" note="列表描述信息" thumb="https://vkceyugu.cdn.bspapp.com/VKCEYUGU-dc-site/460d46d0-4fcc-11eb-8ff1-d5dcf8779628.png"
thumb-size="lg" rightText="右侧文字"></uni-list-item>
<uni-list-item :show-extra-icon="true" :extra-icon="extraIcon1" title="列表左侧带扩展图标" ></uni-list-item>
</uni-list>
```
### 开启点击反馈和右侧箭头
- 设置 `clickable``true` ,则表示这是一个可点击的列表,会默认给一个点击效果,并可以监听 `click` 事件
- 设置 `link` 属性,会自动开启点击反馈,并给列表右侧添加一个箭头
- 设置 `to` 属性,可以跳转页面,`link` 的值表示跳转方式,如果不指定,默认为 `navigateTo`
```html
<uni-list>
<uni-list-item title="开启点击反馈" clickable @click="onClick" ></uni-list-item>
<uni-list-item title="默认 navigateTo 方式跳转页面" link to="/pages/vue/index/index" @click="onClick($event,1)" ></uni-list-item>
<uni-list-item title="reLaunch 方式跳转页面" link="reLaunch" to="/pages/vue/index/index" @click="onClick($event,1)" ></uni-list-item>
</uni-list>
```
### 聊天列表示例
- 设置 `clickable``true` ,则表示这是一个可点击的列表,会默认给一个点击效果,并可以监听 `click` 事件
- 设置 `link` 属性,会自动开启点击反馈,`link` 的值表示跳转方式,如果不指定,默认为 `navigateTo`
- 设置 `to` 属性,可以跳转页面
- `time` 属性,通常会设置成时间显示,但是这个属性不仅仅可以设置时间,你可以传入任何文本,注意文本长度可能会影响显示
- `avatar``avatarList` 属性同时只会有一个生效,同时设置的话,`avatarList` 属性的长度大于1 ,`avatar` 属性将失效
- 可以通过默认插槽自定义列表右侧内容
```html
<uni-list>
<uni-list :border="true">
<!-- 显示圆形头像 -->
<uni-list-chat :avatar-circle="true" title="uni-app" avatar="https://vkceyugu.cdn.bspapp.com/VKCEYUGU-dc-site/460d46d0-4fcc-11eb-8ff1-d5dcf8779628.png" note="您收到一条新的消息" time="2020-02-02 20:20" ></uni-list-chat>
<!-- 右侧带角标 -->
<uni-list-chat title="uni-app" avatar="https://vkceyugu.cdn.bspapp.com/VKCEYUGU-dc-site/460d46d0-4fcc-11eb-8ff1-d5dcf8779628.png" note="您收到一条新的消息" time="2020-02-02 20:20" badge-text="12"></uni-list-chat>
<!-- 头像显示圆点 -->
<uni-list-chat title="uni-app" avatar="https://vkceyugu.cdn.bspapp.com/VKCEYUGU-dc-site/460d46d0-4fcc-11eb-8ff1-d5dcf8779628.png" note="您收到一条新的消息" time="2020-02-02 20:20" badge-positon="left" badge-text="dot"></uni-list-chat>
<!-- 头像显示角标 -->
<uni-list-chat title="uni-app" avatar="https://vkceyugu.cdn.bspapp.com/VKCEYUGU-dc-site/460d46d0-4fcc-11eb-8ff1-d5dcf8779628.png" note="您收到一条新的消息" time="2020-02-02 20:20" badge-positon="left" badge-text="99"></uni-list-chat>
<!-- 显示多头像 -->
<uni-list-chat title="uni-app" :avatar-list="avatarList" note="您收到一条新的消息" time="2020-02-02 20:20" badge-positon="left" badge-text="dot"></uni-list-chat>
<!-- 自定义右侧内容 -->
<uni-list-chat title="uni-app" :avatar-list="avatarList" note="您收到一条新的消息" time="2020-02-02 20:20" badge-positon="left" badge-text="dot">
<view class="chat-custom-right">
<text class="chat-custom-text">刚刚</text>
<!-- 需要使用 uni-icons 请自行引入 -->
<uni-icons type="star-filled" color="#999" size="18"></uni-icons>
</view>
</uni-list-chat>
</uni-list>
</uni-list>
```
```javascript
export default {
components: {},
data() {
return {
avatarList: [{
url: 'https://vkceyugu.cdn.bspapp.com/VKCEYUGU-dc-site/460d46d0-4fcc-11eb-8ff1-d5dcf8779628.png'
}, {
url: 'https://vkceyugu.cdn.bspapp.com/VKCEYUGU-dc-site/460d46d0-4fcc-11eb-8ff1-d5dcf8779628.png'
}, {
url: 'https://vkceyugu.cdn.bspapp.com/VKCEYUGU-dc-site/460d46d0-4fcc-11eb-8ff1-d5dcf8779628.png'
}]
}
}
}
```
```css
.chat-custom-right {
flex: 1;
/* #ifndef APP-NVUE */
display: flex;
/* #endif */
flex-direction: column;
justify-content: space-between;
align-items: flex-end;
}
.chat-custom-text {
font-size: 12px;
color: #999;
}
```
## API
### List Props
属性名 |类型 |默认值 | 说明
:-: |:-: |:-: | :-:
border |Boolean |true | 是否显示边框
### ListItem Props
属性名 |类型 |默认值 | 说明
:-: |:-: |:-: | :-:
title |String |- | 标题
note |String |- | 描述
ellipsis |Number |0 | title 是否溢出隐藏,可选值,0:默认; 1:显示一行; 2:显示两行;【nvue 暂不支持】
thumb |String |- | 左侧缩略图,若thumb有值,则不会显示扩展图标
thumbSize |String |medium | 略缩图尺寸,可选值,lg:大图; medium:一般; sm:小图;
showBadge |Boolean |false | 是否显示数字角标
badgeText |String |- | 数字角标内容
badgeType |String |- | 数字角标类型,参考[uni-icons](https://ext.dcloud.net.cn/plugin?id=21)
rightText |String |- | 右侧文字内容
disabled |Boolean |false | 是否禁用
showArrow |Boolean |true | 是否显示箭头图标
link |String |navigateTo | 新页面跳转方式,可选值见下表
to |String |- | 新页面跳转地址,如填写此属性,click 会返回页面是否跳转成功
clickable |Boolean |false | 是否开启点击反馈
showSwitch |Boolean |false | 是否显示Switch
switchChecked |Boolean |false | Switch是否被选中
showExtraIcon |Boolean |false | 左侧是否显示扩展图标
extraIcon |Object |- | 扩展图标参数,格式为 ``{color: '#4cd964',size: '22',type: 'spinner'}``,参考 [uni-icons](https://ext.dcloud.net.cn/plugin?id=28)
direction | String |row | 排版方向,可选值,row:水平排列; column:垂直排列; 3个插槽是水平排还是垂直排,也受此属性控制
#### Link Options
属性名 | 说明
:-: | :-:
navigateTo | 同 uni.navigateTo()
redirectTo | 同 uni.reLaunch()
reLaunch | 同 uni.reLaunch()
switchTab | 同 uni.switchTab()
### ListItem Events
事件称名 |说明 |返回参数
:-: |:-: |:-:
click |点击 uniListItem 触发事件,需开启点击反馈 |-
switchChange |点击切换 Switch 时触发,需显示 switch |e={value:checked}
### ListItem Slots
名称 | 说明
:-: | :-:
header | 左/上内容插槽,可完全自定义默认显示
body | 中间内容插槽,可完全自定义中间内容
footer | 右/下内容插槽,可完全自定义右侧内容
> **通过插槽扩展**
> 需要注意的是当使用插槽时,内置样式将会失效,只保留排版样式,此时的样式需要开发者自己实现
> 如果 `uni-list-item` 组件内置属性样式无法满足需求,可以使用插槽来自定义uni-list-item里的内容。
> uni-list-item提供了3个可扩展的插槽:`header`、`body`、`footer`
> - 当 `direction` 属性为 `row` 时表示水平排列,此时 `header` 表示列表的左边部分,`body` 表示列表的中间部分,`footer` 表示列表的右边部分
> - 当 `direction` 属性为 `column` 时表示垂直排列,此时 `header` 表示列表的上边部分,`body` 表示列表的中间部分,`footer` 表示列表的下边部分
> 开发者可以只用1个插槽,也可以3个一起使用。在插槽中可自主编写view标签,实现自己所需的效果。
**示例**
```html
<uni-list>
<uni-list-item title="自定义右侧插槽" note="列表描述信息" link>
<template slot="header">
<image class="slot-image" src="/static/logo.png" mode="widthFix"></image>
</template>
</uni-list-item>
<uni-list-item>
<!-- 自定义 header -->
<view slot="header" class="slot-box"><image class="slot-image" src="/static/logo.png" mode="widthFix"></image></view>
<!-- 自定义 body -->
<text slot="body" class="slot-box slot-text">自定义插槽</text>
<!-- 自定义 footer-->
<template slot="footer">
<image class="slot-image" src="/static/logo.png" mode="widthFix"></image>
</template>
</uni-list-item>
</uni-list>
```
### ListItemChat Props
属性名 |类型 |默认值 | 说明
:-: |:-: |:-: | :-:
title |String |- | 标题
note |String |- | 描述
clickable |Boolean |false | 是否开启点击反馈
badgeText |String |- | 数字角标内容,设置为 `dot` 将显示圆点
badgePositon |String |right | 角标位置
link |String |navigateTo | 是否展示右侧箭头并开启点击反馈,可选值见下表
clickable |Boolean |false | 是否开启点击反馈
to |String |- | 跳转页面地址,如填写此属性,click 会返回页面是否跳转成功
time |String |- | 右侧时间显示
avatarCircle |Boolean |false | 是否显示圆形头像
avatar |String |- | 头像地址,avatarCircle 不填时生效
avatarList |Array |- | 头像组,格式为 [{url:''}]
#### Link Options
属性名 | 说明
:-: | :-:
navigateTo | 同 uni.navigateTo()
redirectTo | 同 uni.reLaunch()
reLaunch | 同 uni.reLaunch()
switchTab | 同 uni.switchTab()
### ListItemChat Slots
名称 | 说明
:- | :-
default | 自定义列表右侧内容(包括时间和角标显示)
### ListItemChat Events
事件称名 | 说明 | 返回参数
:-: | :-: | :-:
@click | 点击 uniListChat 触发事件 | {data:{}} ,如有 to 属性,会返回页面跳转信息
## 基于uni-list扩展的页面模板
通过扩展插槽,可实现多种常见样式的列表
**新闻列表类**
1. 云端一体混合布局:[https://ext.dcloud.net.cn/plugin?id=2546](https://ext.dcloud.net.cn/plugin?id=2546)
2. 云端一体垂直布局,大图模式:[https://ext.dcloud.net.cn/plugin?id=2583](https://ext.dcloud.net.cn/plugin?id=2583)
3. 云端一体垂直布局,多行图文混排:[https://ext.dcloud.net.cn/plugin?id=2584](https://ext.dcloud.net.cn/plugin?id=2584)
4. 云端一体垂直布局,多图模式:[https://ext.dcloud.net.cn/plugin?id=2585](https://ext.dcloud.net.cn/plugin?id=2585)
5. 云端一体水平布局,左图右文:[https://ext.dcloud.net.cn/plugin?id=2586](https://ext.dcloud.net.cn/plugin?id=2586)
6. 云端一体水平布局,左文右图:[https://ext.dcloud.net.cn/plugin?id=2587](https://ext.dcloud.net.cn/plugin?id=2587)
7. 云端一体垂直布局,无图模式,主标题+副标题:[https://ext.dcloud.net.cn/plugin?id=2588](https://ext.dcloud.net.cn/plugin?id=2588)
**商品列表类**
1. 云端一体列表/宫格视图互切:[https://ext.dcloud.net.cn/plugin?id=2651](https://ext.dcloud.net.cn/plugin?id=2651)
2. 云端一体列表(宫格模式):[https://ext.dcloud.net.cn/plugin?id=2671](https://ext.dcloud.net.cn/plugin?id=2671)
3. 云端一体列表(列表模式):[https://ext.dcloud.net.cn/plugin?id=2672](https://ext.dcloud.net.cn/plugin?id=2672)
## 组件示例
点击查看:[https://hellouniapp.dcloud.net.cn/pages/extUI/list/list](https://hellouniapp.dcloud.net.cn/pages/extUI/list/list)

194
components/uni-load-more/uni-load-more.vue

@ -1,194 +0,0 @@
<template>
<view class="uni-load-more">
<view class="uni-load-more__img" v-show="status === 'loading' && showIcon">
<view class="load1">
<view :style="{background:color}"></view>
<view :style="{background:color}"></view>
<view :style="{background:color}"></view>
<view :style="{background:color}"></view>
</view>
<view class="load2">
<view :style="{background:color}"></view>
<view :style="{background:color}"></view>
<view :style="{background:color}"></view>
<view :style="{background:color}"></view>
</view>
<view class="load3">
<view :style="{background:color}"></view>
<view :style="{background:color}"></view>
<view :style="{background:color}"></view>
<view :style="{background:color}"></view>
</view>
</view>
<text class="uni-load-more__text" :style="{color:color}">{{status === 'more' ? contentText.contentdown : (status === 'loading' ? contentText.contentrefresh : contentText.contentnomore)}}</text>
</view>
</template>
<script>
export default {
name: "uni-load-more",
props: {
status: {
//more-loadingloading-loadingnoMore-
type: String,
default: 'more'
},
showIcon: {
type: Boolean,
default: true
},
color: {
type: String,
default: "#777777"
},
contentText: {
type: Object,
default () {
return {
contentdown: "上拉显示更多",
contentrefresh: "正在加载...",
contentnomore: "没有更多数据了"
};
}
}
},
data() {
return {}
}
}
</script>
<style>
@charset "UTF-8";
.uni-load-more {
display: flex;
flex-direction: row;
height: 80upx;
align-items: center;
justify-content: center
}
.uni-load-more__text {
font-size: 28upx;
color: #999
}
.uni-load-more__img {
height: 24px;
width: 24px;
margin-right: 10px
}
.uni-load-more__img>view {
position: absolute
}
.uni-load-more__img>view view {
width: 6px;
height: 2px;
border-top-left-radius: 1px;
border-bottom-left-radius: 1px;
background: #999;
position: absolute;
opacity: .2;
transform-origin: 50%;
animation: load 1.56s ease infinite
}
.uni-load-more__img>view view:nth-child(1) {
transform: rotate(90deg);
top: 2px;
left: 9px
}
.uni-load-more__img>view view:nth-child(2) {
transform: rotate(180deg);
top: 11px;
right: 0
}
.uni-load-more__img>view view:nth-child(3) {
transform: rotate(270deg);
bottom: 2px;
left: 9px
}
.uni-load-more__img>view view:nth-child(4) {
top: 11px;
left: 0
}
.load1,
.load2,
.load3 {
height: 24px;
width: 24px
}
.load2 {
transform: rotate(30deg)
}
.load3 {
transform: rotate(60deg)
}
.load1 view:nth-child(1) {
animation-delay: 0s
}
.load2 view:nth-child(1) {
animation-delay: .13s
}
.load3 view:nth-child(1) {
animation-delay: .26s
}
.load1 view:nth-child(2) {
animation-delay: .39s
}
.load2 view:nth-child(2) {
animation-delay: .52s
}
.load3 view:nth-child(2) {
animation-delay: .65s
}
.load1 view:nth-child(3) {
animation-delay: .78s
}
.load2 view:nth-child(3) {
animation-delay: .91s
}
.load3 view:nth-child(3) {
animation-delay: 1.04s
}
.load1 view:nth-child(4) {
animation-delay: 1.17s
}
.load2 view:nth-child(4) {
animation-delay: 1.3s
}
.load3 view:nth-child(4) {
animation-delay: 1.43s
}
@-webkit-keyframes load {
0% {
opacity: 1
}
100% {
opacity: .2
}
}
</style>

2
main.js

@ -19,6 +19,8 @@ import loadMore from '@/components/load-more';
Vue.component('load-more', loadMore);
import tuinoData from '@/components/tui-no-data/tui-no-data';
Vue.component('tui-no-data', tuinoData);
import uView from 'uview-ui';
Vue.use(uView)
import 'js_sdk/ican-H5Api/ican-H5Api'

8
manifest.json

@ -1,6 +1,6 @@
{
"name" : "省钱兄霸王餐",
"appid" : "__UNI__uni_sqx",
"appid" : "__UNI__ECA82D8",
"description" : "",
"versionName" : "1.0.6",
"versionCode" : 106,
@ -135,10 +135,12 @@
"quickapp" : {},
/* */
"mp-weixin" : {
"appid" : "wxeaed7238f075ca19",
"appid" : "wx5f5b49c361569a10",
"setting" : {
"urlCheck" : false,
"es6" : true
"es6" : true,
"postcss" : true,
"minified" : true
},
"plugins" : {
"citySelector" : {

157
pages.json

@ -1,13 +1,33 @@
{
"easycom": {
"^u-(.*)": "@/uview-ui/components/u-$1/u-$1.vue"
},
"pages": [{
"path": "pages/index/index",
"style": {
"backgroundColor": "#FFFFFF",
"navigationBarTitleText": "首页",
"navigationBarTitleText": "番茄饭团",
"enablePullDownRefresh": false
// "navigationStyle": "custom"
}
},
{
"path": "pages/index/citys",
"style": {
"backgroundColor": "#FFFFFF",
"navigationBarTitleText": "选择城市",
"enablePullDownRefresh": false
}
},
{
"path": "pages/index/tasksdetails",
"style": {
"backgroundColor": "#FFFFFF",
"navigationBarTitleText": "任务详情",
"enablePullDownRefresh": false
}
},
{
"path": "pages/index/taskDetail",
"style": {
@ -48,29 +68,21 @@
"enablePullDownRefresh": false
}
},
{
"path": "pages/index/citys",
"style": {
"backgroundColor": "#FFFFFF",
"navigationBarTitleText": "选择城市",
"enablePullDownRefresh": false
}
},
{
"path": "pages/order/index",
"style": {
"navigationBarTitleText": "我的作业",
"navigationBarTitleText": "我的订单",
"enablePullDownRefresh": false
}
},
{
"path": "pages/order/release",
"style": {
"navigationBarTitleText": "凭证上传",
"navigationBarTitleText": "上传凭证",
"enablePullDownRefresh": false
}
},
// task-task
{
"path": "pages/task/search",
"style": {
@ -84,71 +96,12 @@
}
}
},
{
"path": "pages/task/tasklist",
"style": {
"navigationBarTextStyle": "black",
"navigationBarTitleText": "任务列表",
"enablePullDownRefresh": false,
"app-plus": {
"scrollIndicator": "none",
"bounce": "none",
"titleNView": true
}
}
},
{
"path": "pages/task/renwu",
"style": {
"navigationBarTextStyle": "black",
"navigationBarTitleText": "消息中心",
"enablePullDownRefresh": false,
"app-plus": {
"bounce": "none",
"scrollIndicator": "none",
"titleNView": true
}
}
},
{
"path": "pages/task/recharge",
"style": {
"navigationBarTextStyle": "black",
"navigationBarTitleText": "充值",
"enablePullDownRefresh": false,
"app-plus": {
"bounce": "none",
"scrollIndicator": "none",
"titleNView": {
"buttons": [{
"text": "明细",
"fontSize": "28upx",
"color": "#000000",
"fontWeight": "bold",
"float": "right"
}]
}
}
}
},
{
"path": "pages/task/rechargeDetail",
"style": {
"navigationBarTextStyle": "black",
"navigationBarTitleText": "充值明细",
"enablePullDownRefresh": false,
"app-plus": {
"bounce": "none",
"scrollIndicator": "none",
"titleNView": true
}
}
},
// my-my
{
"path": "pages/my/index",
"style": {
"navigationStyle": "custom",
"navigationBarTitleText": "个人中心",
"enablePullDownRefresh": false
}
},
@ -206,7 +159,7 @@
}
},
{
"path": "pages/my/account",
"path": "pages/my/setting",
"style": {
"navigationBarTitleText": "设置",
"enablePullDownRefresh": false
@ -297,7 +250,7 @@
{
"path": "pages/my/cooperation",
"style": {
"navigationBarTitleText": "商户线上合作",
"navigationBarTitleText": "商户入驻",
"enablePullDownRefresh": false,
"app-plus": {
"titleNView": true,
@ -357,18 +310,8 @@
"path": "pages/member/cash",
"style": {
"navigationBarTitleText": "提现",
"enablePullDownRefresh": false,
"app-plus": {
"bounce": "none",
"titleNView": {
"buttons": [{
"text": "提现记录",
"float": "right",
"fontSize": "15px",
"fontWeight": "bold"
}]
}
}
"enablePullDownRefresh": false
}
},
@ -422,25 +365,41 @@
"enablePullDownRefresh": false
}
}
,{
"path" : "pages/my/zhifubao",
"style" :
{
"navigationBarTitleText": "绑定支付宝",
"enablePullDownRefresh": false
}
}
],
"globalStyle": {
"navigationBarTextStyle": "black",
"navigationBarTitleText": "省钱兄霸王餐",
"navigationBarTitleText": "番茄饭团",
"navigationBarBackgroundColor": "#FFFFFF",
"backgroundColor": "#FFFFFF"
},
"tabBar": {
"color": "#B3B3B3",
"selectedColor": "#ffc705",
"color": "#D4D4D4",
"selectedColor": "#FF4848",
"borderStyle": "black",
"backgroundColor": "#ffffff",
"list": [{
"pagePath": "pages/index/index",
"iconPath": "static/img/tabbar/home.png",
"selectedIconPath": "static/img/tabbar/home-selected.png",
"selectedIconPath": "static/img/tabbar/homeselected.png",
"text": "首页"
},
// {
// "pagePath": "pages/index/index",
// "iconPath": "static/img/tabbar/home.png",
// "selectedIconPath": "static/img/tabbar/homeselected.png",
// "text": "首页"
// },
// {
// "pagePath": "pages/my/myVIP",
// "iconPath": "static/img/tabbar/huiyuan.png",
// "selectedIconPath": "static/img/tabbar/huiyuan-act.png",
@ -448,16 +407,17 @@
// },
{
"pagePath": "pages/order/index",
"iconPath": "static/img/tabbar/myorder.png",
"selectedIconPath": "static/img/tabbar/myorder-act.png",
"text": "作业"
"iconPath": "static/img/tabbar/order.png",
"selectedIconPath": "./static/img/tabbar/order-selected.png",
"text": "我的订单"
},
// {
// "pagePath": "pages/errands/index",
// "iconPath": "static/img/tabbar/order.png",
// "selectedIconPath": "static/img/tabbar/order-selected.png",
// "text": "外卖优惠"
// }, {
// },
// {
// "pagePath": "pages/my/shareFriends",
// "iconPath": "static/img/tabbar/errands.png",
// "selectedIconPath": "static/img/tabbar/errands-selected.png",
@ -465,10 +425,13 @@
// },
{
"pagePath": "pages/my/index",
"iconPath": "static/img/tabbar/my.png",
"selectedIconPath": "static/img/tabbar/my-selected.png",
"iconPath": "static/img/tabbar/mine.png",
"selectedIconPath": "static/img/tabbar/mine-selected.png",
"text": "我的"
}
]
},
"Window":{
"navigationStyle":"custom"
}
}

1704
pages/index/index.vue

File diff suppressed because it is too large Load Diff

345
pages/index/taskDetail.vue

@ -7,6 +7,9 @@
<view class="home-bgi">
<swiper class="swiper" autoplay="1500" :indicator-dots="true" :circular='true'
indicator-active-color="#ffffff" indicator-color="#cccccc">
<!-- <swiper-item class="swiper-wrap" v-for="(item,index) in banners" :key='index'> -->
<!-- <image :src="item"></image> -->
<!-- </swiper-item> -->
<swiper-item class="swiper-wrap" v-for="(item,index) in banners" :key='index'>
<image :src="item"></image>
</swiper-item>
@ -14,133 +17,90 @@
</view>
</view>
<!-- 标题等 -->
<view class="user-card-bottom" v-if="info">
<view class="first-row">
<view style="display: flex;align-items: center;margin-top: 10rpx;">
<image @tap="goShop" v-if="info.classify == 2" class="zhuan"
src="/static/img/home/storeLogo.png" mode="widthFix"></image>
<image @tap="goShop" v-if="info.classify == 1" class="zhuan"
src="/static/img/my/eleicon.png" mode="widthFix"></image>
<view class="tit">{{info.goodsTitle}}</view>
</view>
<view class="times">
<view style="width: 70%;display: flex;">
<image class="timeIcon" src="../../static/img/home/time.png" mode="widthFix"></image>
<view class="timeKs">{{info.endTime}}</view>
<view class=""
style="width:750rpx;height:100rpx;display:flex;background: linear-gradient(48deg, #FF5656 0%, #FF9F74 100%);position: absolute;margin-top:-38rpx;margin-bottom: 40rpx;">
<view class="left" style="margin-left: 16px;font-size: 14px;
font-family: PingFang SC;font-weight: 400;line-height: 60px;color: #FAD19C;">
番茄会员满18元返18元
</view>
<view class="middel"
style="width: 0px;height: 31px;border: 1px solid #FFFFFF;margin-top: 10pxpx;margin-left:0 14px;">
</view>
<view class="times">
<view style="margin-top: 20rpx;margin-left: 52rpx;">
<view class=""
style="font-size: 15px;font-family: PingFang SC;font-weight: 400;line-height: 30rpx;color: #FFFFFF;">
限时
</view>
<view style="width: 30%;">
<view
style="font-size: 24rpx;font-family: PingFang SC Medium, PingFang SC Medium-Medium;font-weight: 500;text-align: right;color: #999999;">
还剩{{info.endNum}}</view>
<view
style="font-size: 15px;font-family: PingFang SC;font-weight: 400;line-height: 30rpx;color: #FFFFFF;">
抢购
</view>
</view>
</view>
<view style="width: 30%;margin-left: 34px;">
<view
style="font-size: 11px;font-family: PingFang SC;font-weight: 400;color: #FFFFFF;line-height: 60rpx;">
剩余20{{info.endNum}}
</view>
</view>
</view>
<view class="user-card-bottom">
<view class="">
<image style="width: 65px;height: 65px;" src="../../static/img/home/xiangqing.png"></image>
</view>
<view class="tag-box" v-if="info">
<view class="tag-box">
<view class='tag-item'>
会员满{{info.memberPrice}}{{info.memberMoney}}
美团会员满20{{info.memberPrice}}12{{info.memberMoney}}
</view>
<view class='tag-item tag-item-orange'>非会员满{{info.price}}{{info.money}}</view>
<!-- <view class='tag-item tag-item-orange'>还剩{{info.endNum}}</view> -->
<!-- <view class='tag-item tag-item-orange' v-if="status">{{status}}</view> -->
<view class='tag-item'>非美团会员满20{{info.price}}{{info.money}}</view>
</view>
<view style="width: 630rpx;height: 1rpx;opacity: 1;border: 1rpx solid #e6e6e6;margin-top: 30rpx;">
</view>
<view style="width: 100%;display: flex;margin-top: 25rpx;">
<view style="display: flex;width: 33%;" v-for="(nav, index) in recommendList" :key="index">
<view v-if="index == 0" style="width: 100%;display: flex;">
<image style="width: 42rpx;height: 42rpx;" :src="nav.iconImg" mode="widthFix"></image>
<view style="margin-left:8rpx" v-if="index == 0">{{info.numStar}}星好评</view>
<view style="margin-left:8rpx" v-if="index == 1">{{info.numImg}}张配图</view>
<view style="margin-left:8rpx" v-if="index == 2">{{info.numWord}}字评论</view>
</view>
<view v-if="index == 1" style="width: 100%;display: flex;justify-content: center;">
<image style="width: 42rpx;height: 42rpx;" :src="nav.iconImg" mode="widthFix"></image>
<view style="margin-left:8rpx" v-if="index == 0">{{info.numStar}}星好评</view>
<view style="margin-left:8rpx" v-if="index == 1">{{info.numImg}}张配图</view>
<view style="margin-left:8rpx" v-if="index == 2">{{info.numWord}}字评论</view>
</view>
<view v-if="index == 2" style="width: 100%;display: flex;justify-content: flex-end;">
<image style="width: 42rpx;height: 42rpx;" :src="nav.iconImg" mode="widthFix"></image>
<view style="margin-left:8rpx" v-if="index == 0">{{info.numStar}}星好评</view>
<view style="margin-left:8rpx" v-if="index == 1">{{info.numImg}}张配图</view>
<view style="margin-left:8rpx" v-if="index == 2">{{info.numWord}}字评论</view>
</view>
</view>
</view>
</view>
</view>
<view class="fxandfl_view">
<view class="fxandfl_view" style="margin-top: 90px;margin-bottom: 20px;">
<view class="fx_view">
<view class="title">
分享赚钱</view>
<image src="https://bwc.xianmxkj.com/img/20210828/619687edbbc449bb8a75335308272e65.png"
style="width: 204rpx;height: 48rpx;margin: 20rpx 0;"></image>
<view class="btn" @tap="goShareUser">
分享赚钱</view>
</view>
<view class="fx_view" style="margin-left: 20rpx;">
<view style="display: flex;margin-top: 10rpx;">
<image src="https://bwc.xianmxkj.com/img/20210828/b9f040f451304fb4bdc65c64f241b02f.png"
style="width: 88rpx;height: 88rpx;"></image>
<view style="width: 50px;height: 50px;background: #FF4848;border-radius: 50%;">
</view>
<view style="margin-left: 20rpx;margin-top: 10rpx;">
<view style="font-size: 14px;font-family: PingFang SC ;font-weight: 500;color: #000000">
进入番茄饭团福利群</view>
<view
style="font-size: 28rpx;font-family: PingFang SC Medium, PingFang SC Medium-Medium;font-weight: 500;color: #333333;">
粉丝福利号</view>
<view
style="margin-top: 15rpx;font-size: 24rpx;font-family: PingFang SC Medium, PingFang SC Medium-Medium;font-weight: 500;color: #CCCCCC;">
已有999人加入</view>
style="margin-top: 15rpx;font-size: 11px;font-family: PingFang SC;font-weight: 500;color: #000000;">
添加客服微信进入番茄饭团福利群</view>
</view>
<view class="btn" style="margin-top: 28rpx;margin-left: 78rpx;" @tap="fensiImage">
添加</view>
</view>
<!-- <view class="title">
分享赚钱</view> -->
<view class="btn" style="margin-top: 28rpx;" @tap="fensiImage">
立即添加</view>
</view>
</view>
<!-- 品鉴要求 -->
<!-- <view class="schedule-card">
<view class="schedule-card">
<view class="title">
<text>品鉴要求</text>
</view>
<view class="recommend">
<view class="recommend-store1" v-for="(nav, index) in recommendList" :key="index">
<image class="recommend-img" :src="nav.iconImg" mode="widthFix"></image>
<view class="recommend-title" v-if="index == 0">{{info.numStar}}星好评</view>
<view class="recommend-title" v-if="index == 1">{{info.numImg}}张配图</view>
<view class="recommend-title" v-if="index == 2">评论至少{{info.numWord}}</view>
</view>
</view>
</view>
<view class="tit" @tap="navigation(info.latitude,info.longitude,info.goodsTitle)">
<view style="width: 5%;">
<image class="positioning" src="../../static/img/home/dizhi.png" mode="widthFix"></image>
</view>
<view class="address">
<view class="">{{info.city}}{{info.district}}{{info.address}}</view>
<view class="juli">距离{{info.distance}}</view>
</view>
</view>
</view> -->
<view style="width: 128px;height: 22px;font-size: 16px;
font-family: PingFang SC;font-weight: 600;line-height:22px; #000000;margin-bottom: 8px;margin-left: 32px;">
<text>订单返现流程规则</text>
</view>
<view class="schedule-card">
<!-- 优惠流程 -->
<view class="schedule-card">
<view class="title">
<text>优惠流程</text>
</view>
<!-- <view style="width: 128px;height: 22px;font-size: 16px;
font-family: PingFang SC;font-weight: 600;line-height:22px; #000000;margin-bottom: 8px;">
<text>订单返现流程规则</text>
</view> -->
<view class="recommend">
<view style="width: 28%;display: flex;align-items: center;margin-bottom: 15rpx;">
<view style="align-items: center;text-align: center;width: 80%;">
<image class="recommend-img" src="../../static/img/home/qiangdan.png" mode="widthFix">
</image>
<view class="recommend-title">立即抢单</view>
<view class="recommend-title">抢购订单</view>
</view>
<image src="../../static/img/home/jianyou.png" class="jiantou"></image>
</view>
<view style="width: 30%;display: flex;align-items: center;margin-bottom: 15rpx;">
<view style="align-items: center;text-align: center;width: 80%;">
@ -148,22 +108,22 @@
</image>
<view class="recommend-title">外卖平台下单</view>
</view>
<image src="../../static/img/home/jianyou.png" class="jiantou"></image>
</view>
<view style="width: 28%;display: flex;align-items: center;margin-bottom: 15rpx;">
<view style="align-items: center;text-align: center;width: 80%;">
<image class="recommend-img" src="../../static/img/home/uoload.png" mode="widthFix">
</image>
<view class="recommend-title">订单上传</view>
<view class="recommend-title">好评上传</view>
</view>
<image src="../../static/img/home/jianyou.png" class="jiantou"></image>
</view>
<view
style="width: 18%;display: flex;align-items: center;justify-content: center;margin-bottom: 15rpx;">
<view style="align-items: center;text-align: center;width: 80%;">
<image class="recommend-img" src="../../static/img/home/pinjian.png" mode="widthFix">
</image>
<view class="recommend-title">评鉴上传</view>
<view class="recommend-title">返现到账</view>
</view>
</view>
@ -179,7 +139,7 @@
</view>
</view>
<!-- 底部按钮 -->
<view class="footer" v-if="status == 0">
<!-- <view class="footer" v-if="status == 0">
<view class="payinfo" @click="kefu">
<image src="../../static/img/home/kefu.png" mode="widthFix"></image>
<view>客服</view>
@ -189,26 +149,17 @@
<view>地址</view>
</view>
<button class="tui-button-primar" formType="submit" type="primary" @click="btns">{{btnType}}</button>
</view>
<view class="footer" v-if="status == 1 || status == 4">
<view class="payinfo" @click="kefu">
<image src="../../static/img/home/kefu.png" mode="widthFix"></image>
<view>联系客服</view>
</view> -->
<view class="footer">
<view @click="kefu" style="24px;24px">
<image src="../../static/img/home/kefuxin.png" mode="widthFix" style="width: 24px;height: 24px;">
</image>
</view>
<view class="payinfo" style="font-size: 50upx;color: #e6e6e6;">|</view>
<view class="payinfo" @click="fangqi(orderId)">
<image src="../../static/img/home/fqsc.png" mode="widthFix"></image>
<view>放弃任务</view>
<view class="payinfo" @click="btns">
<view>立即抢单</view>
</view>
<view class="payinfo" style="font-size: 50upx;color: #e6e6e6;">|</view>
<view class="payinfo" @click="shangchuan(orderId)">
<image src="../../static/img/home/scpz.png" mode="widthFix"></image>
<view>上传凭证</view>
</view>
<view class="payinfo" style="font-size: 50upx;color: #e6e6e6;">|</view>
<view class="payinfo" @click="goShop">
<image src="../../static/img/home/ljxd.png" mode="widthFix"></image>
<view>立即下单</view>
<view class="payinfo" style="border-radius: 0px 16px 16px 0px;">
<view>复制店名</view>
</view>
</view>
</view>
@ -225,16 +176,16 @@
//
info: {},
items: [{
title: "立即抢单",
title: "抢购订单",
},
{
title: "外卖平台下单",
},
{
title: "订单上传",
title: "好评上传",
},
{
title: "评鉴上传",
title: "返利到账",
},
],
banners: [],
@ -286,14 +237,16 @@
},
onLoad(e) {
this.goodsId = e.goodsId;
console.log(this.goodsId,'goodsid')
this.latitude = e.latitude;
this.longitude = e.longitude;
let token = this.$queue.getData('token');
let userId = this.$queue.getData('userId');
if (!token) {
this.goLogin();
}
// if (!token) {
// this.goLogin();
// }
this.initHelpOrder()
// 202
// 204
// 205
@ -322,19 +275,20 @@
})
},
onShow() {
if (this.goodsId != '') {
this.initHelpOrder(this.goodsId);
}
let userId = this.$queue.getData('userId');
if (userId) {
//
if(this.showModal) {
this.openMsg()
}
}
// if (this.goodsId != '') {
// this.initHelpOrder(this.goodsId);
// }
// let userId = this.$queue.getData('userId');
// if (userId) {
// //
// if(this.showModal) {
// this.openMsg()
// }
// }
},
methods: {
//
openMsg() {
var that = this
@ -355,7 +309,7 @@
uni.setStorageSync('sendorderMsg', false)
uni.showModal({
title: '提示',
content: '为了更好的体验,请绑定消息推送',
content: '为了更好的体验,请绑定消息推送',
confirmText: '确定',
cancelText: '取消',
success: function(res) {
@ -383,8 +337,8 @@
}
})
},
fensiImage(){
if(uni.getStorageSync('sendorderMsg')) {
fensiImage() {
if (uni.getStorageSync('sendorderMsg')) {
uni.requestSubscribeMessage({
tmplIds: this.arr,
success(re) {
@ -398,7 +352,7 @@
console.log(res)
}
})
}
}
let fensiImage = this.$queue.getData('fensiImage');
//#ifndef H5
uni.navigateTo({
@ -541,7 +495,7 @@
this.$queue.showLoading('加载中...');
let that = this;
let userId = this.$queue.getData('userId') ? this.$queue.getData('userId') : 0;
this.$Request.getT('/wm/selectGoodsDetails?goodsId=' + goodsId + '&userId=' + userId + '&latitude=' + this
this.$Request.getT('/wm/selectGoodsDetails?goodsId=' + this.goodsId + '&userId=' + userId + '&latitude=' + this
.latitude + '&longitude=' + this.longitude).then(res => {
if (res.code == 0) {
let image = res.goods.img.split(",");
@ -585,7 +539,7 @@
},
//
kefu() {
if(uni.getStorageSync('sendorderMsg')) {
if (uni.getStorageSync('sendorderMsg')) {
uni.requestSubscribeMessage({
tmplIds: this.arr,
success(re) {
@ -599,14 +553,14 @@
console.log(res)
}
})
}
}
uni.navigateTo({
url: '/pages/my/customer'
});
},
//
btns() {
if(uni.getStorageSync('sendorderMsg')) {
if (uni.getStorageSync('sendorderMsg')) {
uni.requestSubscribeMessage({
tmplIds: this.arr,
success(re) {
@ -620,7 +574,7 @@
console.log(res)
}
})
}
}
this.$queue.showLoading('抢单中...');
let userId = this.$queue.getData('userId');
this.$Request.postT('/wm/insertOrders?goodsId=' + this.goodsId + '&userId=' + userId).then(res => {
@ -658,7 +612,7 @@
},
//
fangqi(id) {
if(uni.getStorageSync('sendorderMsg')) {
if (uni.getStorageSync('sendorderMsg')) {
uni.requestSubscribeMessage({
tmplIds: this.arr,
success(re) {
@ -672,7 +626,7 @@
console.log(res)
}
})
}
}
uni.showModal({
title: '温馨提示',
content: '您是否要放弃当前任务?',
@ -700,7 +654,7 @@
},
//
shangchuan(id) {
if(uni.getStorageSync('sendorderMsg')) {
if (uni.getStorageSync('sendorderMsg')) {
uni.requestSubscribeMessage({
tmplIds: this.arr,
success(re) {
@ -714,13 +668,13 @@
console.log(res)
}
})
}
}
uni.navigateTo({
url: '/pages/order/release?orderId=' + id
});
},
callContact(phone) {
if(uni.getStorageSync('sendorderMsg')) {
if (uni.getStorageSync('sendorderMsg')) {
uni.requestSubscribeMessage({
tmplIds: this.arr,
success(re) {
@ -734,7 +688,7 @@
console.log(res)
}
})
}
}
uni.makePhoneCall({
phoneNumber: phone
});
@ -756,17 +710,16 @@
}
.fxandfl_view {
width: 95%;
// width:100%;
width: 375px;
display: flex;
margin: 25rpx 30rpx;
.fx_view {
width: 335rpx;
height: 226rpx;
opacity: 1;
width: 375px;
height: 113px;
background: #ffffff;
border-radius: 16rpx;
padding: 25rpx 20rpx;
border-radius: 8px;
padding: 12px 18px;
.title {
font-size: 28rpx;
@ -776,17 +729,17 @@
}
.btn {
width: 295rpx;
height: 54rpx;
opacity: 1;
background: #fed00b;
border-radius: 8rpx;
font-size: 24rpx;
font-family: PingFang SC Medium, PingFang SC Medium-Medium;
font-weight: 500;
width: 48px;
height: 19px;
text-align: center;
color: #333333;
line-height: 54rpx;
font-size: 12px;
font-family: PingFang SC;
font-weight: 500;
line-height: 19px;
color: #FFFFFF;
background: linear-gradient(141deg, #FF4848 0%, #FF2929 100%);
opacity: 1;
border-radius: 10px;
}
}
}
@ -873,13 +826,13 @@
}
.user-card-bottom {
width: 690rpx;
height: 326rpx;
margin: -80upx 30upx 0;
width: 343px;
height: 152px;
// margin: 80upx 30upx 0;
margin: 50px 0 100px 20px;
background: #FFFFFF;
padding: 30rpx;
border-radius: 24rpx;
position: absolute;
padding: 15px;
border-radius: 12px;
.first-row {
justify-content: space-between;
@ -928,10 +881,10 @@
.tag-item {
font-size: 12px;
color: #d3a25a;
background: #fff4e5;
border: 2rpx solid #d3a25a;
border-radius: 4rpx;
color: #FF4848;
// background: #fff4e5;
// border: 2rpx solid #d3a25a;
// border-radius: 4rpx;
display: inline-block;
height: 38upx;
line-height: 38upx;
@ -975,6 +928,7 @@
}
.schedule-card {
height: 65px;
background-color: #FFF;
width: 91%;
margin: 25rpx 30rpx;
@ -1040,16 +994,21 @@
}
.recommend-img {
width: 60upx;
width: 30px;
margin-top: 11px;
}
.recommend-title {
font-size: 20upx;
color: #333;
line-height: 40upx;
width: 60px;
height: 14px;
font-size: 10px;
font-family: PingFang SC;
font-weight: 600;
color: #000000;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
margin-top: 4px;
}
.jiantou {
@ -1204,16 +1163,16 @@
justify-content: space-between;
.payinfo {
width: 100rpx;
color: #666;
font-size: 20rpx;
width: 152px;
height: 32px;
background: linear-gradient(127deg, #FF8A6B 0%, #FF2929 100%);
opacity: 1;
border-radius: 17px 0px 0px 15px;
font-size: 12px;
font-weight: 500;
color: #FFFFFF;
line-height: 32px;
text-align: center;
image {
width: 42rpx;
height: 50rpx;
}
}
.payinfo1 {

964
pages/index/tasksdetails.vue

@ -0,0 +1,964 @@
<template>
<view class="page">
<view class="bill">
<swiper class="swiper" autoplay="1500" :indicator-dots="true" :circular='true'
indicator-active-color="#ffffff" indicator-color="#cccccc">
<swiper-item class="swiper-wrap" v-for="(item,index) in banners" :key='index'>
<image :src="item" mode="aspectFill"></image>
</swiper-item>
</swiper>
<!-- <image src="../../static/img/home/xiangqing.png"></image> -->
</view>
<view class="billtextbox">
<view class="billtext">
<view class="left">
<image src="../../static/img/home/huangguan.png"></image>
<p>番茄会员满18元返18元</p>
</view>
<view class="middel">
</view>
<view class="right">
<view class="right a">限时</view>
<view class="right b">抢购</view>
</view>
</view>
</view>
<view class="shop">
<view class="shoptop">
<view class="shoptext">
<view class="left" style="float: left;">
<image src="../../static/img/home/shangjia.png"></image>
</view>
<view class="right">
<view class="shop-name-box">
<image v-if="info.classify == 2" class="item-Logo" mode="aspectFill"
src="/static/img/home/storeLogo.png"></image>
<image v-if="info.classify == 1" class="item-Logo" mode="aspectFill"
src="/static/img/my/eleicon.png"></image>
<text>{{info.merchantName}}</text>
</view>
<view>活动结束时间{{info.endTime}}</view>
<!-- <view>门店地址</view> -->
</view>
</view>
</view>
<view class="line"></view>
<view class="bottom">
<view class="text"> {{info.classify == 1 ? '饿了么' : '美团' }}会员满{{info.memberPrice}}{{info.memberMoney}} </view>
<view class="text" style="margin-left: 8rpx;">{{info.classify == 1 ? '饿了么' : '美团' }}非会员满{{info.price}}{{info.money}} </view>
</view>
</view>
<view class="welfare">
<view class="content">
<view class="top" style="background-color: #0C0C0C;border-radius: 8px 8px 0 0;" v-if="member == 0">
<view style="display: flex;">
<view style="margin-left: 20px;">番茄会员满18元返18元</view>
<view class="button" @tap="goPageLogin('/pages/my/myVIP')">开通会员</view>
</view>
</view>
<view class="bottom">
<view class="bottomcontent" style="display: flex;align-items: center;">
<view class="circle"></view>
<view class="jieshao">
<view style="font-size: 14px;font-family: PingFang SC;font-weight: 500;color: #000000;">
进入番茄饭团福利群</view>
<view style="font-size: 11px;font-family: PingFang SC;font-weight: 500;color: #000000;">
添加客服微信进入番茄饭团福利群</view>
</view>
<view class="add">添加</view>
</view>
</view>
</view>
</view>
<view class="footers">
<view @click="kefu" style="24px;24px">
<image src="../../static/img/home/kefuxin.png" mode="widthFix" style="width: 24px;height: 24px;">
</image>
</view>
<view class="payinfo" @click="btns">
<view>立即抢单</view>
</view>
<view class="payinfo" style="border-radius: 0px 16px 16px 0px;">
<view>复制店名</view>
</view>
</view>
<view class="procedure">订单返现流程规则</view>
<view class="procedurepictrue">
<view class="item">
<image src="../../static/img/home/qianggou.png"></image>
<view>抢购订单</view>
</view>
<view class="item" >
<image src="../../static/img/home/waimai.png" style="margin-left: 20px;"></image>
<view>外卖平台下单</view>
</view>
<view class="item">
<image src="../../static/img/home/haoping.png"></image>
<view>好评上传</view>
</view>
<view class="item">
<image src="../../static/img/home/fanli.png"></image>
<view>返利到账</view>
</view>
</view>
</view>
</template>
<script>
import shmilyDragImage from '@/components/shmily-drag-image/shmily-drag-image.vue'
export default {
components: {
shmilyDragImage
},
data() {
return {
//
info: {},
items: [{
title: "抢购订单",
},
{
title: "外卖平台下单",
},
{
title: "好评上传",
},
{
title: "返利到账",
},
],
banners: [],
imageList: [],
isJieDanUser: false,
activeSteps: -1,
orderId: '',
goodsId: '',
latitude: '',
longitude: '',
isMyOrder: false,
isLogin: false,
recommendList1: [{
iconImg: '../../static/img/home/qiangdan.png',
title: '立即抢单'
},
{
iconImg: '../../static/img/home/wmpt.png',
title: '外卖平台下单'
},
{
iconImg: '../../static/img/home/uoload.png',
title: '订单上传'
},
{
iconImg: '../../static/img/home/pinjian.png',
title: '评鉴上传'
}
],
recommendList: [{
iconImg: '../../static/img/home/star.png',
title: ''
},
{
iconImg: '../../static/img/home/peitu.png',
title: ''
},
{
iconImg: '../../static/img/home/wenzi.png',
title: ''
}
],
btnType: '立即抢单',
status: 1,
id: 0,
arr: [],
showModal: true
}
},
onLoad(e) {
this.goodsId = e.goodsId;
this.latitude = e.latitude;
this.longitude = e.longitude;
let token = this.$queue.getData('token');
let userId = this.$queue.getData('userId');
this.member = this.$queue.getData('member');
// if (!token) {
// this.goLogin();
// }
// 202
// 204
// 205
// 209
let that = this;
that.$Request.getT('/common/type/202').then(res => { //
if (res.code == 0) {
if (res.data && res.data.value) {
that.arr.push(res.data.value)
}
}
})
that.$Request.getT('/common/type/204').then(res => { //
if (res.code == 0) {
if (res.data && res.data.value) {
that.arr.push(res.data.value)
}
}
})
that.$Request.getT('/common/type/205').then(res => { //
if (res.code == 0) {
if (res.data && res.data.value) {
that.arr.push(res.data.value)
}
}
})
},
onShow() {
if (this.goodsId != '') {
this.initHelpOrder(this.goodsId);
}
let userId = this.$queue.getData('userId');
// if (userId) {
// //
// if(this.showModal) {
// this.openMsg()
// }
// }
},
methods: {
//
openMsg() {
var that = this
wx.getSetting({
withSubscriptions: true, //false
success(ret) {
// console.log(ret,'------------------')
// console.log(Object.keys(ret.subscriptionsSetting.itemSettings).length)
// if (JSON.stringify(ret.subscriptionsSetting.itemSettings).indexOf('accept')!=-1) {
if (ret.subscriptionsSetting.itemSettings) {
uni.setStorageSync('sendorderMsg', true)
uni.openSetting({ //
success(rea) {
console.log(rea.authSetting)
}
});
} else { //
uni.setStorageSync('sendorderMsg', false)
uni.showModal({
title: '提示',
content: '为了更好的体验,请绑定消息推送',
confirmText: '确定',
cancelText: '取消',
success: function(res) {
if (res.confirm) {
uni.requestSubscribeMessage({
tmplIds: that.arr,
success(re) {
// console.log(re,'**********')
var datas = JSON.stringify(re);
if (datas.indexOf("accept") != -1) {
console.log(re)
}
},
fail: (res) => {
console.log(res)
}
})
that.showModal = false
} else if (res.cancel) {
that.showModal = true
}
}
})
}
}
})
},
fensiImage() {
if (uni.getStorageSync('sendorderMsg')) {
uni.requestSubscribeMessage({
tmplIds: this.arr,
success(re) {
// console.log(re,'**********')
var datas = JSON.stringify(re);
if (datas.indexOf("accept") != -1) {
console.log(re)
}
},
fail: (res) => {
console.log(res)
}
})
}
let fensiImage = this.$queue.getData('fensiImage');
//#ifndef H5
uni.navigateTo({
url: '/pages/public/webview?url=' + fensiImage
});
//#endif
//#ifdef H5
window.location.href = fensiImage;
//#endif
},
goShareUser() {
uni.navigateTo({
url: '/pages/my/shareFriends'
});
},
navigate(href, e) {
// #ifdef H5
window.location.href = href;
//#endif
//#ifdef APP-PLUS
setTimeout(function() {
plus.runtime.openURL(href);
}, 500);
// #endif
},
navigation(latitude, longitude, name) {
// #ifdef APP-PLUS
let url = "";
if (plus.os.name == "Android") { //
plus.nativeUI.actionSheet({ //
title: "选择地图应用",
cancel: "取消",
buttons: [{
title: "腾讯地图"
}, {
title: "百度地图"
}, {
title: "高德地图"
}]
}, function(e) {
switch (e.index) {
//url,
case 1:
//referer=xxxxxxkey
url = `qqmap://map/geocoder?coord=${latitude},${longitude}&referer=xxx`;
break;
case 2:
url =
`baidumap://map/marker?location=${latitude},${longitude}&title=${name}&coord_type=gcj02&src=andr.baidu.openAPIdemo`;
break;
case 3:
url =
`androidamap://viewMap?sourceApplication=appname&poiname=${name}&lat=${latitude}&lon=${longitude}&dev=0`;
break;
default:
break;
}
if (url != "") {
url = encodeURI(url);
//plus.runtime.openURL(url,function(e){})APP
plus.runtime.openURL(url, function(e) {
plus.nativeUI.alert("本机未安装指定的地图应用");
});
}
})
} else {
// iOSmanifest
// manifest.jsonapp-plus->distribute->apple->urlschemewhitelist
//urlschemewhitelist:["iosamap","baidumap"]
plus.nativeUI.actionSheet({
title: "选择地图应用",
cancel: "取消",
buttons: [{
title: "腾讯地图"
}, {
title: "百度地图"
}, {
title: "高德地图"
}]
}, function(e) {
switch (e.index) {
case 1:
url = `qqmap://map/geocoder?coord=${latitude},${longitude}&referer=xxx`;
break;
case 2:
url =
`baidumap://map/marker?location=${latitude},${longitude}&title=${name}&content=${name}&src=ios.baidu.openAPIdemo&coord_type=gcj02`;
break;
case 3:
url =
`iosamap://viewMap?sourceApplication=applicationName&poiname=${name}&lat=${latitude}&lon=${longitude}&dev=0`;
break;
default:
break;
}
if (url != "") {
url = encodeURI(url);
plus.runtime.openURL(url, function(e) {
plus.nativeUI.alert("本机未安装指定的地图应用");
});
}
})
}
// #endif
// #ifdef MP-WEIXIN
uni.openLocation({
latitude: Number(latitude),
longitude: Number(longitude),
success: function() {
console.log('success');
}
});
// #endif
},
goShop() {
if (this.info.classify == 2) { //
// #ifdef MP-WEIXIN
uni.navigateToMiniProgram({
appId: 'wx2c348cf579062e56',
path: this.info.url,
fail(res) {
console.error(res)
}
})
// #endif
} else if (this.info.classify == 1) { //饿
// #ifdef MP-WEIXIN
uni.navigateToMiniProgram({
appId: 'wxece3a9a4c82f58c9',
path: this.info.url,
fail(res) {
console.error(res)
}
})
// #endif
}
},
initHelpOrder(goodsId) {
this.$queue.showLoading('加载中...');
let that = this;
let userId = this.$queue.getData('userId') ? this.$queue.getData('userId') : 0;
this.$Request.getT('/wm/selectGoodsDetails?goodsId=' + goodsId + '&userId=' + userId + '&latitude=' + this
.latitude + '&longitude=' + this.longitude).then(res => {
if (res.code == 0) {
let image = res.goods.img.split(",");
if (Date.parse(res.goods.endTime.replace('-', '/').replace('-', '/')) < Date.parse(
new Date())) {
console.log('这个已经过期了')
this.status = 99;
} else {
this.status = res.status;
}
this.banners = image;
if (res.orders) {
this.orderId = res.orders.orderId;
}
res.goods.distance = this.setMorKm(res.goods.distance);
this.info = res.goods;
uni.hideLoading();
} else {
this.$queue.showToast(res.msg);
setTimeout(d => {
uni.hideLoading();
uni.navigateBack();
}, 1000);
}
});
},
setMorKm(m) {
var n = ''
if (m) {
if (m >= 1000) {
n = (m / 1000).toFixed(0) + 'km'
} else {
n = parseInt(m) + 'm'
}
} else {
n = '0m'
}
return n
},
//
kefu() {
if (uni.getStorageSync('sendorderMsg')) {
uni.requestSubscribeMessage({
tmplIds: this.arr,
success(re) {
// console.log(re,'**********')
var datas = JSON.stringify(re);
if (datas.indexOf("accept") != -1) {
console.log(re)
}
},
fail: (res) => {
console.log(res)
}
})
}
uni.navigateTo({
url: '/pages/my/customer'
});
},
//
btns() {
if (uni.getStorageSync('sendorderMsg')) {
uni.requestSubscribeMessage({
tmplIds: this.arr,
success(re) {
// console.log(re,'**********')
var datas = JSON.stringify(re);
if (datas.indexOf("accept") != -1) {
console.log(re)
}
},
fail: (res) => {
console.log(res)
}
})
}
this.$queue.showLoading('抢单中...');
let userId = this.$queue.getData('userId');
this.$Request.postT('/wm/insertOrders?goodsId=' + this.goodsId + '&userId=' + userId).then(res => {
if (res.code == 0) {
this.$queue.showToast('抢单成功!');
this.initHelpOrder(this.goodsId);
setTimeout(d => {
if (this.info.classify == 2) { //
// #ifdef MP-WEIXIN
uni.navigateToMiniProgram({
appId: 'wx2c348cf579062e56',
path: this.info.url,
fail(res) {
console.error(res)
}
})
// #endif
} else if (this.info.classify == 1) { //饿
// #ifdef MP-WEIXIN
uni.navigateToMiniProgram({
appId: 'wxece3a9a4c82f58c9',
path: this.info.url,
fail(res) {
console.error(res)
}
})
// #endif
}
}, 500);
} else {
uni.hideLoading();
this.$queue.showToast(res.msg);
}
});
},
//
fangqi(id) {
if (uni.getStorageSync('sendorderMsg')) {
uni.requestSubscribeMessage({
tmplIds: this.arr,
success(re) {
// console.log(re,'**********')
var datas = JSON.stringify(re);
if (datas.indexOf("accept") != -1) {
console.log(re)
}
},
fail: (res) => {
console.log(res)
}
})
}
uni.showModal({
title: '温馨提示',
content: '您是否要放弃当前任务?',
showCancel: true,
cancelText: '取消',
confirmText: '确认',
success: d => {
var that = this;
if (d.confirm) {
console.log('用户点击确定');
that.$queue.showLoading('提交中...');
that.$Request.postT('/wm/abandonOrders?orderId=' + id).then(res => {
if (res.code === 0) {
that.$queue.showToast('已放弃当前任务!');
that.initHelpOrder(that.goodsId);
uni.hideLoading();
} else {
that.$queue.showToast(res.msg);
uni.hideLoading();
}
})
}
}
});
},
//
shangchuan(id) {
if (uni.getStorageSync('sendorderMsg')) {
uni.requestSubscribeMessage({
tmplIds: this.arr,
success(re) {
// console.log(re,'**********')
var datas = JSON.stringify(re);
if (datas.indexOf("accept") != -1) {
console.log(re)
}
},
fail: (res) => {
console.log(res)
}
})
}
uni.navigateTo({
url: '/pages/order/release?orderId=' + id
});
},
callContact(phone) {
if (uni.getStorageSync('sendorderMsg')) {
uni.requestSubscribeMessage({
tmplIds: this.arr,
success(re) {
// console.log(re,'**********')
var datas = JSON.stringify(re);
if (datas.indexOf("accept") != -1) {
console.log(re)
}
},
fail: (res) => {
console.log(res)
}
})
}
uni.makePhoneCall({
phoneNumber: phone
});
},
goLogin() {
this.$queue.setData('href', '/pages/index/taskDetail?helpOrderId=' + this.helpOrderId);
uni.navigateTo({
url: '/pages/public/login'
});
},
goPageLogin(url) {
let token = this.$queue.getData('token');
if (token) {
if (uni.getStorageSync('sendMyMsg')) {
uni.requestSubscribeMessage({
tmplIds: this.arr,
success(re) {
// console.log(re,'**********')
var datas = JSON.stringify(re);
if (datas.indexOf("accept") != -1) {
console.log(re)
}
},
fail: (res) => {
console.log(res)
}
})
}
console.log('是否有token')
uni.navigateTo({
url
})
} else {
this.goLogin();
}
},
}
}
</script>
<style lang="scss">
page {
width: 100%;
margin: 0;
padding: 0;
background-color: #F6F6F6;
padding-bottom: 164rpx;
}
.bill{
width: 100%;
height: 426rpx;
.swiper{
width: 100%;
height: 426rpx;
image{
width: 100%;
display: block;
}
}
}
// .bill image {
// width: 100%;
// height: 208px;
// display: block;
// }
.billtextbox {
width: 100%;
height: 60px;
display: flex;
align-items: center;
background: linear-gradient(48deg, #FF5656 0%, #FF9F74 100%);
}
.billtext {
width: 100%;
margin: 0 16px;
}
.billtext .left {
width: 50%;
height: 23px;
background-color: #000000;
font-size: 14px;
font-family: PingFang SC;
color: #FAD19C;
float: left;
margin-top: 3px;
display: flex;
justify-content: center;
align-items: center;
margin-top: 10px;
}
.billtext .left image {
width: 12px;
height: 12px;
float: left;
margin-top: 2px;
margin-right: 2px;
}
.middel {
width: 0px;
height: 31px;
border: 1px solid #FFFFFF;
float: left;
margin: 0 7px;
margin-top: 6rpx;
}
.billtext .right {
font-size: 15px;
font-family: PingFang SC;
font-weight: 400;
color: #FFFFFF;
}
.text2 {
float: left;
width: 50%;
}
.shop {
margin: 0 16px;
height: 152px;
margin-top: 20rpx;
background-color: #FFFFFF;
border-radius: 8px;
}
.shoptop {
height: 94px;
width: 90%;
margin: 0 auto;
}
.shoptext {
height: 57px;
padding-top: 20px;
}
.shoptext image {
width: 65px;
height: 65px;
}
.shoptext .right {
float: left;
margin-left: 10rpx;
.shop-name-box{
display: flex;
align-items: center;
margin-bottom: 10rpx;
image{
width: 40rpx;
height: 40rpx;
margin-right: 8rpx;
}
}
}
.shop .bottom {
height: 70px;
width: 90%;
margin: 0 auto;
display: flex;
margin-top: 30rpx;
}
.shop .bottom .text {
font-size: 12px;
font-family: PingFang SC;
font-weight: 500;
color: #FF4848;
}
.line {
width: 316px;
height: 1px;
border: 1px solid rgba(112, 112, 112, 0.10980392156862745);
margin: 0 auto;
}
.welfare {
margin: 0 16px;
// height: 138px;
margin-top: 16px;
}
.welfare .top {
color: #FAD19C;
display: flex;
height: 38px;
align-items: center;
}
.welfare .button {
margin-left: 70px;
width: 100px;
height: 24px;
background: #FAD19C;
border-radius: 12px;
font-size: 11px;
font-family: PingFang SC;
color: #000000;
padding-top:5px;
padding-left: 25px;
}
.content .bottom {
height: 100px;
display: flex;
background-color: #FFFFFF;
}
.bottom .circle {
width: 50px;
height: 50px;
background: #FF4848;
border-radius: 50%;
margin-left: 10rpx;
}
.bottom .jieshao {
margin-top: 5px;
margin-left: 10px;
}
.bottom .add {
width: 48px;
height: 19px;
background: linear-gradient(141deg, #FF4848 0%, #FF2929 100%);
opacity: 1;
border-radius: 10px;
font-size: 12px;
font-family: PingFang SC;
font-weight: 500;
color: #FFFFFF;
padding-left: 12px;
padding-top: 2px;
margin-left: 50px;
margin-top: 10px;
}
//
.footers {
width: 100%;
height: 124rpx;
background: #FFFFFF;
position: fixed;
bottom: 0;
padding: 0 20rpx;
z-index: 10;
display: flex;
align-items: center;
justify-content: space-between;
.payinfo {
width: 152px;
height: 64rpx;
background: linear-gradient(127deg, #FF8A6B 0%, #FF2929 100%);
opacity: 1;
border-radius: 17px 0px 0px 15px;
font-size: 12px;
font-weight: 500;
color: #FFFFFF;
line-height: 32px;
text-align: center;
}
.payinfo1 {
width: 25%;
display: inline-block;
}
.tui-button-primar {
width: 60%;
height: 78upx;
line-height: 78upx;
opacity: 1;
background: #ffc705;
border-radius: 16rpx;
}
}
.procedure {
font-size: 32rpx;
font-weight: 600;
color: #000000;
margin-top: 36rpx;
margin-bottom: 16rpx;
padding-left: 64rpx;
}
.procedurepictrue {
height: 130rpx;
background-color: #FFFFFF;
border-radius: 8rpx;
margin: 0 46rpx 20rpx;
display: flex;
justify-content: space-around;
}
.procedurepictrue image{
width: 46rpx;
height: 60rpx;
margin-top: 20rpx;
margin-left: 20rpx ;
}
.procedurepictrue .item{
font-size: 24rpx;
font-weight: 600;
}
</style>

4
pages/member/cash.vue

@ -41,7 +41,6 @@
</view>
</view>
</template>
<script>
export default {
data() {
@ -222,7 +221,6 @@
}
};
</script>
<style lang="less">
@import '../../static/css/index.css';
@ -270,4 +268,4 @@
margin-bottom: 10px;
}
}
</style>
</style>

494
pages/member/feedback.vue

@ -1,306 +1,236 @@
<template>
<view class="page" style="background: #FFFFFF;">
<view>
<view class="feedback-title">
<text>问题和意见</text>
<text @tap="chooseMsg">快速键入</text>
<view class="content">
<view class="title">请选择问题反馈类型</view>
<view class="choicebox">
<view class="choices ">
<view style="float: left;margin-right: 10px;" v-for="(item,index) in choicelist" class="a"
:key="index" :class="{changeStyle:changeSelectStyle == index}" @click="changeStyle(index)">
{{item.name}}
</view>
</view>
</view>
<view style="height: 0px;border: 1px solid rgba(112, 112, 112, 0.10980392156862745);">
</view>
<view>
<textarea auto-height placeholder="请填写15字以上的内容描述,我们将尽快给您回复" v-model="text"
placeholder-style="font-size: 12px;font-family: PingFang SC;font-weight: 400;color: #999999;" />
</view>
</view>
<!-- <text @tap="chooseMsg">快速键入</text> -->
</view>
<view class="feedback-body"><textarea placeholder="请详细描述你的问题和意见..." v-model="sendDate.content" class="feedback-textare" /></view>
<!-- <view class="feedback-body"><textarea placeholder="请详细描述你的问题和意见..." v-model="sendDate.content" class="feedback-textare" /></view>
<view class="feedback-title"><text>QQ/邮箱</text></view>
<view class="feedback-body"><input class="feedback-input" v-model="sendDate.contact" placeholder="方便我们联系你 " /></view>
<view class="feedback-body"><input class="feedback-input" v-model="sendDate.contact" placeholder="方便我们联系你 " /></view> -->
<!-- <view class="feedback-title feedback-star-view">
<text>应用评分</text>
<view class="feedback-star-view">
<text class="feedback-star" v-for="(value, key) in stars" :key="key" :class="key < sendDate.score ? 'active' : ''" @tap="chooseStar(value)"></text>
</view>
</view> -->
<button type="primary" style="background: #ffc705;margin-top: 32upx;" class="feedback-submit" @tap="send">提交</button>
<view type="primary" class="button" @tap="send">提交</view>
</view>
</template>
<script>
export default {
data() {
return {
msgContents: ['界面显示错乱', '启动缓慢,卡出翔了', 'UI无法直视,丑哭了', '偶发性崩溃'],
stars: [1, 2, 3, 4, 5],
imageList: [],
sendDate: {
score: 5,
content: '',
contact: ''
}
};
},
onLoad() {
let deviceInfo = {
appid: plus.runtime.appid,
imei: plus.device.imei, //
p: plus.os.name === 'Android' ? 'a' : 'i', //iiOSaAndroid
md: plus.device.model, //
app_version: plus.runtime.version,
plus_version: plus.runtime.innerVersion, //
os: plus.os.version,
net: '' + plus.networkinfo.getCurrentType()
};
this.sendDate = Object.assign(deviceInfo, this.sendDate);
},
methods: {
close(e) {
this.imageList.splice(e, 1);
},
chooseMsg() {
//
uni.showActionSheet({
itemList: this.msgContents,
success: res => {
this.sendDate.content = this.msgContents[res.tapIndex];
}
});
},
chooseImg() {
//
uni.chooseImage({
sourceType: ['camera', 'album'],
sizeType: 'compressed',
count: 8 - this.imageList.length,
success: res => {
this.imageList = this.imageList.concat(res.tempFilePaths);
}
});
},
chooseStar(e) {
//
this.sendDate.score = e;
},
previewImage() {
//
uni.previewImage({
urls: this.imageList
});
},
send() {
//
console.log(JSON.stringify(this.sendDate));
export default {
data() {
return {
msgContents: ['界面显示错乱', '启动缓慢,卡出翔了', 'UI无法直视,丑哭了', '偶发性崩溃'],
stars: [1, 2, 3, 4, 5],
imageList: [],
sendDate: {
score: 5,
content: '',
contact: ''
},
text: '',
choicelist: [{
"name": "其他反馈"
},
{
"name": "优化建议"
},
if (!this.sendDate.content) {
uni.showToast({
icon: 'none',
title: '请输入反馈内容'
});
return;
}
if (!this.sendDate.contact) {
uni.showToast({
icon: 'none',
title: '请填写QQ或邮箱'
],
changeSelectStyle: '',
isshow: true
};
},
// onLoad() {
// let deviceInfo = {
// appid: plus.runtime.appid,
// imei: plus.device.imei, //
// p: plus.os.name === 'Android' ? 'a' : 'i', //iiOSaAndroid
// md: plus.device.model, //
// app_version: plus.runtime.version,
// plus_version: plus.runtime.innerVersion, //
// os: plus.os.version,
// net: '' + plus.networkinfo.getCurrentType()
// };
// this.sendDate = Object.assign(deviceInfo, this.sendDate);
// },
methods: {
close(e) {
this.imageList.splice(e, 1);
},
changeStyle(index) {
this.changeSelectStyle = index;
},
chooseMsg() {
//
uni.showActionSheet({
itemList: this.msgContents,
success: res => {
this.sendDate.content = this.msgContents[res.tapIndex];
}
});
return;
}
// uni.report('', this.sendDate);
this.$queue.showLoading('加载中...');
this.$Request
.postJson('/message/add', {
state: 2,
title: this.sendDate.contact,
content: JSON.stringify(this.sendDate)
})
.then(res => {
if (res.code === 0) {
uni.showToast({
title: '反馈成功'
});
setTimeout(function() {
uni.navigateBack();
}, 1000);
} else {
uni.hideLoading();
uni.showModal({
showCancel: false,
title: '反馈失败',
content: res.msg
});
},
chooseImg() {
//
uni.chooseImage({
sourceType: ['camera', 'album'],
sizeType: 'compressed',
count: 8 - this.imageList.length,
success: res => {
this.imageList = this.imageList.concat(res.tempFilePaths);
}
});
},
chooseStar(e) {
//
this.sendDate.score = e;
},
previewImage() {
//
uni.previewImage({
urls: this.imageList
});
},
send() {
//
console.log(JSON.stringify(this.sendDate));
if (!this.sendDate.content) {
uni.showToast({
icon: 'none',
title: '请输入反馈内容'
});
return;
}
if (!this.sendDate.contact) {
uni.showToast({
icon: 'none',
title: '请填写QQ或邮箱'
});
return;
}
// uni.report('', this.sendDate);
this.$queue.showLoading('加载中...');
this.$Request
.postJson('/message/add', {
state: 2,
title: this.sendDate.contact,
content: JSON.stringify(this.sendDate)
})
.then(res => {
if (res.code === 0) {
uni.showToast({
title: '反馈成功'
});
setTimeout(function() {
uni.navigateBack();
}, 1000);
} else {
uni.hideLoading();
uni.showModal({
showCancel: false,
title: '反馈失败',
content: res.msg
});
}
});
}
}
}
};
};
</script>
<style>
@font-face {
font-family: uniicons;
font-weight: normal;
font-style: normal;
src: url('https://img-cdn-qiniu.dcloud.net.cn/fonts/uni.ttf') format('truetype');
}
page {
background-color: #FFFFFF;
}
view {
font-size: 28upx;
}
.input-view {
font-size: 28upx;
}
.close-view {
text-align: center;
line-height: 14px;
height: 16px;
width: 16px;
border-radius: 50%;
background: #ff5053;
color: #ffffff;
position: absolute;
top: -6px;
right: -4px;
font-size: 12px;
}
/* 上传 */
.uni-uploader {
flex: 1;
flex-direction: column;
}
.uni-uploader-head {
display: flex;
flex-direction: row;
justify-content: space-between;
}
.uni-uploader-info {
color: #b2b2b2;
}
.uni-uploader-body {
margin-top: 16upx;
}
.uni-uploader__files {
display: flex;
flex-direction: row;
flex-wrap: wrap;
}
.uni-uploader__file {
margin: 10upx;
width: 210upx;
height: 210upx;
}
.uni-uploader__img {
display: block;
width: 210upx;
height: 210upx;
}
.uni-uploader__input-box {
position: relative;
margin: 10upx;
width: 208upx;
height: 208upx;
border: 2upx solid #d9d9d9;
}
.uni-uploader__input-box:before,
.uni-uploader__input-box:after {
content: ' ';
position: absolute;
top: 50%;
left: 50%;
-webkit-transform: translate(-50%, -50%);
transform: translate(-50%, -50%);
background-color: #d9d9d9;
}
.uni-uploader__input-box:before {
width: 4upx;
height: 79upx;
}
.uni-uploader__input-box:after {
width: 79upx;
height: 4upx;
}
.uni-uploader__input-box:active {
border-color: #999999;
}
.uni-uploader__input-box:active:before,
.uni-uploader__input-box:active:after {
background-color: #999999;
}
.uni-uploader__input {
position: absolute;
z-index: 1;
top: 0;
left: 0;
width: 100%;
height: 100%;
opacity: 0;
}
page {
background-color: #F6F6F6;
}
.feedback-title {
height: 200px;
background: #FFFFFF;
opacity: 1;
border-radius: 6px;
margin: 0 16px;
margin-top: 16px;
}
/*问题反馈*/
.feedback-title {
display: flex;
flex-direction: row;
justify-content: space-between;
align-items: center;
padding: 20upx;
color: #8f8f94;
font-size: 28upx;
}
.feedback-star-view.feedback-title {
justify-content: flex-start;
margin: 0;
}
.feedback-quick {
position: relative;
padding-right: 40upx;
}
.feedback-quick:after {
font-family: uniicons;
font-size: 40upx;
content: '\e581';
position: absolute;
right: 0;
top: 50%;
color: #bbb;
-webkit-transform: translateY(-50%);
transform: translateY(-50%);
}
.feedback-body {
font-size: 32upx;
padding: 16upx;
margin: 16upx;
border-radius: 16upx;
background: #F8F8F8;
}
.feedback-textare {
height: 200upx;
font-size: 34upx;
line-height: 50upx;
width: 100%;
box-sizing: border-box;
padding: 20upx 30upx 0;
}
.feedback-input {
font-size: 32upx;
height: 60upx;
padding: 15upx 20upx;
line-height: 60upx;
}
.feedback-uploader {
padding: 22upx 20upx;
}
.feedback-star {
font-family: uniicons;
font-size: 40upx;
margin-left: 6upx;
}
.feedback-star-view {
margin-left: 20upx;
}
.feedback-star:after {
content: '\e408';
}
.feedback-star.active {
color: #ffb400;
}
.feedback-star.active:after {
content: '\e438';
}
.feedback-submit {
background: #007aff;
color: #ffffff;
margin: 20upx;
}
.feedback-title .content {
margin: 0 16px;
}
.feedback-title .title {
padding-top: 12px;
margin-bottom: 8rpx;
font-size: 14px;
font-family: PingFang SC;
font-weight: 400;
color: #000000;
}
.feedback-submit {
background: #007aff;
color: #ffffff;
margin: 20upx;
}
.choicebox {
height: 32px;
}
.choices {
padding-top: 10px;
margin-bottom: 8px;
}
.a {
background: #F5F5F5;
border: 1px solid #999999;
opacity: 1;
border-radius: 2px;
color: #999999;
}
.button {
width: 120px;
height: 24px;
background: linear-gradient(141deg, #FF4848 0%, #FF2929 100%);
opacity: 1;
border-radius: 12px;
font-size: 11px;
font-family: PingFang SC;
font-weight: 400;
color: #FFFFFF;
padding-top: 4px;
padding-left: 50px;
margin: 0 auto;
margin-top: 10px;
}
.changeStyle {
background: #F8E3DF;
border: 1px solid #FF6A6A;
opacity: 1;
border-radius: 2px;
color: #FF7171;
}
</style>

116
pages/my/account.vue

@ -1,116 +0,0 @@
<template>
<view class="container">
<view class="list-cell b-b" @click="navTo('/pages/member/zhifubao')" hover-class="cell-hover"
:hover-stay-time="50">
<text class="cell-tit">支付宝账号</text>
<text class="right cuIcon-right"></text>
</view>
<view class="list-cell b-b" @click="navTo('/pages/member/mimi')" hover-class="cell-hover"
:hover-stay-time="50">
<text class="cell-tit">隐私政策</text>
<text class="right cuIcon-right"></text>
</view>
<view class="list-cell b-b" @click="navTo('/pages/member/xieyi')" hover-class="cell-hover"
:hover-stay-time="50">
<text class="cell-tit">用户协议</text>
<text class="right cuIcon-right"></text>
</view>
<view class="list-cell b-b" @click="navTo('/pages/member/feedback')" hover-class="cell-hover"
:hover-stay-time="50">
<text class="cell-tit">意见反馈</text>
<text class="right cuIcon-right"></text>
</view>
</view>
</template>
<script>
export default {
data() {
return {};
},
onShow() {
},
methods: {
navTo(url) {
let token = this.$queue.getData("token");
if (token) {
uni.navigateTo({
url: url
});
} else {
uni.navigateTo({
url: '/pages/public/login'
});
}
}
}
}
</script>
<style lang='scss'>
page {
background: $page-color-base;
}
.right-txt {
display: flex;
align-items: center;
}
.list-cell {
display: flex;
align-items: baseline;
padding: 20upx $page-row-spacing;
line-height: 60upx;
position: relative;
background: #fff;
justify-content: center;
&.log-out-btn {
margin-top: 40upx;
.cell-tit {
color: $uni-color-primary;
text-align: center;
margin-right: 0;
}
}
&.cell-hover {
background: #fafafa;
}
&.b-b:after {
left: 32upx;
}
&.m-t {
margin-top: 18upx;
}
.cell-more {
align-self: baseline;
font-size: $font-lg;
color: $font-color-light;
margin-left: 12upx;
}
.cell-tit {
flex: 1;
font-size: $font-base + 2upx;
color: $font-color-dark;
margin-right: 12upx;
}
.cell-tip {
font-size: $font-base;
color: $font-color-light;
}
switch {
transform: translateX(8px) scale(.84);
}
}
</style>

82
pages/my/cooperation.vue

@ -1,23 +1,27 @@
<template>
<view class="page" style="background: #FFFFFF;">
<view class="feedback-title"><text>店铺名称</text></view>
<view class="title">商家信息填写</view>
<view class="feedback-title">店铺名称</view>
<view class="feedback-body"><input class="feedback-input" v-model="name" placeholder="请输入您的店铺名称" /></view>
<view class="feedback-title"><text>姓名</text></view>
<view class="feedback-title">联系人姓名</view>
<view class="feedback-body"><input class="feedback-input" v-model="username" placeholder="请输入您的真实姓名" /></view>
<view class="feedback-title"><text>联系电话</text></view>
<view class="feedback-title">手机号</view>
<view class="feedback-body"><input class="feedback-input" v-model="phone" maxlength="11"
placeholder="请输入您的电话号码" /></view>
<view class="feedback-title"><text>地址信息</text></view>
<!-- <view class="feedback-title"><text>地址信息</text></view>
<view class="feedback-body"><input @tap="dingwei" disabled="false" class="feedback-input" v-model="address"
placeholder="请选择地址信息" /></view>
<view class="feedback-title">
<text>详细位置</text>
</view>
<view class="feedback-body"><textarea placeholder="小区楼栋/乡村名称" v-model="content" class="feedback-textare" />
</view>
</view> -->
<button type="primary" style="background: #ffc705;margin-top: 32upx;text-align: center;" class="feedback-submit"
@tap="send">提交</button>
<button type="primary" style="width: 152px;margin: 0 auto;
height: 32px;background: linear-gradient(141deg, #FF4848 0%, #FF2929 100%);
border-radius: 16px;" class="feedback-submit" @tap="send">
<p>提交申请</p>
</button>
</view>
</template>
@ -56,7 +60,7 @@
console.log('详细地址:' + res.address);
console.log('纬度:' + res.latitude);
console.log('经度:' + res.longitude);
that.initLocation(res.latitude,res.longitude);
that.initLocation(res.latitude, res.longitude);
}
});
},
@ -83,31 +87,31 @@
},
send() {
let userId = this.$queue.getData('userId');
if(this.name === ''){
if (this.name === '') {
this.$queue.showToast('请输入您的店铺名称');
return;
}
if(this.username === ''){
if (this.username === '') {
this.$queue.showToast('请输入您的真实姓名');
return;
}
if(this.phone.length != 11){
if (this.phone.length != 11) {
this.$queue.showToast('请输入您正确的电话号码');
return;
}
if(this.city === ''){
this.$queue.showToast('请选择您的地址信息');
return;
}
if(this.content === ''){
this.$queue.showToast('请输入详细位置');
return;
}
// if (this.city === '') {
// this.$queue.showToast('');
// return;
// }
// if (this.content === '') {
// this.$queue.showToast('');
// return;
// }
let data = {
"address": this.content,
"city": this.city,
@ -155,6 +159,16 @@
font-size: 28upx;
}
.title {
font-size: 15px;
font-family: PingFang SC;
font-weight: 600;
color: #000000;
opacity: 1;
padding: 0 20upx;
margin-bottom: 8px;
}
/*问题反馈*/
.feedback-title {
display: flex;
@ -163,8 +177,8 @@
align-items: center;
padding: 0 20upx;
color: #333;
font-size: 16px;
font-weight: 600;
font-size: 15px;
font-weight: 500;
}
.feedback-body {
@ -239,17 +253,10 @@
text {
margin-left: 20upx;
color: #333333;
font-size: 28upx;
font-size: 11upx;
}
button {
flex: 1;
padding: 0;
margin: 0;
border: none;
background: transparent;
text-align: left;
}
button::after {
border: none;
@ -273,4 +280,9 @@
uni-text {
font-size: 32upx;
}
button p {
line-height: 32px;
font-size: 12px;
}
</style>

4
pages/my/customer.vue

@ -3,12 +3,12 @@
<view style="text-align: center;background: #FFFFFF;padding: 40upx;border-radius: 32upx;">
<view style="font-size: 38upx;color: #000000">添加客服微信咨询</view>
<view style="font-size: 32upx;margin-top: 32upx;color: #000000">微信号{{weixin}}</view>
<view @click="copyHref" style="width:200upx;margin-top: 32upx;font-size: 30upx;margin-left: 36%;color: #FFFFFF;background: #ffc705;padding: 4upx 20upx;border-radius: 24upx;">一键复制</view>
<view @click="copyHref" style="width:200upx;margin-top: 32upx;font-size: 30upx;margin-left: 36%;color: #FFFFFF;background: #FF2B2B;padding: 4upx 20upx;border-radius: 24upx;">一键复制</view>
<image @click="saveImg" mode="aspectFit" style="margin-top: 32upx" :src="image"></image>
<button open-type="contact"
style="width:400upx;margin-top: 32upx;font-size: 30upx;margin-left: 17%;color: #FFFFFF;background: #ffc705;border-radius: 24upx;">
style="width:400upx;margin-top: 32upx;font-size: 30upx;margin-left: 17%;color: #FFFFFF;background: #FF2B2B;border-radius: 24upx;">
在线客服</button>
<view style="font-size: 28upx;color: #000000;margin-top: 32upx" v-if="isWeiXin">{{ isWeiXin ? '长按识别上方二维码' : '' }}</view>

441
pages/my/index.vue

@ -1,8 +1,9 @@
<template>
<view class="container">
<view class="container" style="position: relative;">
<view class="header">
<image src="../../static/img/my/mybackgorund.png" class="header-bg"></image>
<!-- <image src="../../static/img/my/user-bj.png" class="user-bj"></image> -->
<view class="user-box">
<view class="user-box" style="z-index:1;position: relative;">
<view class="user-info-box">
<view class="avatar" @tap="checkLogin()">
<image :src="avatar"></image>
@ -18,132 +19,92 @@
</text>
<!-- #endif -->
</view>
<text class="code" v-if="member == 1">会员到期时间{{endTime}}</text>
<view v-if="member == 0" class="nohuiyuan">
暂未成为会员</view>
<view v-if="member == 1" class="isVip">
<image src="../../static/img/my/vip-icon.png"></image>
<text class="code">会员到期时间{{endTime.split(' ')[0]}}</text>
</view>
<view v-if="member == 0" class="nohuiyuan">暂未成为会员</view>
</view>
<view class="noLogin" @tap="checkLogin()" v-else>登录</view>
<!-- <view class="sellers-in" style="position: absolute;right: 0;"
@tap="goPageLogin('/pages/my/cooperation')">
<view class="text" style="position: absolute;right: 10px;">
商户入驻<u-icon name="arrow-right" color="#FFFFFF" size="28"></u-icon>
</view>
</view> -->
</view>
<!-- <view class="info-icon" @tap="goPageLogin('/pages/task/renwu')">
<image src="../../static/img/my/info.png"></image>
</view> -->
</view>
<view class="huiyuan_view">
<image src="../../static/img/my/huiyuanmy.png"></image>
<view class="huiyuan_view_item" @tap="goPageLogin('/pages/my/myVIP')">
<image src="../../static/img/my/huiyuanmy.png"></image>
<view class="kaitong" v-if="member == 0">立即开通</view>
<view class="kaitong" v-if="member == 1">我的权益</view>
<view class="btn-box">
<!-- <view class="text">开通番茄会员邀请好友下单赚钱</view> -->
<view class="kaitong" v-if="member == 0"> 开通会员 </view>
<view class="kaitong" v-if="member == 1"> 我的权益 </view>
</view>
</view>
</view>
<!-- <view style="display: flex;">
<view class="money-header" style="z-index:1;position: relative;">
<view class="title">我的收益 (积分)</view>
<view>0</view>
</view>
<view class="title_right" @tap="goPageLogin('/pages/member/chongzhi')">
<button type="default" class="btn-click">积分兑换</button>
</view>
</view> -->
<view class="jifen_view">
<view style="display: flex;">
<view class="title">我的积分</view>
<view class="title_right" @tap="goPageLogin('/pages/member/chongzhi')">
<view class="right_name">立即兑换</view>
<image src="../../static/img/my/right_icon.png"></image>
</view>
<view class="jifen_view" style="z-index:1;position: relative;">
<view class="title">
<text>我的积分</text>
<view class="title_right" @tap="goPageLogin('/pages/member/chongzhi')">积分兑换</view>
</view>
<view class="jifen_item">
<view class="item_view" @tap="goPageLogin('/pages/member/jifen')">
<view class="money">{{sumMoney}}</view>
<view class="text">我的总收益</view>
</view>
<view class="item_view" @tap="goPageLogin('/pages/my/my')">
<view class="money">{{teamMoney}}</view>
<view class="text">团队收益</view>
<view class="item_view" @tap="goPageLogin('/pages/member/chongzhi')">
<view class="money">{{jifenJson.totalMoney}}</view>
<view class="text">总积分</view>
</view>
<view class="item_view" @tap="goPageLogin('/pages/member/chongzhi')">
<view class="money">{{money}}</view>
<view class="money">{{jifenJson.convertibleMoney}}</view>
<view class="text">可兑换</view>
</view>
<view class="item_view" @tap="goPageLogin('/pages/member/cashList')">
<view class="money">{{cashMoney}}</view>
<view class="item_view" @tap="goPageLogin('/pages/member/chongzhi')">
<view class="money">{{jifenJson.exchangedMoney}}</view>
<view class="text">已兑换</view>
</view>
</view>
</view>
<view class="fxandfl_view">
<view class="fx_view" @tap="goPageLogin('/pages/my/teamList')">
<view class="title">我的团队</view>
<view class="btn" @tap="goShareUser">团队成员 <text style="color: #ffc705;">{{oneUserCount}}</text> </view>
</view>
<view class="fx_view" style="margin-left: 20rpx;" @tap="goPageLoginS('/pages/order/index')">
<view class="title">我的作业</view>
<view class="btn" @tap="goShareUser">查看全部作业</view>
</view>
</view>
</view>
<view style="width: 91%;margin: 25rpx 30rpx;padding-bottom: 20rpx;" class="tools">
<view style="margin: 0 16px;padding-bottom: 20rpx;" class="tools">
<!-- @tap="href(7)" -->
<view class="tui-box tui-tool-box" style="margin:0 auto;padding-bottom: 20rpx;">
<view class="tui-cell-header">
<view class="tui-cell-title">常用工具</view>
</view>
<view class="tui-order-list tui-flex-wrap">
<view class="tui-tool-item" @tap="goPageLoginAndChannel('/pages/my/mychannel')">
<view class="tui-icon-box">
<image src="https://bwc.xianmxkj.com/img/20210828/2e474854f47242bb8a5c5a43bb1f15dc.png"
class="tui-tool-icon"></image>
</view>
<view class="tui-tool-text">我的渠道</view>
</view>
<view class="tui-tool-item"
@tap="goPageLoginAndNoChannel('/pages/my/savechannel')">
<view class="tui-icon-box">
<image src="https://bwc.xianmxkj.com/img/20210828/2b1381937f8549aebdf337c15c15aa07.png"
class="tui-tool-icon"></image>
</view>
<view class="tui-tool-text">渠道申请</view>
</view>
<view class="tui-box" style="margin:0 auto;">
<view class="tui-cell-header">番茄服务</view>
<view class="tui-tool-box">
<view class="tui-tool-item" @tap="goPageLogin('/pages/my/customer')">
<view class="tui-icon-box">
<image src="https://bwc.xianmxkj.com/img/20210828/bd4d235c082e4f9e8e62256e50cb2f02.png"
class="tui-tool-icon"></image>
</view>
<view class="tui-tool-text">联系客服</view>
</view>
<view class=" tui-tool-item" @tap="goPageLogin('/pages/my/ranking')">
<view class="tui-icon-box">
<image src="https://bwc.xianmxkj.com/img/20210828/aeb37b2be17d40829fb05650d17e819b.png"
class="tui-tool-icon"></image>
<image src="../../static/img/my/callus.png" class="tui-tool-icon"></image>
</view>
<view class="tui-tool-text ">我的邀请</view>
<view class="tui-tool-text">联系我们</view>
</view>
<view class=" tui-tool-item" @tap="goPageLogin('/pages/my/cooperation')">
<view class=" tui-tool-item" @tap="goPageLogin('/pages/my/setting')">
<view class="tui-icon-box">
<image src="https://bwc.xianmxkj.com/img/20210828/d313e7e10452488fb14814d3081ef5ae.png"
class="tui-tool-icon"></image>
<image src="../../static/img/my/setting.png" class="tui-tool-icon"></image>
</view>
<view class="tui-tool-text">商户合作</view>
<view class="tui-tool-text">设置</view>
</view>
<view class="tui-tool-item" v-if="userId && shopIsEn != ''" @tap='goShop()'>
<view class="tui-icon-box">
<image src="https://bwc.xianmxkj.com/img/20210828/ac03a1a4c9564abdad2922f5221b1677.png"
class="tui-tool-icon"></image>
</view>
<view class="tui-tool-text">前往商户端</view>
</view>
<view class=" tui-tool-item" @tap="goPageLogin('/pages/my/account')">
<view class="tui-icon-box">
<image src="https://bwc.xianmxkj.com/img/20210828/888ca256b4814a9d95c8cb97dba707c2.png"
class="tui-tool-icon"></image>
</view>
<view class="tui-tool-text">设置中心</view>
</view>
<view class=" tui-tool-item" v-if="userId" @tap='loginOut()'>
<!-- <view class=" tui-tool-item" v-if="userId" @tap='loginOut()'>
<view class="tui-icon-box">
<image src="https://bwc.xianmxkj.com/img/20210828/e8f096d23a5c4cb0bf0f716901e0ce9a.png"
class="tui-tool-icon"></image>
</view>
<view class="tui-tool-text">退出登录</view>
</view>
</view> -->
</view>
</view>
</view>
@ -289,14 +250,16 @@
oneUserCount: 0, //
stayMoney: 0, //
teamMoney: 0, //
sumMoney: 0 ,//
sumMoney: 0, //
arr: [],
showModal: true
showModal: true,
jifenJson: {}
}
},
onLoad() {
let that = this;
this.userId = this.$queue.getData('userId')
that.$Request.getT('/common/type/203').then(res => { //
if (res.code == 0) {
if (res.data && res.data.value) {
@ -304,7 +267,7 @@
}
}
})
that.$Request.getT('/common/type/207').then(res => { //
if (res.code == 0) {
if (res.data && res.data.value) {
@ -312,9 +275,17 @@
}
}
})
},
onShow() {
this.$Request.getT('/userMoney/userMoneyDetail?userId=' + this.userId).then(res => { //
if (res.code == 0) {
console.log(res)
this.jifenJson = res.data
}
})
let shopAppId = this.$queue.getData('shopAppId');
if (shopAppId) {
this.shopAppId = shopAppId;
@ -351,10 +322,10 @@
this.getUserInfointegral(this.userId);
this.getUserInfoSumMoney(this.userId);
this.checkChannel();
//
if (this.showModal) {
this.openMsg()
// this.openMsg()
}
}
},
@ -700,7 +671,12 @@
.header {
width: 100%;
background: #F3F5F7;
.header-bg{
width: 100%;
height: 590rpx;
position: absolute;
z-index:0
}
.user-bj {
width: 100%;
height: 370upx;
@ -709,12 +685,12 @@
.user-box {
width: 100%;
height: 250upx;
// height: 250upx;
z-index: 15;
padding: 150upx 30upx 0;
padding: 15px 15px 6px 32px;
display: flex;
align-items: center;
margin-bottom: 20rpx;
.user-info-box {
flex: 1;
height: 100%;
@ -735,7 +711,6 @@
}
.noLogin {
display: flex;
display: flex;
flex-direction: column;
margin-left: 20upx;
@ -743,13 +718,11 @@
font-weight: 800;
color: #333333;
}
.user-info {
display: flex;
display: flex;
flex-direction: column;
margin-left: 20upx;
.nick-wrap {
display: flex;
align-items: center;
@ -760,8 +733,6 @@
font-family: PingFang SC Bold, PingFang SC Bold-Bold;
font-weight: 700;
color: #333333;
}
.nick_image {
@ -788,30 +759,32 @@
margin-top: 10rpx;
width: 150rpx;
height: 34rpx;
opacity: 1;
border: 3rpx solid #b28957;
border: 3rpx solid #0C0C0C;
border-radius: 18rpx;
font-size: 20rpx;
font-family: PingFang SC Medium, PingFang SC Medium-Medium;
font-weight: 500;
text-align: center;
color: #c9ab76;
color: #0C0C0C;
line-height: 34rpx;
}
.code {
.isVip{
display: flex;
align-items: center;
height: 45upx;
font-size: 24upx;
font-family: PingFang SC;
font-weight: 500;
color: #999;
image{
width: 24rpx;
height: 24rpx;
margin-right: 4rpx;
}
.code {
display: flex;
align-items: center;
// height: 45upx;
font-size: 20rpx;
font-weight: 500;
color: #0C0C0C;
}
}
}
}
.info-icon {
@ -858,119 +831,102 @@
}
.huiyuan_view {
width: 690rpx;
height: 90rpx;
width: 686rpx;
height: 96rpx;
margin: 0 auto;
opacity: 1;
margin: 30rpx;
position: relative;
background-color: #0C0C0C;
border-radius: 16rpx;
image{
width: 100%;
height: 96rpx;
position: absolute;
z-index: 1;
}
.huiyuan_view_item {
width: 690rpx;
height: 90rpx;
image {
width: 690rpx;
height: 90rpx;
position: absolute;
z-index: 1;
margin: 0 22rpx;
width: 100%;
height: 96rpx;
display: flex;
align-items: center;
position: absolute;
z-index: 2;
.text {
font-size: 12px;
font-family: PingFang SC;
font-weight: 400;
color: #FAD19C;
z-index: 2;
margin-top: 4px;
}
.btn-box{
display: flex;
justify-content: flex-end;
align-items: center;
width: 100%;
height: 100%;
padding-right: 26rpx;
}
.kaitong {
text-align: right;
width: 85%;
position: absolute;
font-size: 24rpx;
font-family: PingFang SC Medium, PingFang SC Medium-Medium;
font-weight: 500;
color: #e3b97e;
line-height: 90rpx;
z-index: 1;
width: 200rpx;
height: 64rpx;
background: linear-gradient(214deg, #FAD19C 0%, #FCBC66 100%);
border-radius: 32rpx;
text-align: center;
line-height: 64rpx;
font-size: 28rpx;
color: #000;
}
}
}
.jifen_view {
width: 690rpx;
opacity: 1;
background: #ffffff;
border-radius: 24rpx;
padding: 30rpx;
padding: 30rpx 0;
margin: 30rpx;
.title{
width: 100%;
padding:0 0 6rpx 30rpx;
border-bottom: 2rpx solid #D2D2D2;
position: relative;
.title_right {
width: 112rpx;
height: 36rpx;
line-height: 36rpx;
background: linear-gradient(141deg, #FF4848 0%, #FF2929 100%);
border-radius: 20rpx;
font-size: 22rpx;
color: #fff;
text-align: center;
position: absolute;
top: -46rpx;
right: 22rpx;
}
}
.jifen_item {
display: flex;
justify-content: space-around;
width: 100%;
padding: 0 30rpx;
.item_view {
width: 25%;
text-align: center;
margin-top: 50rpx;
.money {
font-size: 38rpx;
font-family: DIN Bold, DIN Bold-Bold;
font-weight: 700;
color: #ffc705;
font-size: 36rpx;
color: #FF5543;
}
.text {
margin-top: 15rpx;
font-size: 24rpx;
font-family: PingFang SC Regular, PingFang SC Regular-Regular;
font-weight: 400;
color: #999999;
}
}
.item_view_left {
width: 25%;
text-align: center;
margin-top: 50rpx;
padding-right: 20rpx;
.money {
font-size: 38rpx;
font-family: DIN Bold, DIN Bold-Bold;
font-weight: 700;
color: #ffc705;
}
.text {
margin-top: 15rpx;
font-size: 24rpx;
font-family: PingFang SC Regular, PingFang SC Regular-Regular;
font-weight: 400;
color: #999999;
color: #000000;
}
}
}
.title {
width: 50%;
font-size: 32rpx;
font-family: PingFang SC Bold, PingFang SC Bold-Bold;
font-weight: 700;
color: #333333;
}
.title_right {
width: 50%;
align-items: center;
display: flex;
justify-content: flex-end;
image {
width: 11rpx;
height: 18rpx;
margin-left: 10rpx;
}
.right_name {
font-size: 24rpx;
font-family: PingFang SC Medium, PingFang SC Medium-Medium;
font-weight: 500;
color: #999999;
}
}
}
.info-jifen {
@ -1079,36 +1035,31 @@
font-weight: 500;
}
}
}
.main {
.integrals-box {
margin-bottom: 50rpx;
margin-top: 40upx;
background-color: #FFF;
padding: 10upx 34upx 10upx 40upx;
}
}
.tui-order-text,
.tui-tool-text {
font-size: 26rpx;
font-weight: 400;
color: #666;
padding-top: 16rpx;
font-size: 22rpx;
color: #000000;
}
.tui-tool-text {
font-size: 24rpx;
.tui-icon-box image {
width: 48rpx;
height: 48rpx;
}
.tui-order-list {
width: 100%;
height: fit-content;
padding: 0 30rpx;
height: 60px;
padding: 0 10px;
box-sizing: border-box;
display: flex;
align-items: center;
@ -1124,6 +1075,7 @@
.tui-box {
width: 100%;
height: 120px;
background: #fff;
box-shadow: 0 3rpx 20rpx rgba(183, 183, 183, 0.3);
border-radius: 10rpx;
@ -1133,11 +1085,10 @@
.tui-cell-header {
width: 100%;
height: 74rpx;
line-height: 74rpx;
padding: 0 26rpx;
box-sizing: border-box;
display: flex;
align-items: center;
justify-content: space-between;
border-bottom: 2rpx solid #D2D2D2;
}
.tui-cell-title {
@ -1164,15 +1115,20 @@
height: 300upx;
padding-bottom: 30rpx;
}
.tui-tool-item {
width: 25%;
.tui-tool-box{
width: 100%;
padding: 0 30rpx;
display: flex;
align-items: center;
justify-content: center;
flex-direction: column;
padding-top: 10rpx;
.tui-tool-item {
display: flex;
align-items: center;
justify-content: center;
flex-direction: column;
padding-top: 10rpx;
margin-right: 30rpx;
}
}
.tti {
width: 20%;
@ -1205,8 +1161,6 @@
display: flex;
align-items: center;
flex: 1;
text {
color: #333333;
font-size: 38rpx;
@ -1276,4 +1230,35 @@
}
}
}
.money-header {
width: 77px;
height: 16px;
font-size: 11px;
font-family: PingFang SC;
font-weight: 400;
line-height: 16px;
color: #000000;
text-align: center;
margin-left: 32px;
margin-right: 11px;
margin-bottom: 8px;
}
.sellers-in {
width: 87px;
height: 32px;
background: #FF5543;
border-radius: 30px 0px 0px 30px;
}
.sellers-in .text {
line-height: 32px;
font-size: 14px;
font-family: PingFang SC;
font-weight: 500;
color: #FFFFFF;
}
</style>

4
pages/my/moneydetails.vue

@ -30,11 +30,11 @@
</template>
<script>
import uniListItem from '@/components/uni-list-item/uni-list-item.vue';
// import uniListItem from '@/components/uni-list-item/uni-list-item.vue';
export default {
components: {
uniListItem
// uniListItem
},
data() {
return {

587
pages/my/myVIP.vue

@ -1,98 +1,99 @@
<template>
<view>
<view style="height: 400rpx;background: #1C1C26;padding: 102rpx 30rpx 0;">
<view class="top_view">
<view style="display: flex;padding: 30rpx 40rpx;">
<image :src="avatar"></image>
<view style="margin-left: 20rpx;">
<view class="nickName">
{{nickName}}
</view>
<view v-if="member == 0" class="huiyuan_title">
您目前还未开通会员</view>
<view v-if="member == 1" class="huiyuan_title">
您已经是会员了</view>
</view>
<view class="top-box">
<view class="index-top">
<image src="../../static/img/my/vip.png"></image>
<view class="txt-box">
<view class="s-txt">充值会员,优惠享受不停</view>
<view class="b-txt">原价39.99限时特价<text style="font-size: 46rpx;">{{money}}</text></view>
</view>
</view>
<view class="isvip-box" v-if="userInfo.member == 1">
<view>有效期至{{userInfo.endTime.split(' ')[0]}}</view>
<view class="renew-btn" @click="btns()">立即续费</view>
</view>
</view>
<view class="plusVip" v-if="userInfo.member == 0">
<view style="display: flex;align-items: center;flex: 1;">
<view style="margin-left: 44px;font-size: 16px;
font-family: PingFang SC;font-weight: 500;color: #FFFFFF;">Plus会员卡</view>
<view style="margin-left: 4px;color: #FFE5C1;font-size: 24px;">{{money}}</view>
<view style="font-size: 16px;
font-family: PingFang SC;font-weight: 500;
color: #FFFFFF;"></view>
</view>
<view class="kaitong" @click="btns()">立即开通</view>
<view class="top_view_bottom">
<view class="yueka">
VIP会员月卡</view>
<view v-if="member == 0" class="huiyuan_biaoyu">
开通后即可享受会员特权</view>
<view v-if="member == 1" class="huiyuan_biaoyu">
您正在享受会员特权</view>
</view>
</view>
<view style="display: flex;justify-content: center;margin-top: 10px;">
<image src="../../static/img/my/tequan.png" style="width: 25.09px;height: 15.94px;"></image>
</view>
<view style="display: flex;justify-content: center;">
<view class="title-box">
<!-- <u-divider border-color="#E8CD9C"></u-divider> -->
<view class="title">会员特权</view>
<!-- <u-divider color="#E8CD9C" border-color="#E8CD9C">会员特权</u-divider> -->
<!-- <u-divider border-color="#E8CD9C"></u-divider> -->
</view>
</view>
<view class="vip_title">
会员专享特权服务</view>
<view class="category_view">
<view class="category">
<!-- <view v-for="(nav, index) in navlist" :key="index"> -->
<view class="category-list">
<view class="icon-box-left">
<image class="icon" src="https://bwc.xianmxkj.com/img/20210828/f0bf9f3ad84c4f198f82560562f907c4.png"
style="height: 58rpx;width: 58rpx;margin-top: 10rpx;">
</image>
<view class="text">最高优惠</view>
<view style="margin-top: 10px;margin: 0 10px;">
<u-grid :col="2" :border="false">
<u-grid-item>
<view class="grid-text">
<view class="text">
<view class="title">最高优惠</view>
</view>
<view class="content">
<view>可享受美食优惠</view>
<view >会员专属价格</view>
</view>
</view>
<view class="icon-box">
<image class="icon" src="https://bwc.xianmxkj.com/img/20210828/2b65563b9f9342a7a9784daa6507f71e.png"
style="height: 58rpx;width: 58rpx;margin-top: 10rpx;">
</image>
<view class="text">推广福利</view>
</u-grid-item>
<u-grid-item>
<view class="grid-text">
<view class="text">
<view class="title">最高优惠</view>
</view>
<view class="content">
<view>可享受美食优惠</view>
<view >会员专属价格</view>
</view>
</view>
<view class="icon-box-right">
<image class="icon" src="https://bwc.xianmxkj.com/img/20210828/8229ebd4434c4586bb9414bf973b154c.png"
style="height: 58rpx;width: 58rpx;margin-top: 10rpx;">
</image>
<view class="text">外卖红包</view>
</u-grid-item>
<u-grid-item>
<view class="grid-text">
<view class="text">
<view class="title">最高优惠</view>
</view>
<view class="content">
<view>可享受美食优惠</view>
<view >会员专属价格</view>
</view>
</view>
</view>
</view>
</u-grid-item>
<u-grid-item>
<view class="grid-text">
<view class="text">
<view class="title">最高优惠</view>
</view>
<view class="content">
<view>可享受美食优惠</view>
<view >会员专属价格</view>
</view>
</view>
</u-grid-item>
</u-grid>
</view>
<view @click="btns" v-if="member == 0" class="vip_btn">
开通会员只需{{money}}</view>
<!-- <view class="vipTop">
<view class="top">
<view class="topTitle">
<view class="title">享专属特权</view>
<view class="pingtai">平台会员</view>
</view>
<image class="vipLogo" src="../../static/img/my/viplogo.png" mode="widthFix"></image>
</view>
</view>
<view class="vip-center">
<view class="center-title">会员月卡</view>
<view class="center-kuang">
<view class="kuang">VIP会员月卡</view>
<view class="center-money">¥<span>{{money}}</span><text
style="font-size: 34rpx;color: grey;text-decoration: line-through;margin-left: 16rpx;">{{ oldmoney }}</text></view>
</view>
</view>
<view class="bottoms">
<view class="bottoms-title">会员特权</view>
<view class="vip-bottom">
<view class="payinfo">
<image src="../../static/img/my/tgfl.png" mode="widthFix"></image>
<view class="text">最高优惠</view>
</view>
<view class="payinfo">
<image src="../../static/img/my/zgyh.png" mode="widthFix"></image>
<view class="text">推广福利</view>
</view>
<view class="payinfo">
<image src="../../static/img/my/hbwm.png" mode="widthFix"></image>
<view class="text">外卖红包</view>
</view>
</view>
</view>
<button class="btns" @click="btns">立即支付{{money}}</button> -->
</view>
</view>
</template>
@ -100,9 +101,10 @@
export default {
data() {
return {
userInfo: {},
avatar: '',
nickName: '',
money: 0,
money: 9.9,
member: 9,
oldmoney: 0
};
@ -145,6 +147,7 @@
let userId = this.$queue.getData('userId');
this.$Request.postT("/app/selectUserById?userId=" + userId).then(res => {
if (res.code === 0) {
this.userInfo = res.data
this.member = res.data.member ? res.data.member : 0;
this.nickName = res.data.nickName ? res.data.nickName : res.data.phone;
this.avatar = res.data.imageUrl ? res.data.imageUrl :
@ -161,7 +164,7 @@
this.$queue.setData("gender", parseInt(res.data.gender));
this.$queue.setData("sex", res.data.sex);
} else {
this.goLogin();
// this.goLogin();
}
});
},
@ -211,337 +214,137 @@
<style lang="scss">
page {
width: 100%;
background: #272734;
background-color: #FFFFFF;
}
.top_view {
height: 300rpx;
background-image: url('https://bwc.xianmxkj.com/img/20210828/eedfbf8d508b4093b261546640f3193a.png');
background-size: 100%;
.top_view_bottom {
margin-top: 50rpx;
margin-left: 30rpx;
.yueka {
font-size: 32rpx;
font-family: PingFang SC Bold, PingFang SC Bold-Bold;
font-weight: 700;
color: #dfc5a7;
}
.huiyuan_biaoyu {
margin-top: 15rpx;
font-size: 24rpx;
font-family: PingFang SC Regular, PingFang SC Regular-Regular;
font-weight: 400;
color: #dfc5a7;
}
}
image {
width: 82rpx;
height: 82rpx;
border-radius: 100rpx;
}
.nickName {
font-size: 28rpx;
font-family: PingFang SC Bold, PingFang SC Bold-Bold;
font-weight: 700;
color: #ffffff;
}
.huiyuan_title {
font-size: 22rpx;
font-family: PingFang SC Regular, PingFang SC Regular-Regular;
font-weight: 400;
color: #c59d7c;
}
.top-box{
padding: 0 32rpx;
}
.category_view {
// background-image: url('https://bwc.xianmxkj.com/img/20210828/eedfbf8d508b4093b261546640f3193a.png');
// background-size: 100%;
width: 690rpx;
height: 150rpx;
padding: 40rpx;
margin: 30rpx;
z-index: 1;
}
.vip_title {
.index-top{
width: 100%;
text-align: center;
font-size: 32rpx;
font-family: PingFang SC Bold, PingFang SC Bold-Bold;
font-weight: 700;
color: #dfc5a7;
line-height: 32rpx;
margin-top: 50rpx;
}
.vip_btn {
width: 690rpx;
height: 88rpx;
background: linear-gradient(0deg, #af8262 0%, #cab49c 100%);
border-radius: 50rpx;
margin: 100rpx 30rpx 30rpx;
font-size: 38rpx;
font-weight: 700;
color: #402321;
text-align: center;
line-height: 88rpx;
}
.vip_btn1 {
width: 49%;
height: 88rpx;
background: #272734;
border-radius: 20rpx;
margin: 30rpx;
font-size: 38rpx;
font-weight: 700;
color: #FFFFFF;
text-align: center;
line-height: 88rpx;
}
.vipTop {
background: #222;
padding: 0 30upx;
padding-top: 100upx;
}
.top {
background-image: linear-gradient(to bottom, #333333, #343434);
border-radius: 30upx 30upx 0 0;
padding: 30upx;
height: 396rpx;
position: relative;
}
.topTitle {
width: 85%;
position: absolute;
}
.category {
width: 100%;
.swiper {
z-index: 3;
image{
width: 100%;
.uni-swiper-dot {
width: 20upx;
}
height: 100%;
position: absolute;
top: 0;
left: 0;
}
.category-list {
.txt-box{
width: 100%;
height: auto;
display: flex;
justify-content: flex-start;
flex-flow: wrap;
.icon-box-left {
width: 33%;
display: flex;
flex-flow: wrap;
justify-content: left;
font-size: 24rpx;
color: #DFC5A7;
text-align: left;
.icon {
width: 100upx;
height: 100upx;
margin-left: 15rpx;
}
.text {
width: 100%;
display: flex;
justify-content: left;
padding-bottom: 18upx;
padding-top: 18upx;
}
}
.icon-box-right {
width: 33%;
display: flex;
flex-flow: wrap;
justify-content: flex-end;
font-size: 24rpx;
color: #DFC5A7;
.icon {
width: 100upx;
height: 100upx;
margin-right: 15rpx;
}
.text {
width: 100%;
text-align: right;
padding-bottom: 18upx;
padding-top: 18upx;
}
}
.icon-box {
width: 33%;
display: flex;
flex-flow: wrap;
justify-content: center;
text-align: center;
position: absolute;
bottom: 48rpx;
.s-txt{
color: #FCD4B4;
font-size: 24rpx;
color: #DFC5A7;
text-align: center;
.icon {
width: 100upx;
height: 100upx;
}
.text {
width: 100%;
display: flex;
justify-content: center;
padding-bottom: 18upx;
padding-top: 18upx;
}
margin-bottom: 20rpx;
}
}
.dots {
display: flex;
align-items: center;
justify-content: center;
height: 15upx;
width: 100%;
view {
width: 30upx;
height: 5upx;
background-color: rgba(0, 0, 0, 0.2);
&.active {
background-color: #ff570a;
}
.b-txt{
color: #FCD4B4;
font-size:34rpx;
font-weight: 500;
line-height: 44rpx;
}
}
}
.title {
font-size: 38upx;
font-weight: 700;
color: #E0B379;
}
.pingtai {
font-size: 28upx;
color: #fff;
font-weight: 500;
margin-top: 10upx;
}
.vipLogo {
width: 100upx;
margin-left: 84%;
text-align: right;
}
.vip-center {
padding: 30upx;
background-color: #fff;
}
.center-title {
margin: 30upx 0;
font-size: 36upx;
font-weight: 600;
}
.center-kuang {
padding: 70upx 30upx;
line-height: 40upx;
border: 1px solid #DDB276;
background: #FFF7EA;
border-radius: 15upx;
font-size: 28upx;
color: #7C5B35;
font-weight: 600;
}
.center-kuang view {
display: inline-block;
width: 50%;
}
.center-money {
text-align: right;
color: #E0B379;
}
.center-money span {
font-size: 60upx;
}
.bottoms {
background: #FFFFFF;
margin-top: 30upx;
padding: 30upx;
.isvip-box{
width: 686rpx;
height: 128rpx;
background: linear-gradient(180deg, #F9D68A 0%, #FFC448 100%);
border-bottom-left-radius: 30rpx;
border-bottom-right-radius: 30rpx;
font-size: 24rpx;
color: #5D5A5B;
display: flex;
justify-content: space-between;
padding: 62rpx 32rpx 0;
position: relative;
top: -40rpx;
.renew-btn{
width: 158rpx;
height: 48rpx;
line-height: 48rpx;
text-align: center;
font-size: 24rpx;
color: #F9D68A;
background: #5D5A5B;
border-radius: 40rpx;
}
}
.bottoms-title {
font-size: 36upx;
font-weight: 600;
color: #333;
margin: 30upx 0;
.plusVip {
width: 686rpx;
height: 80rpx;
background: #5D5A5B;
border-radius: 40rpx;
margin: 26rpx auto;
display: flex;
}
.vip-bottom {
width: 100%;
bottom: 0;
z-index: 10;
.kaitong {
width: 98*2rpx;
background: linear-gradient(180deg, #FF7A77 0%, #F8504C 100%);
border-radius: 20*2rpx;
display: flex;
align-items: center;
justify-content: space-between;
justify-content: center;
font-size: 18*2rpx;
font-weight: 500;
color: #FFFFFF;
}
.payinfo {
width: 100upx;
text-align: center;
.lines view {
width: 60rpx;
height: 1px;
background-color: #F3E6CD;
margin-bottom: 20rpx;
}
.text {
color: #666;
font-size: 24rpx;
margin-top: 14rpx;
.grid-text {
width: 120px;
height: 120px;
border: 1px solid #E8CD9C;
border-radius: 50%;
opacity: 1;
.text{
margin-top: 20px;
margin-left: 30px;
.title{
font-size: 14px;
font-weight: 500;
color: #C7904E;
}
}
image {
width: 88rpx;
height: 88rpx;
.content{
font-size: 12px;
font-family: PingFang SC;
font-weight: 400;
color: #CCCCCC;
margin-left: 20px;
margin-top: 10px;
}
}
.btns {
position: fixed;
bottom: 0;
background-color: #E3B97D;
color: #fff;
border: 1px solid #E3B97D;
border-radius: 0;
.title-box{
width: 100%;
.title{
width: 262rpx;
height: 22rpx;
background: url(../../static/img/my/title-bg.png);
background-size: 100% 100%;
line-height: 22rpx;
text-align: center;
margin: 10rpx auto;
color: #E8CD9C;
font-size: 28rpx;
}
}
uni-button:after {
border: none !important;
}
</style>

68
pages/my/setting.vue

@ -0,0 +1,68 @@
<template>
<view class="container">
<view class="top">
<u-cell-group>
<u-cell-item icon="share" title="支付宝绑定" :arrow="true" value="绑定支付宝" @click="navTo('/pages/my/zhifubao')"></u-cell-item>
<u-cell-item icon="fingerprint" title="隐私政策" :arrow="true" @click="navTo('/pages/member/mimi')"></u-cell-item>
<u-cell-item icon="order" title="用户协议" :arrow="true" @click="navTo('/pages/member/xieyi')"></u-cell-item>
<u-cell-item icon="question-circle" title="意见反馈" :arrow="true" @click="navTo('/pages/member/feedback')"></u-cell-item>
</u-cell-group>
</view>
<button>退出登录</button>
</view>
</template>
<script>
export default {
data() {
return {};
},
onShow() {
},
methods: {
navTo(url) {
let token = this.$queue.getData("token");
if (token) {
uni.navigateTo({
url: url
});
} else {
uni.navigateTo({
url: '/pages/public/login'
});
}
}
}
}
</script>
<style lang='scss'>
page {
background: #F6F6F6;
}
.top {
margin: 0 16px;
background: #FFFFFF;
opacity: 1;
border-radius: 6px;
margin-top: 16px;
}
button {
width: 152px;
height: 32px;
background: linear-gradient(141deg, #FF4848 0%, #FF2929 100%);
border-radius: 16px;
font-size: 12px;
font-family: PingFang SC;
font-weight: 400;
color: #FFFFFF;
margin-top: 10px;
}
</style>

53
pages/my/zhifubao.vue

@ -0,0 +1,53 @@
<template>
<view>
<view class="menu">
<view class="tips">支付宝账号</view>
<input class="uni-input" type="number" placeholder="请输入支付宝账号" style="margin-top: 5px;"/>
<view class="tips" style="margin-top: 10px;">姓名</view>
<input class="uni-input" type="number" placeholder="请输入真实姓名" style="margin-top: 5px;"/>
</view>
<button>确认提交</button>
</view>
</template>
<script>
export default {
data() {
return {
}
},
methods: {
}
}
</script>
<style>
.menu {
background-color: #FFFFFF;
margin: 0 16px;
padding-top: 10px;
}
input {
border-bottom: 1px solid rgba(112, 112, 112, 0.10980392156862745);
}
button {
width: 152px;
height: 32px;
background: linear-gradient(141deg, #FF4848 0%, #FF2929 100%);
font-size: 12px;
font-family: PingFang SC;
border-radius: 16px;
margin-top: 42px;
color: #FFFFFF;
}
</style>

317
pages/order/index.vue

@ -1,28 +1,29 @@
<template>
<view class="container">
<view>
<view class="tui-tabs">
<scroll-view id="tab-bar" scroll-with-animation class="tui-scroll-h" :scroll-x="true"
:show-scrollbar="false" style="border-bottom: 2upx solid #F8F8F8;">
<view style="display: flex;">
<view v-for="(tab, index) in tabList" :id="tab.id" :data-current="index"
@tap='fromTabSelect(index)'>
<view class="tui-tab-item-title"
style="margin-left: 50upx;margin-right: 15upx;background: #FFFFFF;"
:class="{ 'tui-tab-item-title-active': fromTabIndex === index }">{{ tab.name }}</view>
</view>
</view>
</scroll-view>
<u-tabs-swiper ref="tabs" :list="list2" :is-scroll="false" :current="current" @change="change"
active-color="#FF4848" font-size="22" gutter="5px" duration="0"></u-tabs-swiper>
</view>
</view>
<view class="main">
<view class="card-box-order">
<view class="list-item" v-for="(item,index) in list" :key="index" @tap="goDetail(item.goodsId)">
<view class="info-cont">
<image class="infoImg" :src="item.titleImg"></image>
<view class="info-right">
<view>
<view class="logotitle" :class="item.status != 2 && item.status != 4 ? 'logotitle1' : 'logotitle'">
<view class="main">
<view class="card-box-order">
<view class="list-item" v-for="(item,index) in list" :key="index" @click="goDetail(item.goodsId)">
<view class="time">2021年11月11日11:25:38</view>
<view class="info-cont">
<!-- <image class="infoImg" :src="item.titleImg"></image> -->
<view style="display: flex;">
<image class="infoImg" :src="item.titleImg" mode="aspectFill"></image>
<view class="info-box">
<view class="shop-name"> {{item.goodsTitle}}</view>
<view style="display: flex;">
<view class="order-btn" type="default">会员满20返18</view>
<view class="order-btn" type="default">非会员满20返18</view>
</view>
</view>
</view>
<view class="info-right">
<view>
<!-- <view class="logotitle" :class="item.status != 2 && item.status != 4 ? 'logotitle1' : 'logotitle'">
<view style="width: 10%;">
<image v-if="item.classify == 2" class="logos"
src="/static/img/home/storeLogo.png">
@ -32,40 +33,41 @@
</image>
</view>
<view class="nickName">{{item.goodsTitle}}</view>
</view>
<view class="status">
作业状态{{item.status == 1 ? '待上传' : item.status == 2 ? '提交待审核' : item.status == 3 ? '审核成功' : item.status == 4 ? '审核失败' : item.status == 5 ? '放弃任务':''}}
</view>
<view class="jujue" v-if="item.status == 4">拒绝原因{{item.auditContent}}</view>
<view class="countdown_time" v-if="item.status === 2">
<uni-countdown class="countdown_time" color="#999999" :day="item.endTime.day"
:hour="item.endTime.hour" :minute="item.endTime.minute"
:second="item.endTime.second">
</uni-countdown>
</view>
</view> -->
<view class="status">
{{item.status == 1 ? '待提交' : item.status == 2 ? '待审核' : item.status == 3 ? '审核成功' : item.status == 4 ? '审核失败' : item.status == 5 ? '放弃任务':''}}
</view>
<view class="jujue" v-if="item.status == 4">拒绝原因{{item.auditContent}}</view>
</view>
</view>
<view class="huixian" :class="item.status == 4 ? 'huixian' : 'huixian1'"
v-if="item.status === 1 || item.status === 4"></view>
<view class="info-wrap">
<view class="btn-wrap">
<view class="btn delete" v-if="item.status === 1 || item.status === 4"
@tap.stop="fangqi(item.orderId)">取消作业</view>
<view class="btn demand" v-if="item.status === 1 || item.status === 4"
@tap.stop="shangchuan(item.orderId)">提交作业</view>
</view>
</view>
<!-- <view class="huixian" :class="item.status == 4 ? 'huixian' : 'huixian1'"
v-if="item.status === 1 || item.status === 4"></view> -->
<view class="info-wrap">
<view class="btn-wrap" v-if="item.status != 2">
<view class="btn delete" v-if="item.status === 1 || item.status === 4"
@tap.stop="fangqi(item.orderId)">放弃任务</view>
<view class="btn demand" v-if="item.status === 1 || item.status === 4"
@tap.stop="shangchuan(item.orderId)">上传凭证</view>
</view>
<view class="countdown_time" v-else>
<uni-countdown color="#999999" :day="item.endTime.day"
:hour="item.endTime.hour" :minute="item.endTime.minute"
:second="item.endTime.second">
</uni-countdown>
<view> 结束后自动审核</view>
</view>
</view>
</view>
</view>
<!-- 加载更多提示 -->
<view v-if="list.length > 0 ">
<load-more :loadingType="loadingType" :contentText="contentText"></load-more>
</view>
<!-- 暂无数据展示 -->
<empty v-if="list.length === 0" des="暂无作业数据" show="false"></empty>
</view>
<!-- 加载更多提示 -->
<view v-if="list.length > 0 ">
<load-more :loadingType="loadingType" :contentText="contentText"></load-more>
</view>
<!-- 暂无数据展示 -->
<empty v-if="list.length === 0" des="暂无订单数据" show="false"></empty>
</view>
</view>
</template>
@ -85,21 +87,41 @@
name: "待提交"
},
{
name: "提交待审核"
name: "待审核"
},
{
name: "审核成功"
},
{
name: "审核失败"
name: "放弃任务"
},
{
name: "放弃"
}
name: "审核失败"
},
],
page: 1,
limit: 10,
list: [],
list2: [{
name: "全部"
},
{
name: "待提交"
},
{
name: "待审核"
},
{
name: "审核成功"
},
{
name: "放弃任务"
},
{
name: "审核失败"
}
],
current: 0,
loadingType: 0,
scrollTop: false,
contentText: {
@ -122,10 +144,10 @@
},
methods: {
//
fangqi(id) {
fangqi(item) {
uni.showModal({
title: '温馨提示',
content: '您是否要放弃当前任务?',
// title: '',
content: '确认要放弃吗?',
showCancel: true,
cancelText: '取消',
confirmText: '确认',
@ -149,6 +171,12 @@
}
});
},
change(index) {
this.current = index;
this.fromTabIndex = index;
this.page = 1;
this.getList()
},
//
shangchuan(id) {
uni.navigateTo({
@ -169,7 +197,6 @@
if (this.page === 1) {
this.list = [];
}
res.data.list.forEach(d => {
let data = {}
data.day = 0;
@ -211,15 +238,15 @@
var latitude = this.$queue.getData('latitude')
var longitude = this.$queue.getData('longitude')
uni.navigateTo({
url: '/pages/index/taskDetail?goodsId=' + id + '&latitude=' + latitude + '&longitude=' +
url: '/pages/index/tasksdetails?goodsId=' + id + '&latitude=' + latitude + '&longitude=' +
longitude
})
},
endTask(item) {
let that = this;
uni.showModal({
title: '温馨提示',
content: '取消作业将会扣除您的信誉分,确认取消作业吗?',
// title: '',
content: '取消订单将会扣除您的信誉分,确认取消订单吗?',
showCancel: true,
cancelText: '取消',
confirmText: '确认',
@ -335,42 +362,48 @@
.countdown_time {
display: flex;
align-items: center;
justify-content: flex-end;
font-size: 28rpx;
font-family: PingFang SC Medium, PingFang SC Medium-Medium;
font-weight: 500;
color: #999999;
width: 100%;
height: 100%;
}
.huixian {
height: 1rpx;
opacity: 1;
border: 1rpx solid #e6e6e6;
margin-top: 30rpx;
margin-top: 16rpx;
}
.huixian1 {
height: 1rpx;
opacity: 1;
border: 1rpx solid #e6e6e6;
margin-top: 60rpx;
margin-top: 32rpx;
}
.main {
padding: 106upx 20upx 0;
padding: 16px 20upx 0;
.card-box-order {
.list-item {
background: #FFFFFF;
border-radius: 20upx;
padding: 30upx 30upx 40upx;
margin-bottom: 20upx;
border-radius: 12rpx;
padding: 15rpx 0;
margin-bottom: 32rpx;
.time{
padding: 10rpx 16rpx;
border-bottom: 2rpx solid #D2D2D2;
font-size: 20rpx;
color: #4E4E4E;
}
.title {
display: flex;
align-items: center;
width: 100%;
// justify-content: space-between;
padding-bottom: 20upx;
.logos {
@ -392,17 +425,30 @@
}
.info-cont {
position: relative;
width: 100%;
padding: 16rpx;
display: flex;
justify-content: space-between;
// position: relative;
.infoImg {
width: 140upx;
height: 140upx;
border-radius: 4upx;
position: absolute;
width: 112rpx;
height: 112rpx;
border-radius: 4rpx;
}
.info-box{
width: 450rpx;
margin-left: 18rpx;
.shop-name{
width: 100%;
overflow:hidden;
text-overflow:ellipsis;
white-space:nowrap;
}
}
.info-right {
margin-left: 150upx;
// margin-left: 150upx;
// height: 100upx;
.logotitle {
@ -410,7 +456,7 @@
display: flex;
align-items: center;
}
.logotitle1 {
width: 100%;
display: flex;
@ -432,7 +478,6 @@
white-space: nowrap;
margin-left: 9rpx;
font-size: 32rpx;
font-family: PingFang SC Bold, PingFang SC Bold-Bold;
font-weight: 700;
color: #333333;
}
@ -443,7 +488,6 @@
text-overflow: ellipsis;
white-space: nowrap;
font-size: 32rpx;
font-family: PingFang SC Bold, PingFang SC Bold-Bold;
font-weight: 700;
color: #333333;
padding-top: 5rpx;
@ -451,19 +495,20 @@
.status {
margin: 10rpx 0;
width: 95%;
// width: 100px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
font-size: 28rpx;
font-family: PingFang SC Medium, PingFang SC Medium-Medium;
height: 32rpx;
font-size: 11px;
font-family: PingFang SC;
font-weight: 400;
color: #999999;
line-height:32rpx;
color: #878787;
}
.jujue {
font-size: 28rpx;
font-family: PingFang SC Medium, PingFang SC Medium-Medium;
font-weight: 500;
color: #999999;
}
@ -471,6 +516,13 @@
}
.info-wrap {
width: 100%;
height: 64rpx;
padding: 0 16rpx;
// display: flex;
// align-items: center;
border-top: 2rpx solid #D2D2D2;
// margin-top: 16rpx;
.express {
padding-top: 30upx;
padding-bottom: 20upx;
@ -544,49 +596,40 @@
}
.btn-wrap {
width: 100%;
height: 100%;
display: flex;
justify-content: flex-end;
margin-top: 25upx;
align-items: center;
.btn {
width: 150upx;
height: 46upx;
line-height: 42upx;
width: 112rpx;
height: 32rpx;
line-height: 36rpx;
border-radius: 16rpx;
font-size: 22rpx;
font-weight: bold;
text-align: center;
margin-left: 20upx;
font-size: 24upx;
border-radius: 8upx;
color: #FFFFFF;
margin-left: 32rpx;
}
.delete {
width: 160rpx;
height: 64rpx;
opacity: 1;
border: 2rpx solid #999999;
height: 36rpx;
font-size: 22rpx;
line-height: 32rpx;
color: #878787;
border: 2rpx solid #878787;
border-radius: 16rpx;
font-size: 28rpx;
font-family: PingFang SC Bold, PingFang SC Bold-Bold;
font-weight: 700;
color: #333333;
line-height: 64rpx;
// color: #333333;
// border: 2upx solid #999999;
}
.demand {
width: 160rpx;
height: 64rpx;
opacity: 1;
background: #fec103;
height: 36rpx;
font-size: 22rpx;
line-height: 32rpx;
color: #FF4848;
border: 2rpx solid #FF4848;
border-radius: 16rpx;
font-size: 28rpx;
font-family: PingFang SC Bold, PingFang SC Bold-Bold;
font-weight: 700;
color: #333333;
line-height: 64rpx;
// color: #FFFFFF;
// border: 2upx solid #FEC103;
// background: #FEC103;
}
}
}
@ -696,13 +739,13 @@
margin: 20upx 0 10upx;
.nickName {
font-size: 28upx;
font-size: 22rpx;
font-weight: 500;
color: #666666;
}
.moblie {
font-size: 28upx;
font-size: 22rpx;
font-weight: 500;
color: #FF3530;
}
@ -711,15 +754,14 @@
.btn-wrap {
display: flex;
justify-content: flex-end;
.btn {
width: 200upx;
height: 60upx;
width: 112rpx;
height: 32rpx;
line-height: 30rpx;
background: #FF3530;
border-radius: 30upx;
font-size: 28upx;
border-radius: 16rpx;
font-size: 22rpx;
font-weight: bold;
line-height: 60upx;
text-align: center;
color: #FFFFFF;
}
@ -797,8 +839,10 @@
}
.tui-tab-item-title {
color: #999999;
font-size: 28rpx;
color: #000000;
font-size: 11px;
font-family: PingFang SC;
font-weight: 500;
height: 80rpx;
line-height: 80rpx;
flex-wrap: nowrap;
@ -806,14 +850,29 @@
}
.tui-tab-item-title-active {
border-bottom: 8rpx solid rgb(255, 199, 5);
font-family: PingFang SC Heavy, PingFang SC Heavy-Heavy;
font-weight: 800;
border-bottom: 8rpx solid #FF4848;
border-radius: 4px;
text-align: left;
color: #333333;
font-size: 28upx;
font-weight: bold;
color: #000000;
font-size: 11px;
font-family: PingFang SC;
font-weight: 500;
border-bottom-width: 10upx;
text-align: center;
}
.order-btn {
width: 164rpx;
height: 36rpx;
background: #F8E3DF;
border: 2rpx solid #FF6A6A;
border-radius: 4rpx;
font-size: 20rpx;
font-weight: 500;
line-height: 34rpx;
color: #FF7171 !important;
margin-right: 12rpx;
margin-top: 24rpx;
text-align: center;
}
</style>

113
pages/order/release.vue

@ -2,29 +2,49 @@
<view class="container" style="padding-bottom: 150rpx;">
<view class="main">
<view class="order-des">
<view class="title">餐手机号</view>
<view class="title">单手机号</view>
<view class="textarea-wrap">
<input type="number" v-model="phone" class="input" maxlength="11" placeholder="请输入订单手机号" />
<input type="number" v-model="phone" class="input" maxlength="11" placeholder="请输入订单手机号"
placeholder-style="font-size: 12px;" />
</view>
</view>
<view class="order-des">
<view class="title">支付金额</view>
<view class="title">支付金额</view>
<view class="textarea-wrap">
<input type="digit" v-model="money" class="input" readonly="readonly" placeholder="请输入支付金额" />
<input type="digit" v-model="money" class="input" readonly="readonly" placeholder="请输入支付金额"
placeholder-style="font-size: 12px;" />
</view>
</view>
<view class="order-des">
<view class="title">上传订单凭证(最少两张)</view>
<shmily-drag-image :list.sync="imageList" number="3"></shmily-drag-image>
<view class="textarea-wrap" style="display: flex;">
<view class="uni-title uni-common-pl">请选择订单类型<u-icon name="arrow-down-fill" color="#FF4848"
size="12"></u-icon></view>
<view class="uni-list">
<view class="uni-list-cell">
<view class="uni-list-cell-db">
<picker @change="bindPickerChange" :value="index" :range="array">
<view class="uni-input">{{array[index]}}</view>
</picker>
</view>
</view>
</view>
</view>
</view>
<view class="order-des">
<view class="title">上传订单凭证(最少两张)</view>
<shmily-drag-image :list.sync="imageList" number="3"></shmily-drag-image>
</view>
<view class="order-des">
<view class="title">上传订单凭证示例图</view>
<shmily-drag-image :select="false" :list.sync="imageList1" number="2"></shmily-drag-image>
</view>
</view>
<view class="btns">
<button class="tui-button-primar qr" @tap="addSave">提交</button>
<button class="tui-button-primar qx" @tap="fangqi">放弃</button>
<button class="tui-button-primar qr" @tap="addSave">提交凭证</button>
<button class="tui-button-primar qx" @tap="fangqi">放弃任务</button>
</view>
</view>
</template>
@ -43,7 +63,26 @@
imageList1: ['https://h5.canmoujiang.com/img/20210531/dceedf8061294b1d99043ca78ff57090.png',
'https://h5.canmoujiang.com/img/20210531/3ff0fa04f1cb4debb6ec017293bf6c6f.jpg'
],
orderId: '' //ID
orderId: '', //ID
value1: 0,
options1: [{
label: '默认排序',
value: 1,
},
{
label: '距离优先',
value: 2,
},
{
label: '价格优先',
value: 3,
}
],
message: '',
changeSelectStyle: '',
title: 'picker',
array: ['美团', '饿了么'],
index: 0,
}
},
onLoad(e) {
@ -79,6 +118,13 @@
}
});
},
changeStyle(index) {
this.changeSelectStyle = index;
},
bindPickerChange: function(e) {
console.log('picker发送选择改变,携带值为', e.target.value)
this.index = e.target.value
},
//
addSave() {
let that = this;
@ -130,6 +176,7 @@
<style lang="scss">
page {
width: 100%;
background-color: #FFFFFF;
}
.container {
@ -147,17 +194,35 @@
// margin-bottom: 20upx;
.title {
font-size: 34upx;
font-weight: bold;
font-size: 14px;
font-weight: 400;
color: #333333;
line-height: 32upx;
padding-bottom: 20upx;
border-bottom: 1upx solid #E6E6E6;
}
.textarea-wrap {
padding-top: 20upx;
width: 100%;
border-bottom: 1upx solid #E6E6E6;
.changeStyle {
background: #F8E3DF;
border: 1px solid #FF6A6A;
opacity: 1;
border-radius: 2px;
color: #FF7171;
}
.a {
background: #F5F5F5;
border: 1px solid #999999;
opacity: 1;
border-radius: 2px;
color: #999999;
}
.textarea {
width: 100%;
@ -223,18 +288,24 @@
.btns {
button {
// width: 80%;
margin: 22upx;
margin: 0 auto;
color: #fff;
border: none;
border-radius: 10upx;
width: 152px;
height: 32px;
opacity: 1;
border-radius: 16px;
line-height: 32px;
}
.qr {
background: #FF4701;
background: linear-gradient(141deg, #FF4848 0%, #FF2929 100%);
}
.qx {
background: #CCCCCC;
margin-top: 16px;
}
}
@ -266,14 +337,14 @@
}
.tui-button-primar {
width: 300upx;
height: 78upx;
line-height: 78upx;
background: #FF332F;
border-radius: 10upx;
margin: 0;
width: 152px;
height: 32px;
opacity: 1;
border-radius: 16px;
}
}
}
</style>

93
pages/public/login.vue

@ -5,11 +5,13 @@
<view class="mp_wxBox">
<view>
<view class="headers">
<image src="../../static/img/logo.png" style="border-radius: 50%;"></image>
<image src="../../static/img/home/shangjia.png" style=" border-radius: 50%;"></image>
</view>
<view class="content">
<view>申请获取以下权限</view>
<text style="margin-top: 20rpx;">获得你的公开信息(昵称头像地区等)</text>
<view style="font-size: 16px;font-family: PingFang SC;font-weight: 500;color: #000000;" class="title">番茄饭团</view>
<view style="margin-top: 21rpx;font-size: 12px;font-family: PingFang SC;font-weight: 500;
color: #000000;">为了提供优质服务需要您授权基本信息</view>
</view>
<button v-show="weixinPhone" style="background: #FD441D;background-color: #FD441D;color: #FFFFFF;"
class="bottom" open-type="getPhoneNumber" @getphonenumber="getPhoneNumber">
@ -19,20 +21,21 @@
open-type="getUserInfo" withCredentials="true" lang="zh_CN" @getuserinfo="wxGetUserInfo">
立即登录
</button> -->
<button v-show="!weixinPhone" style="background: #FD441D;color: #FFFFFF;" class='bottom'
bindtap="getUserProfile" @tap="wxGetUserInfo">
授权登录
<button v-show="!weixinPhone" class='bottom1' bindtap="getUserProfile" @tap="wxGetUserInfo">
授权并查看
</button>
<button v-show="!weixinPhone" class='bottom2'>
暂不授权
</button>
<!-- 底部信息 -->
<view class="footer">
<text @tap="isShowAgree" class="cuIcon" :class="showAgree?'cuIcon-radiobox':'cuIcon-round'">同意
<text @tap="isShowAgree" class="cuIcon" :class="showAgree?'cuIcon-radiobox':'cuIcon-round'">我已阅读并同意
</text>
<!-- 协议地址 -->
<navigator url="/pages/member/mimi" open-type="navigate">隐私政策</navigator>
<navigator url="/pages/member/xieyi" open-type="navigate">用户服务协议</navigator>
<navigator url="/pages/member/mimi" open-type="navigate" style="color: #FF3232;">隐私政策</navigator>
<navigator url="/pages/member/xieyi" open-type="navigate" style="color: #FF3232;">用户服务协议</navigator>
</view>
</view>
</view>
@ -192,11 +195,11 @@
uni.hideLoading();
//
//
var userByinvitationId = that.$queue.getData('userByinvitationId');
if(userByinvitationId){
if (userByinvitationId) {
that.userByinvitationId = userByinvitationId;
}else{
} else {
that.userByinvitationId = that.$queue.getInvitation();
}
var sendData = {
@ -325,18 +328,20 @@
<style lang="scss">
.headers {
text-align: center;
margin-top: 32rpx;
}
.headers>image {
width: 400upx;
height: 400upx;
.headers image {
width: 64px;
height: 64px;
}
.footer {
// padding-left: 140upx;
width: 100%;
height: 20px;
justify-content: center;
margin-top: 32upx;
margin-top: 248rpx;
font-size: 24upx;
color: #666666;
display: flex;
@ -359,7 +364,6 @@
.container {
top: 0;
padding-top: 32upx;
position: relative;
width: 100%;
height: 100%;
@ -368,16 +372,20 @@
.mp_wxBox {
.headers {
margin: 35% auto 50rpx;
text-align: center;
margin: 0 auto;
border-radius: 60rpx;
width: 650rpx;
height: 300rpx;
line-height: 450rpx;
margin-top: 64rpx;
text-align: center;
image {
width: 300rpx;
height: 300rpx;
width: 64px;
height: 64px;
margin: 0 auto;
}
.title {
margin-top: 0px;
}
}
@ -391,12 +399,31 @@
// margin-top: 40rpx;
}
.bottom {
line-height: 80upx;
border-radius: 80upx;
margin: 50rpx;
height: 80upx;
font-size: 35rpx;
.bottom1 {
width: 256px;
height: 38px;
background: linear-gradient(141deg, #FF4848 0%, #FF2929 100%);
opacity: 1;
border-radius: 19px;
font-size: 14px;
font-family: PingFang SC;
font-weight: 400;
color: #FFFFFF;
margin-top: 132rpx;
}
.bottom2 {
width: 256px;
height: 38px;
border: 2px solid #FF4848;
background: #FFFFFF;
opacity: 1;
border-radius: 19px;
font-size: 14px;
font-family: PingFang SC;
font-weight: 400;
color: #FF2F2F;
margin-top: 16rpx;
}
}
}

5
project.config.json

@ -30,7 +30,12 @@
"enableEngineNative": false,
"packNpmRelationList": [],
"minifyWXSS": true,
<<<<<<< HEAD
"showES6CompileOption": false
=======
"showES6CompileOption": false,
"minifyWXML": true
>>>>>>> 661ea8f1c91af482df1a982bf8c644694bee7897
},
"compileType": "miniprogram",
"libVersion": "2.20.1",

BIN
static/img/home/banner.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

BIN
static/img/home/chaoshi.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

BIN
static/img/home/coco.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.1 KiB

BIN
static/img/home/elme.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 522 B

BIN
static/img/home/fanli.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

BIN
static/img/home/guanggao.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

BIN
static/img/home/guanggao2.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

BIN
static/img/home/haoping.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

BIN
static/img/home/huangguan.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

BIN
static/img/home/kefuxin.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

BIN
static/img/home/mae.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

BIN
static/img/home/meishi.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

BIN
static/img/home/meituan.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 403 B

BIN
static/img/home/naicha.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

BIN
static/img/home/qianggou.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

BIN
static/img/home/search.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

After

Width:  |  Height:  |  Size: 591 B

BIN
static/img/home/shangjia.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 42 KiB

BIN
static/img/home/shaokao.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

BIN
static/img/home/waimai.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

BIN
static/img/home/welfare.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

BIN
static/img/home/xiangqing.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 192 KiB

BIN
static/img/my/alipay.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 769 B

BIN
static/img/my/callus.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

BIN
static/img/my/cash.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.2 KiB

BIN
static/img/my/huiyuantiao.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

BIN
static/img/my/money.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.4 KiB

BIN
static/img/my/mybackgorund.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

BIN
static/img/my/rules.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 499 B

BIN
static/img/my/setting.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

BIN
static/img/my/tequan.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 721 B

BIN
static/img/my/title-bg.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 145 B

BIN
static/img/my/vip-icon.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 702 B

BIN
static/img/my/vip.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 70 KiB

BIN
static/img/my/wchart.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 865 B

BIN
static/img/my/xieyi.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 778 B

BIN
static/img/my/yijian.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

BIN
static/img/my/zhifubaored.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 970 B

BIN
static/img/my/zhiwen.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

BIN
static/img/tabbar/home-selected.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.1 KiB

BIN
static/img/tabbar/home.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.4 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB

BIN
static/img/tabbar/homeselected.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1014 B

BIN
static/img/tabbar/mine-selected.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

BIN
static/img/tabbar/mine.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

BIN
static/img/tabbar/order-selected.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 993 B

BIN
static/img/tabbar/order.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

4
uni.scss

@ -103,3 +103,7 @@ $uni-color-primary:#eee;
$uni-color-success: #4cd964;
$uni-color-warning: #f0ad4e;
$uni-color-error: #e10a07;
@import "uView-ui/theme.scss";
@import "uView-ui/index.scss"

21
uview-ui/LICENSE

@ -0,0 +1,21 @@
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.

106
uview-ui/README.md

@ -0,0 +1,106 @@
<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应用到您的产品中。

190
uview-ui/components/u-action-sheet/u-action-sheet.vue

@ -0,0 +1,190 @@
<template>
<u-popup mode="bottom" :border-radius="borderRadius" :popup="false" v-model="value" :maskCloseAble="maskCloseAble"
length="auto" :safeAreaInsetBottom="safeAreaInsetBottom" @close="popupClose" :z-index="uZIndex">
<view class="u-tips u-border-bottom" v-if="tips.text" :style="[tipsStyle]">
{{tips.text}}
</view>
<block v-for="(item, index) in list" :key="index">
<view
@touchmove.stop.prevent
@tap="itemClick(index)"
:style="[itemStyle(index)]"
class="u-action-sheet-item u-line-1"
:class="[index < list.length - 1 ? 'u-border-bottom' : '']"
:hover-stay-time="150"
>
<text>{{item.text}}</text>
<text class="u-action-sheet-item__subtext u-line-1" v-if="item.subText">{{item.subText}}</text>
</view>
</block>
<view class="u-gab" v-if="cancelBtn">
</view>
<view @touchmove.stop.prevent class="u-actionsheet-cancel u-action-sheet-item" hover-class="u-hover-class"
:hover-stay-time="150" v-if="cancelBtn" @tap="close">{{cancelText}}</view>
</u-popup>
</template>
<script>
/**
* actionSheet 操作菜单
* @description 本组件用于从底部弹出一个操作菜单供用户选择并返回结果本组件功能类似于uni的uni.showActionSheetAPI配置更加灵活所有平台都表现一致
* @tutorial https://www.uviewui.com/components/actionSheet.html
* @property {Array<Object>} list 按钮的文字数组见官方文档示例
* @property {Object} tips 顶部的提示文字见官方文档示例
* @property {String} cancel-text 取消按钮的提示文字
* @property {Boolean} cancel-btn 是否显示底部的取消按钮默认true
* @property {Number String} border-radius 弹出部分顶部左右的圆角值单位rpx默认0
* @property {Boolean} mask-close-able 点击遮罩是否可以关闭默认true
* @property {Boolean} safe-area-inset-bottom 是否开启底部安全区适配默认false
* @property {Number String} z-index z-index值默认1075
* @property {String} cancel-text 取消按钮的提示文字
* @event {Function} click 点击ActionSheet列表项时触发
* @event {Function} close 点击取消按钮时触发
* @example <u-action-sheet :list="list" @click="click" v-model="show"></u-action-sheet>
*/
export default {
name: "u-action-sheet",
props: {
// actionsheet
maskCloseAble: {
type: Boolean,
default: true
},
// rpx
list: {
type: Array,
default () {
//
// return [{
// text: '',
// color: '',
// fontSize: ''
// }]
return [];
}
},
//
tips: {
type: Object,
default () {
return {
text: '',
color: '',
fontSize: '26'
}
}
},
//
cancelBtn: {
type: Boolean,
default: true
},
// iPhoneX
safeAreaInsetBottom: {
type: Boolean,
default: false
},
//
value: {
type: Boolean,
default: false
},
//
borderRadius: {
type: [String, Number],
default: 0
},
// z-index
zIndex: {
type: [String, Number],
default: 0
},
//
cancelText: {
type: String,
default: '取消'
}
},
computed: {
//
tipsStyle() {
let style = {};
if (this.tips.color) style.color = this.tips.color;
if (this.tips.fontSize) style.fontSize = this.tips.fontSize + 'rpx';
return style;
},
//
itemStyle() {
return (index) => {
let style = {};
if (this.list[index].color) style.color = this.list[index].color;
if (this.list[index].fontSize) style.fontSize = this.list[index].fontSize + 'rpx';
//
if (this.list[index].disabled) style.color = '#c0c4cc';
return style;
}
},
uZIndex() {
// z-index使
return this.zIndex ? this.zIndex : this.$u.zIndex.popup;
}
},
methods: {
//
close() {
// inputpropsvalue
// vue
this.popupClose();
this.$emit('close');
},
//
popupClose() {
this.$emit('input', false);
},
// item
itemClick(index) {
// disabled
if(this.list[index].disabled) return;
this.$emit('click', index);
this.$emit('input', false);
}
}
}
</script>
<style lang="scss" scoped>
@import "../../libs/css/style.components.scss";
.u-tips {
font-size: 26rpx;
text-align: center;
padding: 34rpx 0;
line-height: 1;
color: $u-tips-color;
}
.u-action-sheet-item {
@include vue-flex;;
line-height: 1;
justify-content: center;
align-items: center;
font-size: 32rpx;
padding: 34rpx 0;
flex-direction: column;
}
.u-action-sheet-item__subtext {
font-size: 24rpx;
color: $u-tips-color;
margin-top: 20rpx;
}
.u-gab {
height: 12rpx;
background-color: rgb(234, 234, 236);
}
.u-actionsheet-cancel {
color: $u-main-color;
}
</style>

256
uview-ui/components/u-alert-tips/u-alert-tips.vue

@ -0,0 +1,256 @@
<template>
<view class="u-alert-tips" v-if="show" :class="[
!show ? 'u-close-alert-tips': '',
type ? 'u-alert-tips--bg--' + type + '-light' : '',
type ? 'u-alert-tips--border--' + type + '-disabled' : '',
]" :style="{
backgroundColor: bgColor,
borderColor: borderColor
}">
<view class="u-icon-wrap">
<u-icon v-if="showIcon" :name="uIcon" :size="description ? 40 : 32" class="u-icon" :color="uIconType" :custom-style="iconStyle"></u-icon>
</view>
<view class="u-alert-content" @tap.stop="click">
<view class="u-alert-title" :style="[uTitleStyle]">
{{title}}
</view>
<view v-if="description" class="u-alert-desc" :style="[descStyle]">
{{description}}
</view>
</view>
<view class="u-icon-wrap">
<u-icon @click="close" v-if="closeAble && !closeText" hoverClass="u-type-error-hover-color" name="close" color="#c0c4cc"
:size="22" class="u-close-icon" :style="{
top: description ? '18rpx' : '24rpx'
}"></u-icon>
</view>
<text v-if="closeAble && closeText" class="u-close-text" :style="{
top: description ? '18rpx' : '24rpx'
}">{{closeText}}</text>
</view>
</template>
<script>
/**
* alertTips 警告提示
* @description 警告提示展现需要关注的信息
* @tutorial https://uviewui.com/components/alertTips.html
* @property {String} title 显示的标题文字
* @property {String} description 辅助性文字颜色比title浅一点字号也小一点可选
* @property {String} type 关闭按钮(默认为叉号icon图标)
* @property {String} icon 图标名称
* @property {Object} icon-style 图标的样式对象形式
* @property {Object} title-style 标题的样式对象形式
* @property {Object} desc-style 描述的样式对象形式
* @property {String} close-able 用文字替代关闭图标close-able为true时有效
* @property {Boolean} show-icon 是否显示左边的辅助图标
* @property {Boolean} show 显示或隐藏组件
* @event {Function} click 点击组件时触发
* @event {Function} close 点击关闭按钮时触发
*/
export default {
name: 'u-alert-tips',
props: {
//
title: {
type: String,
default: ''
},
// success/warning/info/error
type: {
type: String,
default: 'warning'
},
//
description: {
type: String,
default: ''
},
//
closeAble: {
type: Boolean,
default: false
},
//
closeText: {
type: String,
default: ''
},
//
showIcon: {
type: Boolean,
default: false
},
// coloricon
color: {
type: String,
default: ''
},
//
bgColor: {
type: String,
default: ''
},
//
borderColor: {
type: String,
default: ''
},
//
show: {
type: Boolean,
default: true
},
// icon
icon: {
type: String,
default: ''
},
// icon
iconStyle: {
type: Object,
default() {
return {}
}
},
//
titleStyle: {
type: Object,
default() {
return {}
}
},
//
descStyle: {
type: Object,
default() {
return {}
}
},
},
data() {
return {
}
},
computed: {
uTitleStyle() {
let style = {};
//
style.fontWeight = this.description ? 500 : 'normal';
// stylestyle
return this.$u.deepMerge(style, this.titleStyle);
},
uIcon() {
// icon使type
return this.icon ? this.icon : this.$u.type2icon(this.type);
},
uIconType() {
// 使type
return Object.keys(this.iconStyle).length ? '' : this.type;
}
},
methods: {
//
click() {
this.$emit('click');
},
//
close() {
this.$emit('close');
}
}
}
</script>
<style lang="scss" scoped>
@import "../../libs/css/style.components.scss";
.u-alert-tips {
@include vue-flex;
align-items: center;
padding: 16rpx 30rpx;
border-radius: 8rpx;
position: relative;
transition: all 0.3s linear;
border: 1px solid #fff;
&--bg--primary-light {
background-color: $u-type-primary-light;
}
&--bg--info-light {
background-color: $u-type-info-light;
}
&--bg--success-light {
background-color: $u-type-success-light;
}
&--bg--warning-light {
background-color: $u-type-warning-light;
}
&--bg--error-light {
background-color: $u-type-error-light;
}
&--border--primary-disabled {
border-color: $u-type-primary-disabled;
}
&--border--success-disabled {
border-color: $u-type-success-disabled;
}
&--border--error-disabled {
border-color: $u-type-error-disabled;
}
&--border--warning-disabled {
border-color: $u-type-warning-disabled;
}
&--border--info-disabled {
border-color: $u-type-info-disabled;
}
}
.u-close-alert-tips {
opacity: 0;
visibility: hidden;
}
.u-icon {
margin-right: 16rpx;
}
.u-alert-title {
font-size: 28rpx;
color: $u-main-color;
}
.u-alert-desc {
font-size: 26rpx;
text-align: left;
color: $u-content-color;
}
.u-close-icon {
position: absolute;
top: 20rpx;
right: 20rpx;
}
.u-close-hover {
color: red;
}
.u-close-text {
font-size: 24rpx;
color: $u-tips-color;
position: absolute;
top: 20rpx;
right: 20rpx;
line-height: 1;
}
</style>

290
uview-ui/components/u-avatar-cropper/u-avatar-cropper.vue

@ -0,0 +1,290 @@
<template>
<view class="content">
<view class="cropper-wrapper" :style="{ height: cropperOpt.height + 'px' }">
<canvas
class="cropper"
:disable-scroll="true"
@touchstart="touchStart"
@touchmove="touchMove"
@touchend="touchEnd"
:style="{ width: cropperOpt.width, height: cropperOpt.height, backgroundColor: 'rgba(0, 0, 0, 0.8)' }"
canvas-id="cropper"
id="cropper"
></canvas>
<canvas
class="cropper"
:disable-scroll="true"
:style="{
position: 'fixed',
top: `-${cropperOpt.width * cropperOpt.pixelRatio}px`,
left: `-${cropperOpt.height * cropperOpt.pixelRatio}px`,
width: `${cropperOpt.width * cropperOpt.pixelRatio}px`,
height: `${cropperOpt.height * cropperOpt.pixelRatio}`
}"
canvas-id="targetId"
id="targetId"
></canvas>
</view>
<view class="cropper-buttons safe-area-padding" :style="{ height: bottomNavHeight + 'px' }">
<!-- #ifdef H5 -->
<view class="upload" @tap="uploadTap">选择图片</view>
<!-- #endif -->
<!-- #ifndef H5 -->
<view class="upload" @tap="uploadTap">重新选择</view>
<!-- #endif -->
<view class="getCropperImage" @tap="getCropperImage(false)">确定</view>
</view>
</view>
</template>
<script>
import WeCropper from './weCropper.js';
export default {
props: {
// lineWidth-(rpx)color:
// mask-rgba"rgba(0, 0, 0, 0.35)"
boundStyle: {
type: Object,
default() {
return {
lineWidth: 4,
borderColor: 'rgb(245, 245, 245)',
mask: 'rgba(0, 0, 0, 0.35)'
};
}
}
// // rpx
// rectWidth: {
// type: [String, Number],
// default: 400
// },
// // rpx
// rectHeight: {
// type: [String, Number],
// default: 400
// },
// // rpx
// destWidth: {
// type: [String, Number],
// default: 400
// },
// // rpx
// destHeight: {
// type: [String, Number],
// default: 400
// },
// // "png""jpg"
// fileType: {
// type: String,
// default: 'jpg',
// },
// //
// // H5使
// quality: {
// type: [Number, String],
// default: 1
// }
},
data() {
return {
//
bottomNavHeight: 50,
originWidth: 200,
width: 0,
height: 0,
cropperOpt: {
id: 'cropper',
targetId: 'targetCropper',
pixelRatio: 1,
width: 0,
height: 0,
scale: 2.5,
zoom: 8,
cut: {
x: (this.width - this.originWidth) / 2,
y: (this.height - this.originWidth) / 2,
width: this.originWidth,
height: this.originWidth
},
boundStyle: {
lineWidth: uni.upx2px(this.boundStyle.lineWidth),
mask: this.boundStyle.mask,
color: this.boundStyle.borderColor
}
},
//
// px
destWidth: 200,
// px
rectWidth: 200,
// 'png'"jpg"
fileType: 'jpg',
src: '', //
};
},
onLoad(option) {
let rectInfo = uni.getSystemInfoSync();
this.width = rectInfo.windowWidth;
this.height = rectInfo.windowHeight - this.bottomNavHeight;
this.cropperOpt.width = this.width;
this.cropperOpt.height = this.height;
this.cropperOpt.pixelRatio = rectInfo.pixelRatio;
if (option.destWidth) this.destWidth = option.destWidth;
if (option.rectWidth) {
let rectWidth = Number(option.rectWidth);
this.cropperOpt.cut = {
x: (this.width - rectWidth) / 2,
y: (this.height - rectWidth) / 2,
width: rectWidth,
height: rectWidth
};
}
this.rectWidth = option.rectWidth;
if (option.fileType) this.fileType = option.fileType;
//
this.cropper = new WeCropper(this.cropperOpt)
.on('ready', ctx => {
// wecropper is ready for work!
})
.on('beforeImageLoad', ctx => {
// before picture loaded, i can do something
})
.on('imageLoad', ctx => {
// picture loaded
})
.on('beforeDraw', (ctx, instance) => {
// before canvas draw,i can do something
});
// page.json
uni.setNavigationBarColor({
frontColor: '#ffffff',
backgroundColor: '#000000'
});
uni.chooseImage({
count: 1, // 9
sizeType: ['compressed'], //
sourceType: ['album', 'camera'], //
success: res => {
this.src = res.tempFilePaths[0];
// datasrc
this.cropper.pushOrign(this.src);
}
});
},
methods: {
touchStart(e) {
this.cropper.touchStart(e);
},
touchMove(e) {
this.cropper.touchMove(e);
},
touchEnd(e) {
this.cropper.touchEnd(e);
},
getCropperImage(isPre = false) {
if(!this.src) return this.$u.toast('请先选择图片再裁剪');
let cropper_opt = {
destHeight: Number(this.destWidth), // uni.canvasToTempFilePath
destWidth: Number(this.destWidth),
fileType: this.fileType
};
this.cropper.getCropperImage(cropper_opt, (path, err) => {
if (err) {
uni.showModal({
title: '温馨提示',
content: err.message
});
} else {
if (isPre) {
uni.previewImage({
current: '', // http
urls: [path] // http
});
} else {
uni.$emit('uAvatarCropper', path);
this.$u.route({
type: 'back'
});
}
}
});
},
uploadTap() {
const self = this;
uni.chooseImage({
count: 1, // 9
sizeType: ['original', 'compressed'], //
sourceType: ['album', 'camera'], //
success: (res) => {
self.src = res.tempFilePaths[0];
// datasrc
self.cropper.pushOrign(this.src);
}
});
}
}
};
</script>
<style scoped lang="scss">
@import '../../libs/css/style.components.scss';
.content {
background: rgba(255, 255, 255, 1);
}
.cropper {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
z-index: 11;
}
.cropper-buttons {
background-color: #000000;
color: #eee;
}
.cropper-wrapper {
position: relative;
@include vue-flex;
flex-direction: row;
justify-content: space-between;
align-items: center;
width: 100%;
background-color: #000;
}
.cropper-buttons {
width: 100vw;
@include vue-flex;
flex-direction: row;
justify-content: space-between;
align-items: center;
position: fixed;
bottom: 0;
left: 0;
font-size: 28rpx;
}
.cropper-buttons .upload,
.cropper-buttons .getCropperImage {
width: 50%;
text-align: center;
}
.cropper-buttons .upload {
text-align: left;
padding-left: 50rpx;
}
.cropper-buttons .getCropperImage {
text-align: right;
padding-right: 50rpx;
}
</style>

1265
uview-ui/components/u-avatar-cropper/weCropper.js

File diff suppressed because it is too large Load Diff

244
uview-ui/components/u-avatar/u-avatar.vue

@ -0,0 +1,244 @@
<template>
<view class="u-avatar" :style="[wrapStyle]" @tap="click">
<image
@error="loadError"
:style="[imgStyle]"
class="u-avatar__img"
v-if="!uText && avatar"
:src="avatar"
:mode="imgMode"
></image>
<text class="u-line-1" v-else-if="uText" :style="{
fontSize: '38rpx'
}">{{uText}}</text>
<slot v-else></slot>
<view class="u-avatar__sex" v-if="showSex" :class="['u-avatar__sex--' + sexIcon]" :style="[uSexStyle]">
<u-icon :name="sexIcon" size="20"></u-icon>
</view>
<view class="u-avatar__level" v-if="showLevel" :style="[uLevelStyle]">
<u-icon :name="levelIcon" size="20"></u-icon>
</view>
</view>
</template>
<script>
let base64Avatar = "data:image/jpg;base64,/9j/4QAYRXhpZgAASUkqAAgAAAAAAAAAAAAAAP/sABFEdWNreQABAAQAAAA8AAD/4QMraHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wLwA8P3hwYWNrZXQgYmVnaW49Iu+7vyIgaWQ9Ilc1TTBNcENlaGlIenJlU3pOVGN6a2M5ZCI/PiA8eDp4bXBtZXRhIHhtbG5zOng9ImFkb2JlOm5zOm1ldGEvIiB4OnhtcHRrPSJBZG9iZSBYTVAgQ29yZSA1LjMtYzAxMSA2Ni4xNDU2NjEsIDIwMTIvMDIvMDYtMTQ6NTY6MjcgICAgICAgICI+IDxyZGY6UkRGIHhtbG5zOnJkZj0iaHR0cDovL3d3dy53My5vcmcvMTk5OS8wMi8yMi1yZGYtc3ludGF4LW5zIyI+IDxyZGY6RGVzY3JpcHRpb24gcmRmOmFib3V0PSIiIHhtbG5zOnhtcD0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wLyIgeG1sbnM6eG1wTU09Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9tbS8iIHhtbG5zOnN0UmVmPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvc1R5cGUvUmVzb3VyY2VSZWYjIiB4bXA6Q3JlYXRvclRvb2w9IkFkb2JlIFBob3Rvc2hvcCBDUzYgKFdpbmRvd3MpIiB4bXBNTTpJbnN0YW5jZUlEPSJ4bXAuaWlkOjREMEQwRkY0RjgwNDExRUE5OTY2RDgxODY3NkJFODMxIiB4bXBNTTpEb2N1bWVudElEPSJ4bXAuZGlkOjREMEQwRkY1RjgwNDExRUE5OTY2RDgxODY3NkJFODMxIj4gPHhtcE1NOkRlcml2ZWRGcm9tIHN0UmVmOmluc3RhbmNlSUQ9InhtcC5paWQ6NEQwRDBGRjJGODA0MTFFQTk5NjZEODE4Njc2QkU4MzEiIHN0UmVmOmRvY3VtZW50SUQ9InhtcC5kaWQ6NEQwRDBGRjNGODA0MTFFQTk5NjZEODE4Njc2QkU4MzEiLz4gPC9yZGY6RGVzY3JpcHRpb24+IDwvcmRmOlJERj4gPC94OnhtcG1ldGE+IDw/eHBhY2tldCBlbmQ9InIiPz7/7gAOQWRvYmUAZMAAAAAB/9sAhAAGBAQEBQQGBQUGCQYFBgkLCAYGCAsMCgoLCgoMEAwMDAwMDBAMDg8QDw4MExMUFBMTHBsbGxwfHx8fHx8fHx8fAQcHBw0MDRgQEBgaFREVGh8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx//wAARCADIAMgDAREAAhEBAxEB/8QAcQABAQEAAwEBAAAAAAAAAAAAAAUEAQMGAgcBAQAAAAAAAAAAAAAAAAAAAAAQAAIBAwICBgkDBQAAAAAAAAABAhEDBCEFMVFBYXGREiKBscHRMkJSEyOh4XLxYjNDFBEBAAAAAAAAAAAAAAAAAAAAAP/aAAwDAQACEQMRAD8A/fAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHbHFyZ/Dam+yLA+Z2L0Pjtyj2poD4AAAAAAAAAAAAAAAAAAAAAAAAKWFs9y6lcvvwQeqj8z9wFaziY1n/HbUX9XF97A7QAGXI23EvJ1goyfzR0YEfN269jeZ+a03pNe0DIAAAAAAAAAAAAAAAAAAAACvtO3RcVkXlWutuL9YFYAAAAAOJRjKLjJVi9GmB5/csH/mu1h/in8PU+QGMAAAAAAAAAAAAAAAAAAaMDG/6MmMH8C80+xAelSSVFolwQAAAAAAAHVlWI37ErUulaPk+hgeYnCUJuElSUXRrrQHAAAAAAAAAAAAAAAAABa2Oz4bM7r4zdF2ICmAAAAAAAAAg7zZ8GX41wuJP0rRgYAAAAAAAAAAAAAAAAAD0m2R8ODaXU33tsDSAAAAAAAAAlb9HyWZcnJd9PcBHAAAAAAAAAAAAAAAAAPS7e64Vn+KA0AAAAAAAAAJm+v8Ftf3ewCKAAAAAAAAAAAAAAAAAX9muqeGo9NttP06+0DcAAAAAAAAAjb7dTu2ra+VOT9P8AQCWAAAAAAAAAAAAAAAAAUNmyPt5Ltv4bui/kuAF0AAAAAAADiUlGLlJ0SVW+oDzOXfd/Ind6JPRdS0QHSAAAAAAAAAAAAAAAAAE2nVaNcGB6Lbs6OTao9LsF51z60BrAAAAAABJ3jOVHjW3r/sa9QEgAAAAAAAAAAAAAAAAAAAPu1duWriuW34ZR4MC9hbnZyEoy8l36XwfYBsAAADaSq9EuLAlZ+7xSdrGdW9Hc5dgEdtt1erfFgAAAAAAAAAAAAAAAAADVjbblX6NR8MH80tEBRs7HYivyzlN8lovaBPzduvY0m6eK10TXtAyAarO55lpJK54orolr+4GqO/Xaea1FvqbXvA+Z77kNeW3GPbV+4DJfzcm/pcm3H6Vou5AdAFLC2ed2Pjv1txa8sV8T6wOL+yZEKu1JXFy4MDBOE4ScZxcZLinoB8gAAAAAAAAAAAB242LeyJ+C3GvN9C7QLmJtePYpKS+5c+p8F2IDYAANJqj1T4oCfk7Nj3G5Wn9qXJax7gJ93Z82D8sVNc4v30A6Xg5i42Z+iLfqARwcyT0sz9MWvWBps7LlTf5Grce9/oBTxdtxseklHxT+uWr9AGoAB138ezfj4bsFJdD6V2MCPm7RdtJzs1uW1xXzL3gTgAAAAAAAAADRhYc8q74I6RWs5ckB6GxYtWLat21SK731sDsAAAAAAAAAAAAAAAASt021NO/YjrxuQXT1oCOAAAAAAABzGLlJRSq26JAelwsWONYjbXxcZvmwO8AAAAAAAAAAAAAAAAAAef3TEWPkVivx3NY9T6UBiAAAAAABo2+VmGXblddIJ8eivRUD0oAAAAAAAAAAAAAAAAAAAYt4tKeFKVNYNSXfRgefAAAAAAAAr7VuSSWPedKaW5v1MCsAAAAAAAAAAAAAAAAAAIe6bj96Ts2n+JPzSXzP3ATgAAAAAAAAFbbt1UUrOQ9FpC4/UwK6aaqtU+DAAAAAAAAAAAAAAA4lKMIuUmoxWrb4ARNx3R3q2rLpa4Sl0y/YCcAAAAAAAAAAANmFud7G8r89r6X0dgFvGzLGRGtuWvTF6NAdwAAAAAAAAAAAy5W442PVN+K59EePp5ARMvOv5MvO6QXCC4AZwAAAAAAAAAAAAAcxlKLUotprg1owN+PvORborq+7Hnwl3gUbO74VzRydt8pKn68ANcJwmqwkpLmnUDkAAAAfNy9atqtyagut0AxXt5xIV8Fbj6lRd7Am5G65V6qUvtwfyx94GMAAAAAAAAAAAAAAAAAAAOU2nVOj5gdsc3LiqRvTpyqwOxbnnrhdfpSfrQB7pnv/AGvuS9gHXPMy5/Fem1yq0v0A6W29XqwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf//Z";
/**
* avatar 头像
* @description 本组件一般用于展示头像的地方如个人中心或者评论列表页的用户头像展示等场所
* @tutorial https://www.uviewui.com/components/avatar.html
* @property {String} bg-color 背景颜色一般显示文字时用默认#ffffff
* @property {String} src 头像路径如加载失败将会显示默认头像
* @property {String Number} size 头像尺寸可以为指定字符串(large, default, mini)或者数值单位rpx默认default
* @property {String} mode 显示类型见上方说明默认circle
* @property {String} sex-icon 性别图标man-woman-默认man
* @property {String} level-icon 等级图标默认level
* @property {String} sex-bg-color 性别图标背景颜色
* @property {String} level-bg-color 等级图标背景颜色
* @property {String} show-sex 是否显示性别图标默认false
* @property {String} show-level 是否显示等级图标默认false
* @property {String} img-mode 头像图片的裁剪类型与uni的image组件的mode参数一致如效果达不到需求可尝试传widthFix值默认aspectFill
* @property {String} index 用户传递的标识符值如果是列表循环可穿v-for的index值
* @event {Function} click 头像被点击
* @example <u-avatar :src="src"></u-avatar>
*/
export default {
name: 'u-avatar',
props: {
//
bgColor: {
type: String,
default: 'transparent'
},
//
src: {
type: String,
default: ''
},
// large-default-mini-rpx
//
size: {
type: [String, Number],
default: 'default'
},
// square-circle-
mode: {
type: String,
default: 'circle'
},
//
text: {
type: String,
default: ''
},
//
imgMode: {
type: String,
default: 'aspectFill'
},
//
index: {
type: [String, Number],
default: ''
},
// man-woman-
sexIcon: {
type: String,
default: 'man'
},
//
levelIcon: {
type: String,
default: 'level'
},
//
levelBgColor: {
type: String,
default: ''
},
//
sexBgColor: {
type: String,
default: ''
},
//
showSex: {
type: Boolean,
default: false
},
//
showLevel: {
type: Boolean,
default: false
}
},
data() {
return {
error: false,
// props
avatar: this.src ? this.src : base64Avatar,
}
},
watch: {
src(n) {
//
if(!n) {
// null''undefined
this.avatar = base64Avatar;
this.error = true;
} else {
this.avatar = n;
this.error = false;
}
}
},
computed: {
wrapStyle() {
let style = {};
style.height = this.size == 'large' ? '120rpx' : this.size == 'default' ?
'90rpx' : this.size == 'mini' ? '70rpx' : this.size + 'rpx';
style.width = style.height;
style.flex = `0 0 ${style.height}`;
style.backgroundColor = this.bgColor;
style.borderRadius = this.mode == 'circle' ? '500px' : '5px';
if(this.text) style.padding = `0 6rpx`;
return style;
},
imgStyle() {
let style = {};
style.borderRadius = this.mode == 'circle' ? '500px' : '5px';
return style;
},
//
uText() {
return String(this.text)[0];
},
//
uSexStyle() {
let style = {};
if(this.sexBgColor) style.backgroundColor = this.sexBgColor;
return style;
},
//
uLevelStyle() {
let style = {};
if(this.levelBgColor) style.backgroundColor = this.levelBgColor;
return style;
}
},
methods: {
//
loadError() {
this.error = true;
this.avatar = base64Avatar;
},
click() {
this.$emit('click', this.index);
}
}
}
</script>
<style lang="scss" scoped>
@import "../../libs/css/style.components.scss";
.u-avatar {
/* #ifndef APP-NVUE */
display: inline-flex;
/* #endif */
align-items: center;
justify-content: center;
font-size: 28rpx;
color: $u-content-color;
border-radius: 10px;
position: relative;
&__img {
width: 100%;
height: 100%;
}
&__sex {
position: absolute;
width: 32rpx;
color: #ffffff;
height: 32rpx;
@include vue-flex;
justify-content: center;
align-items: center;
border-radius: 100rpx;
top: 5%;
z-index: 1;
right: -7%;
border: 1px #ffffff solid;
&--man {
background-color: $u-type-primary;
}
&--woman {
background-color: $u-type-error;
}
&--none {
background-color: $u-type-warning;
}
}
&__level {
position: absolute;
width: 32rpx;
color: #ffffff;
height: 32rpx;
@include vue-flex;
justify-content: center;
align-items: center;
border-radius: 100rpx;
bottom: 5%;
z-index: 1;
right: -7%;
border: 1px #ffffff solid;
background-color: $u-type-warning;
}
}
</style>

153
uview-ui/components/u-back-top/u-back-top.vue

@ -0,0 +1,153 @@
<template>
<view @tap="backToTop" class="u-back-top" :class="['u-back-top--mode--' + mode]" :style="[{
bottom: bottom + 'rpx',
right: right + 'rpx',
borderRadius: mode == 'circle' ? '10000rpx' : '8rpx',
zIndex: uZIndex,
opacity: opacity
}, customStyle]">
<view class="u-back-top__content" v-if="!$slots.default && !$slots.$default">
<u-icon @click="backToTop" :name="icon" :custom-style="iconStyle"></u-icon>
<view class="u-back-top__content__tips">
{{tips}}
</view>
</view>
<slot v-else />
</view>
</template>
<script>
export default {
name: 'u-back-top',
props: {
// circle-square-
mode: {
type: String,
default: 'circle'
},
//
icon: {
type: String,
default: 'arrow-upward'
},
//
tips: {
type: String,
default: ''
},
//
duration: {
type: [Number, String],
default: 100
},
//
scrollTop: {
type: [Number, String],
default: 0
},
// rpx
top: {
type: [Number, String],
default: 400
},
// rpx
bottom: {
type: [Number, String],
default: 200
},
// rpx
right: {
type: [Number, String],
default: 40
},
//
zIndex: {
type: [Number, String],
default: '9'
},
//
iconStyle: {
type: Object,
default() {
return {
color: '#909399',
fontSize: '38rpx'
}
}
},
//
customStyle: {
type: Object,
default() {
return {}
}
}
},
watch: {
showBackTop(nVal, oVal) {
//
// v-if
if(nVal) {
this.uZIndex = this.zIndex;
this.opacity = 1;
} else {
this.uZIndex = -1;
this.opacity = 0;
}
}
},
computed: {
showBackTop() {
// scrollToppxtop(rpx)
// px
return this.scrollTop > uni.upx2px(this.top);
},
},
data() {
return {
//
opacity: 0,
// z-index-1
uZIndex: -1
}
},
methods: {
backToTop() {
uni.pageScrollTo({
scrollTop: 0,
duration: this.duration
});
}
}
}
</script>
<style lang="scss" scoped>
@import "../../libs/css/style.components.scss";
.u-back-top {
width: 80rpx;
height: 80rpx;
position: fixed;
z-index: 9;
@include vue-flex;
flex-direction: column;
justify-content: center;
background-color: #E1E1E1;
color: $u-content-color;
align-items: center;
transition: opacity 0.4s;
&__content {
@include vue-flex;
flex-direction: column;
align-items: center;
&__tips {
font-size: 24rpx;
transform: scale(0.8);
line-height: 1;
}
}
}
</style>

216
uview-ui/components/u-badge/u-badge.vue

@ -0,0 +1,216 @@
<template>
<view v-if="show" class="u-badge" :class="[
isDot ? 'u-badge-dot' : '',
size == 'mini' ? 'u-badge-mini' : '',
type ? 'u-badge--bg--' + type : ''
]" :style="[{
top: offset[0] + 'rpx',
right: offset[1] + 'rpx',
fontSize: fontSize + 'rpx',
position: absolute ? 'absolute' : 'static',
color: color,
backgroundColor: bgColor
}, boxStyle]"
>
{{showText}}
</view>
</template>
<script>
/**
* badge 角标
* @description 本组件一般用于展示头像的地方如个人中心或者评论列表页的用户头像展示等场所
* @tutorial https://www.uviewui.com/components/badge.html
* @property {String Number} count 展示的数字大于 overflowCount 时显示为 ${overflowCount}+为0且show-zero为false时隐藏
* @property {Boolean} is-dot 不展示数字只有一个小点默认false
* @property {Boolean} absolute 组件是否绝对定位为true时offset参数才有效默认true
* @property {String Number} overflow-count 展示封顶的数字值默认99
* @property {String} type 使用预设的背景颜色默认error
* @property {Boolean} show-zero 当数值为 0 是否展示 Badge默认false
* @property {String} size Badge的尺寸设为mini会得到小一号的Badge默认default
* @property {Array} offset 设置badge的位置偏移格式为 [x, y]也即设置的为top和right的值单位rpxabsolute为true时有效默认[20, 20]
* @property {String} color 字体颜色默认#ffffff
* @property {String} bgColor 背景颜色优先级比type高如设置type参数会失效
* @property {Boolean} is-center 组件中心点是否和父组件右上角重合优先级比offset高如设置offset参数会失效默认false
* @example <u-badge type="error" count="7"></u-badge>
*/
export default {
name: 'u-badge',
props: {
// primary,warning,success,error,info
type: {
type: String,
default: 'error'
},
// default, mini
size: {
type: String,
default: 'default'
},
//
isDot: {
type: Boolean,
default: false
},
//
count: {
type: [Number, String],
},
//
overflowCount: {
type: Number,
default: 99
},
// 0 Badge
showZero: {
type: Boolean,
default: false
},
//
offset: {
type: Array,
default: () => {
return [20, 20]
}
},
// offset
absolute: {
type: Boolean,
default: true
},
//
fontSize: {
type: [String, Number],
default: '24'
},
//
color: {
type: String,
default: '#ffffff'
},
// badge
bgColor: {
type: String,
default: ''
},
// badgeoffset
isCenter: {
type: Boolean,
default: false
}
},
computed: {
// badge
boxStyle() {
let style = {};
if(this.isCenter) {
style.top = 0;
style.right = 0;
// Y-50%badgebadgeX50%
style.transform = "translateY(-50%) translateX(50%)";
} else {
style.top = this.offset[0] + 'rpx';
style.right = this.offset[1] + 'rpx';
style.transform = "translateY(0) translateX(0)";
}
// miniscal()
if(this.size == 'mini') {
style.transform = style.transform + " scale(0.8)";
}
return style;
},
// isDot
showText() {
if(this.isDot) return '';
else {
if(this.count > this.overflowCount) return `${this.overflowCount}+`;
else return this.count;
}
},
//
show() {
// count0showZerofalse
if(this.count == 0 && this.showZero == false) return false;
else return true;
}
}
}
</script>
<style lang="scss" scoped>
@import "../../libs/css/style.components.scss";
.u-badge {
/* #ifndef APP-NVUE */
display: inline-flex;
/* #endif */
justify-content: center;
align-items: center;
line-height: 24rpx;
padding: 4rpx 8rpx;
border-radius: 100rpx;
z-index: 9;
&--bg--primary {
background-color: $u-type-primary;
}
&--bg--error {
background-color: $u-type-error;
}
&--bg--success {
background-color: $u-type-success;
}
&--bg--info {
background-color: $u-type-info;
}
&--bg--warning {
background-color: $u-type-warning;
}
}
.u-badge-dot {
height: 16rpx;
width: 16rpx;
border-radius: 100rpx;
line-height: 1;
}
.u-badge-mini {
transform: scale(0.8);
transform-origin: center center;
}
// .u-primary {
// background: $u-type-primary;
// color: #fff;
// }
// .u-error {
// background: $u-type-error;
// color: #fff;
// }
// .u-warning {
// background: $u-type-warning;
// color: #fff;
// }
// .u-success {
// background: $u-type-success;
// color: #fff;
// }
// .u-black {
// background: #585858;
// color: #fff;
// }
.u-info {
background-color: $u-type-info;
color: #fff;
}
</style>

596
uview-ui/components/u-button/u-button.vue

@ -0,0 +1,596 @@
<template>
<button
id="u-wave-btn"
class="u-btn u-line-1 u-fix-ios-appearance"
:class="[
'u-size-' + size,
plain ? 'u-btn--' + type + '--plain' : '',
loading ? 'u-loading' : '',
shape == 'circle' ? 'u-round-circle' : '',
hairLine ? showHairLineBorder : 'u-btn--bold-border',
'u-btn--' + type,
disabled ? `u-btn--${type}--disabled` : '',
]"
:hover-start-time="Number(hoverStartTime)"
:hover-stay-time="Number(hoverStayTime)"
:disabled="disabled"
:form-type="formType"
:open-type="openType"
:app-parameter="appParameter"
:hover-stop-propagation="hoverStopPropagation"
:send-message-title="sendMessageTitle"
send-message-path="sendMessagePath"
:lang="lang"
:data-name="dataName"
:session-from="sessionFrom"
:send-message-img="sendMessageImg"
:show-message-card="showMessageCard"
@getphonenumber="getphonenumber"
@getuserinfo="getuserinfo"
@error="error"
@opensetting="opensetting"
@launchapp="launchapp"
:style="[customStyle, {
overflow: ripple ? 'hidden' : 'visible'
}]"
@tap.stop="click($event)"
:hover-class="getHoverClass"
:loading="loading"
>
<slot></slot>
<view
v-if="ripple"
class="u-wave-ripple"
:class="[waveActive ? 'u-wave-active' : '']"
:style="{
top: rippleTop + 'px',
left: rippleLeft + 'px',
width: fields.targetWidth + 'px',
height: fields.targetWidth + 'px',
'background-color': rippleBgColor || 'rgba(0, 0, 0, 0.15)'
}"
></view>
</button>
</template>
<script>
/**
* button 按钮
* @description Button 按钮
* @tutorial https://www.uviewui.com/components/button.html
* @property {String} size 按钮的大小
* @property {Boolean} ripple 是否开启点击水波纹效果
* @property {String} ripple-bg-color 水波纹的背景色ripple为true时有效
* @property {String} type 按钮的样式类型
* @property {Boolean} plain 按钮是否镂空背景色透明
* @property {Boolean} disabled 是否禁用
* @property {Boolean} hair-line 是否显示按钮的细边框(默认true)
* @property {Boolean} shape 按钮外观形状见文档说明
* @property {Boolean} loading 按钮名称前是否带 loading 图标(App-nvue 平台 ios 上为雪花Android上为圆圈)
* @property {String} form-type 用于 <form> 组件点击分别会触发 <form> 组件的 submit/reset 事件
* @property {String} open-type 开放能力
* @property {String} data-name 额外传参参数用于小程序的data-xxx属性通过target.dataset.name获取
* @property {String} hover-class 指定按钮按下去的样式类 hover-class="none" 没有点击态效果(App-nvue 平台暂不支持)
* @property {Number} hover-start-time 按住后多久出现点击态单位毫秒
* @property {Number} hover-stay-time 手指松开后点击态保留时间单位毫秒
* @property {Object} custom-style 对按钮的自定义样式对象形式见文档说明
* @event {Function} click 按钮点击
* @event {Function} getphonenumber open-type="getPhoneNumber"时有效
* @event {Function} getuserinfo 用户点击该按钮时会返回获取到的用户信息从返回参数的detail中获取到的值同uni.getUserInfo
* @event {Function} error 当使用开放能力时发生错误的回调
* @event {Function} opensetting 在打开授权设置页并关闭后回调
* @event {Function} launchapp 打开 APP 成功的回调
* @example <u-button>月落</u-button>
*/
export default {
name: 'u-button',
props: {
//
hairLine: {
type: Boolean,
default: true
},
// defaultprimaryerrorwarningsuccess
type: {
type: String,
default: 'default'
},
// defaultmediummini
size: {
type: String,
default: 'default'
},
// circlesquare
shape: {
type: String,
default: 'square'
},
//
plain: {
type: Boolean,
default: false
},
//
disabled: {
type: Boolean,
default: false
},
//
loading: {
type: Boolean,
default: false
},
// uniappbutton
// https://uniapp.dcloud.io/component/button
openType: {
type: String,
default: ''
},
// <form> <form> submit/reset
// submitreset
formType: {
type: String,
default: ''
},
// APP APP open-type=launchApp
// QQ
appParameter: {
type: String,
default: ''
},
//
hoverStopPropagation: {
type: Boolean,
default: false
},
// zh_CN zh_TW en
lang: {
type: String,
default: 'en'
},
// open-type="contact"
sessionFrom: {
type: String,
default: ''
},
// open-type="contact"
//
sendMessageTitle: {
type: String,
default: ''
},
// open-type="contact"
//
sendMessagePath: {
type: String,
default: ''
},
// open-type="contact"
//
sendMessageImg: {
type: String,
default: ''
},
// true""
// open-type="contact"
showMessageCard: {
type: Boolean,
default: false
},
//
hoverBgColor: {
type: String,
default: ''
},
//
rippleBgColor: {
type: String,
default: ''
},
//
ripple: {
type: Boolean,
default: false
},
//
hoverClass: {
type: String,
default: ''
},
//
customStyle: {
type: Object,
default() {
return {};
}
},
// data-xxxtarget.dataset.name
dataName: {
type: String,
default: ''
},
//
throttleTime: {
type: [String, Number],
default: 1000
},
//
hoverStartTime: {
type: [String, Number],
default: 20
},
//
hoverStayTime: {
type: [String, Number],
default: 150
},
},
computed: {
// bgColor
getHoverClass() {
// hover-class
if (this.loading || this.disabled || this.ripple || this.hoverClass) return '';
let hoverClass = '';
hoverClass = this.plain ? 'u-' + this.type + '-plain-hover' : 'u-' + this.type + '-hover';
return hoverClass;
},
// 'primary', 'success', 'error', 'warning'
showHairLineBorder() {
if (['primary', 'success', 'error', 'warning'].indexOf(this.type) >= 0 && !this.plain) {
return '';
} else {
return 'u-hairline-border';
}
}
},
data() {
return {
rippleTop: 0, // Y
rippleLeft: 0, // X
fields: {}, //
waveActive: false //
};
},
methods: {
//
click(e) {
// this.throttle
this.$u.throttle(() => {
// disabledloading
if (this.loading === true || this.disabled === true) return;
//
if (this.ripple) {
//
this.waveActive = false;
this.$nextTick(function() {
this.getWaveQuery(e);
});
}
this.$emit('click', e);
}, this.throttleTime);
},
//
getWaveQuery(e) {
this.getElQuery().then(res => {
//
let data = res[0];
//
if (!data.width || !data.width) return;
// (border-radius)
//
data.targetWidth = data.height > data.width ? data.height : data.width;
if (!data.targetWidth) return;
this.fields = data;
let touchesX = '',
touchesY = '';
// #ifdef MP-BAIDU
touchesX = e.changedTouches[0].clientX;
touchesY = e.changedTouches[0].clientY;
// #endif
// #ifdef MP-ALIPAY
touchesX = e.detail.clientX;
touchesY = e.detail.clientY;
// #endif
// #ifndef MP-BAIDU || MP-ALIPAY
touchesX = e.touches[0].clientX;
touchesY = e.touches[0].clientY;
// #endif
// xytouchesYdata.top
// `transform-origin`centerview
//
this.rippleTop = touchesY - data.top - data.targetWidth / 2;
this.rippleLeft = touchesX - data.left - data.targetWidth / 2;
this.$nextTick(() => {
this.waveActive = true;
});
});
},
//
getElQuery() {
return new Promise(resolve => {
let queryInfo = '';
// uniapp
// https://uniapp.dcloud.io/api/ui/nodes-info?id=nodesrefboundingclientrect
queryInfo = uni.createSelectorQuery().in(this);
//#ifdef MP-ALIPAY
queryInfo = uni.createSelectorQuery();
//#endif
queryInfo.select('.u-btn').boundingClientRect();
queryInfo.exec(data => {
resolve(data);
});
});
},
// uniapp
getphonenumber(res) {
this.$emit('getphonenumber', res);
},
getuserinfo(res) {
this.$emit('getuserinfo', res);
},
error(res) {
this.$emit('error', res);
},
opensetting(res) {
this.$emit('opensetting', res);
},
launchapp(res) {
this.$emit('launchapp', res);
}
}
};
</script>
<style scoped lang="scss">
@import '../../libs/css/style.components.scss';
.u-btn::after {
border: none;
}
.u-btn {
position: relative;
border: 0;
//border-radius: 10rpx;
/* #ifndef APP-NVUE */
display: inline-flex;
/* #endif */
// hidden
overflow: visible;
line-height: 1;
@include vue-flex;
align-items: center;
justify-content: center;
cursor: pointer;
padding: 0 40rpx;
z-index: 1;
box-sizing: border-box;
transition: all 0.15s;
&--bold-border {
border: 1px solid #ffffff;
}
&--default {
color: $u-content-color;
border-color: #c0c4cc;
background-color: #ffffff;
}
&--primary {
color: #ffffff;
border-color: $u-type-primary;
background-color: $u-type-primary;
}
&--success {
color: #ffffff;
border-color: $u-type-success;
background-color: $u-type-success;
}
&--error {
color: #ffffff;
border-color: $u-type-error;
background-color: $u-type-error;
}
&--warning {
color: #ffffff;
border-color: $u-type-warning;
background-color: $u-type-warning;
}
&--default--disabled {
color: #ffffff;
border-color: #e4e7ed;
background-color: #ffffff;
}
&--primary--disabled {
color: #ffffff!important;
border-color: $u-type-primary-disabled!important;
background-color: $u-type-primary-disabled!important;
}
&--success--disabled {
color: #ffffff!important;
border-color: $u-type-success-disabled!important;
background-color: $u-type-success-disabled!important;
}
&--error--disabled {
color: #ffffff!important;
border-color: $u-type-error-disabled!important;
background-color: $u-type-error-disabled!important;
}
&--warning--disabled {
color: #ffffff!important;
border-color: $u-type-warning-disabled!important;
background-color: $u-type-warning-disabled!important;
}
&--primary--plain {
color: $u-type-primary!important;
border-color: $u-type-primary-disabled!important;
background-color: $u-type-primary-light!important;
}
&--success--plain {
color: $u-type-success!important;
border-color: $u-type-success-disabled!important;
background-color: $u-type-success-light!important;
}
&--error--plain {
color: $u-type-error!important;
border-color: $u-type-error-disabled!important;
background-color: $u-type-error-light!important;
}
&--warning--plain {
color: $u-type-warning!important;
border-color: $u-type-warning-disabled!important;
background-color: $u-type-warning-light!important;
}
}
.u-hairline-border:after {
content: ' ';
position: absolute;
pointer-events: none;
// border-boxscale0.5border-boxborder
box-sizing: border-box;
// (scale())
-webkit-transform-origin: 0 0;
transform-origin: 0 0;
left: 0;
top: 0;
width: 199.8%;
height: 199.7%;
-webkit-transform: scale(0.5, 0.5);
transform: scale(0.5, 0.5);
border: 1px solid currentColor;
z-index: 1;
}
.u-wave-ripple {
z-index: 0;
position: absolute;
border-radius: 100%;
background-clip: padding-box;
pointer-events: none;
user-select: none;
transform: scale(0);
opacity: 1;
transform-origin: center;
}
.u-wave-ripple.u-wave-active {
opacity: 0;
transform: scale(2);
transition: opacity 1s linear, transform 0.4s linear;
}
.u-round-circle {
border-radius: 100rpx;
}
.u-round-circle::after {
border-radius: 100rpx;
}
.u-loading::after {
background-color: hsla(0, 0%, 100%, 0.35);
}
.u-size-default {
font-size: 30rpx;
height: 80rpx;
line-height: 80rpx;
}
.u-size-medium {
/* #ifndef APP-NVUE */
display: inline-flex;
/* #endif */
width: auto;
font-size: 26rpx;
height: 70rpx;
line-height: 70rpx;
padding: 0 80rpx;
}
.u-size-mini {
/* #ifndef APP-NVUE */
display: inline-flex;
/* #endif */
width: auto;
font-size: 22rpx;
padding-top: 1px;
height: 50rpx;
line-height: 50rpx;
padding: 0 20rpx;
}
.u-primary-plain-hover {
color: #ffffff !important;
background: $u-type-primary-dark !important;
}
.u-default-plain-hover {
color: $u-type-primary-dark !important;
background: $u-type-primary-light !important;
}
.u-success-plain-hover {
color: #ffffff !important;
background: $u-type-success-dark !important;
}
.u-warning-plain-hover {
color: #ffffff !important;
background: $u-type-warning-dark !important;
}
.u-error-plain-hover {
color: #ffffff !important;
background: $u-type-error-dark !important;
}
.u-info-plain-hover {
color: #ffffff !important;
background: $u-type-info-dark !important;
}
.u-default-hover {
color: $u-type-primary-dark !important;
border-color: $u-type-primary-dark !important;
background-color: $u-type-primary-light !important;
}
.u-primary-hover {
background: $u-type-primary-dark !important;
color: #fff;
}
.u-success-hover {
background: $u-type-success-dark !important;
color: #fff;
}
.u-info-hover {
background: $u-type-info-dark !important;
color: #fff;
}
.u-warning-hover {
background: $u-type-warning-dark !important;
color: #fff;
}
.u-error-hover {
background: $u-type-error-dark !important;
color: #fff;
}
</style>

639
uview-ui/components/u-calendar/u-calendar.vue

@ -0,0 +1,639 @@
<template>
<u-popup closeable :maskCloseAble="maskCloseAble" mode="bottom" :popup="false" v-model="value" length="auto"
:safeAreaInsetBottom="safeAreaInsetBottom" @close="close" :z-index="uZIndex" :border-radius="borderRadius" :closeable="closeable">
<view class="u-calendar">
<view class="u-calendar__header">
<view class="u-calendar__header__text" v-if="!$slots['tooltip']">
{{toolTip}}
</view>
<slot v-else name="tooltip" />
</view>
<view class="u-calendar__action u-flex u-row-center">
<view class="u-calendar__action__icon">
<u-icon v-if="changeYear" name="arrow-left-double" :color="yearArrowColor" @click="changeYearHandler(0)"></u-icon>
</view>
<view class="u-calendar__action__icon">
<u-icon v-if="changeMonth" name="arrow-left" :color="monthArrowColor" @click="changeMonthHandler(0)"></u-icon>
</view>
<view class="u-calendar__action__text">{{ showTitle }}</view>
<view class="u-calendar__action__icon">
<u-icon v-if="changeMonth" name="arrow-right" :color="monthArrowColor" @click="changeMonthHandler(1)"></u-icon>
</view>
<view class="u-calendar__action__icon">
<u-icon v-if="changeYear" name="arrow-right-double" :color="yearArrowColor" @click="changeYearHandler(1)"></u-icon>
</view>
</view>
<view class="u-calendar__week-day">
<view class="u-calendar__week-day__text" v-for="(item, index) in weekDayZh" :key="index">{{item}}</view>
</view>
<view class="u-calendar__content">
<!-- 前置空白部分 -->
<block v-for="(item, index) in weekdayArr" :key="index">
<view class="u-calendar__content__item"></view>
</block>
<view class="u-calendar__content__item" :class="{
'u-hover-class':openDisAbled(year,month,index+1),
'u-calendar__content--start-date': (mode == 'range' && startDate==`${year}-${month}-${index+1}`) || mode== 'date',
'u-calendar__content--end-date':(mode== 'range' && endDate==`${year}-${month}-${index+1}`) || mode == 'date'
}" :style="{backgroundColor: getColor(index,1)}" v-for="(item, index) in daysArr" :key="index"
@tap="dateClick(index)">
<view class="u-calendar__content__item__inner" :style="{color: getColor(index,2)}">
<view>{{ index + 1 }}</view>
</view>
<view class="u-calendar__content__item__tips" :style="{color:activeColor}" v-if="mode== 'range' && startDate==`${year}-${month}-${index+1}` && startDate!=endDate">{{startText}}</view>
<view class="u-calendar__content__item__tips" :style="{color:activeColor}" v-if="mode== 'range' && endDate==`${year}-${month}-${index+1}`">{{endText}}</view>
</view>
<view class="u-calendar__content__bg-month">{{month}}</view>
</view>
<view class="u-calendar__bottom">
<view class="u-calendar__bottom__choose">
<text>{{mode == 'date' ? activeDate : startDate}}</text>
<text v-if="endDate">{{endDate}}</text>
</view>
<view class="u-calendar__bottom__btn">
<u-button :type="btnType" shape="circle" size="default" @click="btnFix(false)">确定</u-button>
</view>
</view>
</view>
</u-popup>
</template>
<script>
/**
* calendar 日历
* @description 此组件用于单个选择日期范围选择日期等日历被包裹在底部弹起的容器中
* @tutorial http://uviewui.com/components/calendar.html
* @property {String} mode 选择日期的模式date-为单个日期range-为选择日期范围
* @property {Boolean} v-model 布尔值变量用于控制日历的弹出与收起
* @property {Boolean} safe-area-inset-bottom 是否开启底部安全区适配(默认false)
* @property {Boolean} change-year 是否显示顶部的切换年份方向的按钮(默认true)
* @property {Boolean} change-month 是否显示顶部的切换月份方向的按钮(默认true)
* @property {String Number} max-year 可切换的最大年份(默认2050)
* @property {String Number} min-year 可切换的最小年份(默认1950)
* @property {String Number} min-date 最小可选日期(默认1950-01-01)
* @property {String Number} max-date 最大可选日期(默认当前日期)
* @property {String Number} 弹窗顶部左右两边的圆角值单位rpx(默认20)
* @property {Boolean} mask-close-able 是否允许通过点击遮罩关闭日历(默认true)
* @property {String} month-arrow-color 月份切换按钮箭头颜色(默认#606266)
* @property {String} year-arrow-color 年份切换按钮箭头颜色(默认#909399)
* @property {String} color 日期字体的默认颜色(默认#303133)
* @property {String} active-bg-color 起始/结束日期按钮的背景色(默认#2979ff)
* @property {String Number} z-index 弹出时的z-index值(默认10075)
* @property {String} active-color 起始/结束日期按钮的字体颜色(默认#ffffff)
* @property {String} range-bg-color 起始/结束日期之间的区域的背景颜色(默认rgba(41,121,255,0.13))
* @property {String} range-color 选择范围内字体颜色(默认#2979ff)
* @property {String} start-text 起始日期底部的提示文字(默认 '开始')
* @property {String} end-text 结束日期底部的提示文字(默认 '结束')
* @property {String} btn-type 底部确定按钮的主题(默认 'primary')
* @property {String} toolTip 顶部提示文字如设置名为tooltip的slot此参数将失效(默认 '选择日期')
* @property {Boolean} closeable 是否显示右上角的关闭图标(默认true)
* @example <u-calendar v-model="show" :mode="mode"></u-calendar>
*/
export default {
name: 'u-calendar',
props: {
safeAreaInsetBottom: {
type: Boolean,
default: false
},
// Picker
maskCloseAble: {
type: Boolean,
default: true
},
//
value: {
type: Boolean,
default: false
},
// z-index
zIndex: {
type: [String, Number],
default: 0
},
//
changeYear: {
type: Boolean,
default: true
},
//
changeMonth: {
type: Boolean,
default: true
},
// date-range-+
mode: {
type: String,
default: 'date'
},
//
maxYear: {
type: [Number, String],
default: 2050
},
//
minYear: {
type: [Number, String],
default: 1950
},
// ()
minDate: {
type: [Number, String],
default: '1950-01-01'
},
/**
* 最大可选日期
* 默认最大值为今天之后的日期不可选
* 2030-12-31
* */
maxDate: {
type: [Number, String],
default: ''
},
//
borderRadius: {
type: [String, Number],
default: 20
},
//
monthArrowColor: {
type: String,
default: '#606266'
},
//
yearArrowColor: {
type: String,
default: '#909399'
},
//
color: {
type: String,
default: '#303133'
},
// |
activeBgColor: {
type: String,
default: '#2979ff'
},
// |
activeColor: {
type: String,
default: '#ffffff'
},
//
rangeBgColor: {
type: String,
default: 'rgba(41,121,255,0.13)'
},
//
rangeColor: {
type: String,
default: '#2979ff'
},
// mode=range
startText: {
type: String,
default: '开始'
},
// mode=range
endText: {
type: String,
default: '结束'
},
//
btnType: {
type: String,
default: 'primary'
},
//
isActiveCurrent: {
type: Boolean,
default: true
},
// mode=date
isChange: {
type: Boolean,
default: false
},
//
closeable: {
type: Boolean,
default: true
},
//
toolTip: {
type: String,
default: '选择日期'
}
},
data() {
return {
// ,1-7
weekday: 1,
weekdayArr:[],
//
days: 0,
daysArr:[],
showTitle: '',
year: 2020,
month: 0,
day: 0,
startYear: 0,
startMonth: 0,
startDay: 0,
endYear: 0,
endMonth: 0,
endDay: 0,
today: '',
activeDate: '',
startDate: '',
endDate: '',
isStart: true,
min: null,
max: null,
weekDayZh: ['日', '一', '二', '三', '四', '五', '六']
};
},
computed: {
dataChange() {
return `${this.mode}-${this.minDate}-${this.maxDate}`;
},
uZIndex() {
// z-index使
return this.zIndex ? this.zIndex : this.$u.zIndex.popup;
}
},
watch: {
dataChange(val) {
this.init()
}
},
created() {
this.init()
},
methods: {
getColor(index, type) {
let color = type == 1 ? '' : this.color;
let day = index + 1
let date = `${this.year}-${this.month}-${day}`
let timestamp = new Date(date.replace(/\-/g, '/')).getTime();
let start = this.startDate.replace(/\-/g, '/')
let end = this.endDate.replace(/\-/g, '/')
if ((this.isActiveCurrent && this.activeDate == date) || this.startDate == date || this.endDate == date) {
color = type == 1 ? this.activeBgColor : this.activeColor;
} else if (this.endDate && timestamp > new Date(start).getTime() && timestamp < new Date(end).getTime()) {
color = type == 1 ? this.rangeBgColor : this.rangeColor;
}
return color;
},
init() {
let now = new Date();
this.year = now.getFullYear();
this.month = now.getMonth() + 1;
this.day = now.getDate();
this.today = `${now.getFullYear()}-${now.getMonth() + 1}-${now.getDate()}`;
this.activeDate = this.today;
this.min = this.initDate(this.minDate);
this.max = this.initDate(this.maxDate || this.today);
this.startDate = "";
this.startYear = 0;
this.startMonth = 0;
this.startDay = 0;
this.endYear = 0;
this.endMonth = 0;
this.endDay = 0;
this.endDate = "";
this.isStart = true;
this.changeData();
},
//
initDate(date) {
let fdate = date.split('-');
return {
year: Number(fdate[0] || 1920),
month: Number(fdate[1] || 1),
day: Number(fdate[2] || 1)
}
},
openDisAbled: function(year, month, day) {
let bool = true;
let date = `${year}/${month}/${day}`;
// let today = this.today.replace(/\-/g, '/');
let min = `${this.min.year}/${this.min.month}/${this.min.day}`;
let max = `${this.max.year}/${this.max.month}/${this.max.day}`;
let timestamp = new Date(date).getTime();
if (timestamp >= new Date(min).getTime() && timestamp <= new Date(max).getTime()) {
bool = false;
}
return bool;
},
generateArray: function(start, end) {
return Array.from(new Array(end + 1).keys()).slice(start);
},
formatNum: function(num) {
return num < 10 ? '0' + num : num + '';
},
//
getMonthDay(year, month) {
let days = new Date(year, month, 0).getDate();
return days;
},
getWeekday(year, month) {
let date = new Date(`${year}/${month}/01 00:00:00`);
return date.getDay();
},
checkRange(year) {
let overstep = false;
if (year < this.minYear || year > this.maxYear) {
uni.showToast({
title: "日期超出范围啦~",
icon: 'none'
})
overstep = true;
}
return overstep;
},
changeMonthHandler(isAdd) {
if (isAdd) {
let month = this.month + 1;
let year = month > 12 ? this.year + 1 : this.year;
if (!this.checkRange(year)) {
this.month = month > 12 ? 1 : month;
this.year = year;
this.changeData();
}
} else {
let month = this.month - 1;
let year = month < 1 ? this.year - 1 : this.year;
if (!this.checkRange(year)) {
this.month = month < 1 ? 12 : month;
this.year = year;
this.changeData();
}
}
},
changeYearHandler(isAdd) {
let year = isAdd ? this.year + 1 : this.year - 1;
if (!this.checkRange(year)) {
this.year = year;
this.changeData();
}
},
changeData() {
this.days = this.getMonthDay(this.year, this.month);
this.daysArr=this.generateArray(1,this.days)
this.weekday = this.getWeekday(this.year, this.month);
this.weekdayArr=this.generateArray(1,this.weekday)
this.showTitle = `${this.year}${this.month}`;
if (this.isChange && this.mode == 'date') {
this.btnFix(true);
}
},
dateClick: function(day) {
day += 1;
if (!this.openDisAbled(this.year, this.month, day)) {
this.day = day;
let date = `${this.year}-${this.month}-${day}`;
if (this.mode == 'date') {
this.activeDate = date;
} else {
let compare = new Date(date.replace(/\-/g, '/')).getTime() < new Date(this.startDate.replace(/\-/g, '/')).getTime()
if (this.isStart || compare) {
this.startDate = date;
this.startYear = this.year;
this.startMonth = this.month;
this.startDay = this.day;
this.endYear = 0;
this.endMonth = 0;
this.endDay = 0;
this.endDate = "";
this.activeDate = "";
this.isStart = false;
} else {
this.endDate = date;
this.endYear = this.year;
this.endMonth = this.month;
this.endDay = this.day;
this.isStart = true;
}
}
}
},
close() {
// v-modelfalse
this.$emit('input', false);
},
getWeekText(date) {
date = new Date(`${date.replace(/\-/g, '/')} 00:00:00`);
let week = date.getDay();
return '星期' + ['日', '一', '二', '三', '四', '五', '六'][week];
},
btnFix(show) {
if (!show) {
this.close();
}
if (this.mode == 'date') {
let arr = this.activeDate.split('-')
let year = this.isChange ? this.year : Number(arr[0]);
let month = this.isChange ? this.month : Number(arr[1]);
let day = this.isChange ? this.day : Number(arr[2]);
//
let days = this.getMonthDay(year, month);
let result = `${year}-${this.formatNum(month)}-${this.formatNum(day)}`;
let weekText = this.getWeekText(result);
let isToday = false;
if (`${year}-${month}-${day}` == this.today) {
//
isToday = true;
}
this.$emit('change', {
year: year,
month: month,
day: day,
days: days,
result: result,
week: weekText,
isToday: isToday,
// switch: show //
});
} else {
if (!this.startDate || !this.endDate) return;
let startMonth = this.formatNum(this.startMonth);
let startDay = this.formatNum(this.startDay);
let startDate = `${this.startYear}-${startMonth}-${startDay}`;
let startWeek = this.getWeekText(startDate)
let endMonth = this.formatNum(this.endMonth);
let endDay = this.formatNum(this.endDay);
let endDate = `${this.endYear}-${endMonth}-${endDay}`;
let endWeek = this.getWeekText(endDate);
this.$emit('change', {
startYear: this.startYear,
startMonth: this.startMonth,
startDay: this.startDay,
startDate: startDate,
startWeek: startWeek,
endYear: this.endYear,
endMonth: this.endMonth,
endDay: this.endDay,
endDate: endDate,
endWeek: endWeek
});
}
}
}
};
</script>
<style scoped lang="scss">
@import "../../libs/css/style.components.scss";
.u-calendar {
color: $u-content-color;
&__header {
width: 100%;
box-sizing: border-box;
font-size: 30rpx;
background-color: #fff;
color: $u-main-color;
&__text {
margin-top: 30rpx;
padding: 0 60rpx;
@include vue-flex;
justify-content: center;
align-items: center;
}
}
&__action {
padding: 40rpx 0 40rpx 0;
&__icon {
margin: 0 16rpx;
}
&__text {
padding: 0 16rpx;
color: $u-main-color;
font-size: 32rpx;
line-height: 32rpx;
font-weight: bold;
}
}
&__week-day {
@include vue-flex;
align-items: center;
justify-content: center;
padding: 6px 0;
overflow: hidden;
&__text {
flex: 1;
text-align: center;
}
}
&__content {
width: 100%;
@include vue-flex;
flex-wrap: wrap;
padding: 6px 0;
box-sizing: border-box;
background-color: #fff;
position: relative;
&--end-date {
border-top-right-radius: 8rpx;
border-bottom-right-radius: 8rpx;
}
&--start-date {
border-top-left-radius: 8rpx;
border-bottom-left-radius: 8rpx;
}
&__item {
width: 14.2857%;
@include vue-flex;
align-items: center;
justify-content: center;
padding: 6px 0;
overflow: hidden;
position: relative;
z-index: 2;
&__inner {
height: 84rpx;
@include vue-flex;
align-items: center;
justify-content: center;
flex-direction: column;
font-size: 32rpx;
position: relative;
border-radius: 50%;
&__desc {
width: 100%;
font-size: 24rpx;
line-height: 24rpx;
transform: scale(0.75);
transform-origin: center center;
position: absolute;
left: 0;
text-align: center;
bottom: 2rpx;
}
}
&__tips {
width: 100%;
font-size: 24rpx;
line-height: 24rpx;
position: absolute;
left: 0;
transform: scale(0.8);
transform-origin: center center;
text-align: center;
bottom: 8rpx;
z-index: 2;
}
}
&__bg-month {
position: absolute;
font-size: 130px;
line-height: 130px;
left: 50%;
top: 50%;
transform: translate(-50%, -50%);
color: #e4e7ed;
z-index: 1;
}
}
&__bottom {
width: 100%;
@include vue-flex;
align-items: center;
justify-content: center;
flex-direction: column;
background-color: #fff;
padding: 0 40rpx 30rpx;
box-sizing: border-box;
font-size: 24rpx;
color: $u-tips-color;
&__choose {
height: 50rpx;
}
&__btn {
width: 100%;
}
}
}
</style>

257
uview-ui/components/u-car-keyboard/u-car-keyboard.vue

@ -0,0 +1,257 @@
<template>
<view class="u-keyboard" @touchmove.stop.prevent="() => {}">
<view class="u-keyboard-grids">
<block>
<view class="u-keyboard-grids-item" v-for="(group, i) in abc ? EngKeyBoardList : areaList" :key="i">
<view :hover-stay-time="100" @tap="carInputClick(i, j)" hover-class="u-carinput-hover" class="u-keyboard-grids-btn"
v-for="(item, j) in group" :key="j">
{{ item }}
</view>
</view>
<view @touchstart="backspaceClick" @touchend="clearTimer" :hover-stay-time="100" class="u-keyboard-back"
hover-class="u-hover-class">
<u-icon :size="38" name="backspace" :bold="true"></u-icon>
</view>
<view :hover-stay-time="100" class="u-keyboard-change" hover-class="u-carinput-hover" @tap="changeCarInputMode">
<text class="zh" :class="[!abc ? 'active' : 'inactive']"></text>
/
<text class="en" :class="[abc ? 'active' : 'inactive']"></text>
</view>
</block>
</view>
</view>
</template>
<script>
export default {
name: "u-keyboard",
props: {
//
random: {
type: Boolean,
default: false
}
},
data() {
return {
// abc=truebac=false
abc: false
};
},
computed: {
areaList() {
let data = [
'京',
'沪',
'粤',
'津',
'冀',
'豫',
'云',
'辽',
'黑',
'湘',
'皖',
'鲁',
'苏',
'浙',
'赣',
'鄂',
'桂',
'甘',
'晋',
'陕',
'蒙',
'吉',
'闽',
'贵',
'渝',
'川',
'青',
'琼',
'宁',
'挂',
'藏',
'港',
'澳',
'新',
'使',
'学'
];
let tmp = [];
//
if (this.random) data = this.$u.randomArray(data);
//
tmp[0] = data.slice(0, 10);
tmp[1] = data.slice(10, 20);
tmp[2] = data.slice(20, 30);
tmp[3] = data.slice(30, 36);
return tmp;
},
EngKeyBoardList() {
let data = [
1,
2,
3,
4,
5,
6,
7,
8,
9,
0,
'Q',
'W',
'E',
'R',
'T',
'Y',
'U',
'I',
'O',
'P',
'A',
'S',
'D',
'F',
'G',
'H',
'J',
'K',
'L',
'Z',
'X',
'C',
'V',
'B',
'N',
'M'
];
let tmp = [];
if (this.random) data = this.$u.randomArray(data);
tmp[0] = data.slice(0, 10);
tmp[1] = data.slice(10, 20);
tmp[2] = data.slice(20, 30);
tmp[3] = data.slice(30, 36);
return tmp;
}
},
methods: {
//
carInputClick(i, j) {
let value = '';
//
if (this.abc) value = this.EngKeyBoardList[i][j];
else value = this.areaList[i][j];
this.$emit('change', value);
},
// |
changeCarInputMode() {
this.abc = !this.abc;
},
// 退
backspaceClick() {
this.$emit('backspace');
clearInterval(this.timer); //
this.timer = null;
this.timer = setInterval(() => {
this.$emit('backspace');
}, 250);
},
clearTimer() {
clearInterval(this.timer);
this.timer = null;
},
}
};
</script>
<style lang="scss" scoped>
@import "../../libs/css/style.components.scss";
.u-keyboard-grids {
background: rgb(215, 215, 217);
padding: 24rpx 0;
position: relative;
}
.u-keyboard-grids-item {
@include vue-flex;
align-items: center;
justify-content: center;
}
.u-keyboard-grids-btn {
text-decoration: none;
width: 62rpx;
flex: 0 0 64rpx;
height: 80rpx;
/* #ifndef APP-NVUE */
display: inline-flex;
/* #endif */
font-size: 36rpx;
text-align: center;
line-height: 80rpx;
background-color: #fff;
margin: 8rpx 5rpx;
border-radius: 8rpx;
box-shadow: 0 2rpx 0rpx #888992;
font-weight: 500;
justify-content: center;
}
.u-carinput-hover {
background-color: rgb(185, 188, 195) !important;
}
.u-keyboard-back {
position: absolute;
width: 96rpx;
right: 22rpx;
bottom: 32rpx;
height: 80rpx;
background-color: rgb(185, 188, 195);
@include vue-flex;
align-items: center;
border-radius: 8rpx;
justify-content: center;
box-shadow: 0 2rpx 0rpx #888992;
}
.u-keyboard-change {
font-size: 24rpx;
box-shadow: 0 2rpx 0rpx #888992;
position: absolute;
width: 96rpx;
left: 22rpx;
line-height: 1;
bottom: 32rpx;
height: 80rpx;
background-color: #ffffff;
@include vue-flex;
align-items: center;
border-radius: 8rpx;
justify-content: center;
}
.u-keyboard-change .inactive.zh {
transform: scale(0.85) translateY(-10rpx);
}
.u-keyboard-change .inactive.en {
transform: scale(0.85) translateY(10rpx);
}
.u-keyboard-change .active {
color: rgb(237, 112, 64);
font-size: 30rpx;
}
.u-keyboard-change .zh {
transform: translateY(-10rpx);
}
.u-keyboard-change .en {
transform: translateY(10rpx);
}
</style>

299
uview-ui/components/u-card/u-card.vue

@ -0,0 +1,299 @@
<template>
<view
class="u-card"
@tap.stop="click"
:class="{ 'u-border': border, 'u-card-full': full, 'u-card--border': borderRadius > 0 }"
:style="{
borderRadius: borderRadius + 'rpx',
margin: margin,
boxShadow: boxShadow
}"
>
<view
v-if="showHead"
class="u-card__head"
:style="[{padding: padding + 'rpx'}, headStyle]"
:class="{
'u-border-bottom': headBorderBottom
}"
@tap="headClick"
>
<view v-if="!$slots.head" class="u-flex u-row-between">
<view class="u-card__head--left u-flex u-line-1" v-if="title">
<image
:src="thumb"
class="u-card__head--left__thumb"
mode="aspectfull"
v-if="thumb"
:style="{
height: thumbWidth + 'rpx',
width: thumbWidth + 'rpx',
borderRadius: thumbCircle ? '100rpx' : '6rpx'
}"
></image>
<text
class="u-card__head--left__title u-line-1"
:style="{
fontSize: titleSize + 'rpx',
color: titleColor
}"
>
{{ title }}
</text>
</view>
<view class="u-card__head--right u-line-1" v-if="subTitle">
<text
class="u-card__head__title__text"
:style="{
fontSize: subTitleSize + 'rpx',
color: subTitleColor
}"
>
{{ subTitle }}
</text>
</view>
</view>
<slot name="head" v-else />
</view>
<view @tap="bodyClick" class="u-card__body" :style="[{padding: padding + 'rpx'}, bodyStyle]"><slot name="body" /></view>
<view
v-if="showFoot"
class="u-card__foot"
@tap="footClick"
:style="[{padding: $slots.foot ? padding + 'rpx' : 0}, footStyle]"
:class="{
'u-border-top': footBorderTop
}"
>
<slot name="foot" />
</view>
</view>
</template>
<script>
/**
* card 卡片
* @description 卡片组件一般用于多个列表条目且风格统一的场景
* @tutorial https://www.uviewui.com/components/card.html
* @property {Boolean} full 卡片与屏幕两侧是否留空隙默认false
* @property {String} title 头部左边的标题
* @property {String} title-color 标题颜色默认#303133
* @property {String | Number} title-size 标题字体大小单位rpx默认30
* @property {String} sub-title 头部右边的副标题
* @property {String} sub-title-color 副标题颜色默认#909399
* @property {String | Number} sub-title-size 副标题字体大小默认26
* @property {Boolean} border 是否显示边框默认true
* @property {String | Number} index 用于标识点击了第几个卡片
* @property {String} box-shadow 卡片外围阴影字符串形式默认none
* @property {String} margin 卡片与屏幕两边和上下元素的间距需带单位"30rpx 20rpx"默认30rpx
* @property {String | Number} border-radius 卡片整体的圆角值单位rpx默认16
* @property {Object} head-style 头部自定义样式对象形式
* @property {Object} body-style 中部自定义样式对象形式
* @property {Object} foot-style 底部自定义样式对象形式
* @property {Boolean} head-border-bottom 是否显示头部的下边框默认true
* @property {Boolean} foot-border-top 是否显示底部的上边框默认true
* @property {Boolean} show-head 是否显示头部默认true
* @property {Boolean} show-head 是否显示尾部默认true
* @property {String} thumb 缩略图路径如设置将显示在标题的左边不建议使用相对路径
* @property {String | Number} thumb-width 缩略图的宽度高等于宽单位rpx默认60
* @property {Boolean} thumb-circle 缩略图是否为圆形默认false
* @event {Function} click 整个卡片任意位置被点击时触发
* @event {Function} head-click 卡片头部被点击时触发
* @event {Function} body-click 卡片主体部分被点击时触发
* @event {Function} foot-click 卡片底部部分被点击时触发
* @example <u-card padding="30" title="card"></u-card>
*/
export default {
name: 'u-card',
props: {
//
full: {
type: Boolean,
default: false
},
//
title: {
type: String,
default: ''
},
//
titleColor: {
type: String,
default: '#303133'
},
// rpx
titleSize: {
type: [Number, String],
default: '30'
},
//
subTitle: {
type: String,
default: ''
},
//
subTitleColor: {
type: String,
default: '#909399'
},
// rpx
subTitleSize: {
type: [Number, String],
default: '26'
},
// full=false()
border: {
type: Boolean,
default: true
},
//
index: {
type: [Number, String, Object],
default: ''
},
// "30rpx 30rpx""20rpx 20rpx 30rpx 30rpx"
margin: {
type: String,
default: '30rpx'
},
// card
borderRadius: {
type: [Number, String],
default: '16'
},
//
headStyle: {
type: Object,
default() {
return {};
}
},
//
bodyStyle: {
type: Object,
default() {
return {};
}
},
//
footStyle: {
type: Object,
default() {
return {};
}
},
//
headBorderBottom: {
type: Boolean,
default: true
},
//
footBorderTop: {
type: Boolean,
default: true
},
//
thumb: {
type: String,
default: ''
},
// rpx
thumbWidth: {
type: [String, Number],
default: '60'
},
//
thumbCircle: {
type: Boolean,
default: false
},
// headbodyfoot
padding: {
type: [String, Number],
default: '30'
},
//
showHead: {
type: Boolean,
default: true
},
//
showFoot: {
type: Boolean,
default: true
},
//
boxShadow: {
type: String,
default: 'none'
}
},
data() {
return {};
},
methods: {
click() {
this.$emit('click', this.index);
},
headClick() {
this.$emit('head-click', this.index);
},
bodyClick() {
this.$emit('body-click', this.index);
},
footClick() {
this.$emit('foot-click', this.index);
}
}
};
</script>
<style lang="scss" scoped>
@import "../../libs/css/style.components.scss";
.u-card {
position: relative;
overflow: hidden;
font-size: 28rpx;
background-color: #ffffff;
box-sizing: border-box;
&-full {
// 0
margin-left: 0 !important;
margin-right: 0 !important;
width: 100%;
}
&--border:after {
border-radius: 16rpx;
}
&__head {
&--left {
color: $u-main-color;
&__thumb {
margin-right: 16rpx;
}
&__title {
max-width: 400rpx;
}
}
&--right {
color: $u-tips-color;
margin-left: 6rpx;
}
}
&__body {
color: $u-content-color;
}
&__foot {
color: $u-tips-color;
}
}
</style>

70
uview-ui/components/u-cell-group/u-cell-group.vue

@ -0,0 +1,70 @@
<template>
<view class="u-cell-box">
<view class="u-cell-title" v-if="title" :style="[titleStyle]">
{{title}}
</view>
<view class="u-cell-item-box" :class="{'u-border-bottom u-border-top': border}">
<slot />
</view>
</view>
</template>
<script>
/**
* cellGroup 单元格父组件Group
* @description cell单元格一般用于一组列表的情况比如个人中心页设置页等搭配u-cell-item
* @tutorial https://www.uviewui.com/components/cell.html
* @property {String} title 分组标题
* @property {Boolean} border 是否显示外边框默认true
* @property {Object} title-style 分组标题的的样式对象形式{'font-size': '24rpx'} {'fontSize': '24rpx'}
* @example <u-cell-group title="设置喜好">
*/
export default {
name: "u-cell-group",
props: {
//
title: {
type: String,
default: ''
},
// list
border: {
type: Boolean,
default: true
},
//
// {'font-size': '24rpx'} {'fontSize': '24rpx'}
titleStyle: {
type: Object,
default () {
return {};
}
}
},
data() {
return {
index: 0,
}
},
}
</script>
<style lang="scss" scoped>
@import "../../libs/css/style.components.scss";
.u-cell-box {
width: 100%;
}
.u-cell-title {
padding: 30rpx 32rpx 10rpx 32rpx;
font-size: 30rpx;
text-align: left;
color: $u-tips-color;
}
.u-cell-item-box {
background-color: #FFFFFF;
flex-direction: row;
}
</style>

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save