diff --git a/.hbuilderx/launch.json b/.hbuilderx/launch.json
index 9cba30d..075b9c5 100644
--- a/.hbuilderx/launch.json
+++ b/.hbuilderx/launch.json
@@ -6,6 +6,10 @@
{
"launchtype" : "remote"
},
+ "h5" :
+ {
+ "launchtype" : "remote"
+ },
"mp-weixin" :
{
"launchtype" : "remote"
diff --git a/common/config.js b/common/config.js
index f28b798..d1f69dd 100644
--- a/common/config.js
+++ b/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
diff --git a/components/chose-city/chose-city.vue b/components/chose-city/chose-city.vue
index ff5c0e7..f5b57f3 100644
--- a/components/chose-city/chose-city.vue
+++ b/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) {
diff --git a/components/mask/task-home-list1.vue b/components/mask/task-home-list1.vue
index 5c23943..9853256 100644
--- a/components/mask/task-home-list1.vue
+++ b/components/mask/task-home-list1.vue
@@ -8,18 +8,21 @@
-
-
{{item.goodsTitle}}
+
+
-
+
+ 剩余{{item.endNum}}份
距离:{{item.distance}}
@@ -30,21 +33,21 @@
非会员满{{item.price}}返{{item.money}}
-
-
+
+
+
+
+
-
-
+ -->
+
+
+
+
@@ -125,7 +128,7 @@
// padding: 0 30upx;
// width: 100%;
width: 690rpx;
- height: 311rpx;
+ height: 230rpx;
margin: 0 30rpx;
position: relative;
background: #FFFFFF;
diff --git a/components/uni-badge/uni-badge.vue b/components/uni-badge/uni-badge.vue
deleted file mode 100644
index 9ee0c7c..0000000
--- a/components/uni-badge/uni-badge.vue
+++ /dev/null
@@ -1,151 +0,0 @@
-
- {{ text }}
-
-
-
-
-
diff --git a/components/uni-countdown/uni-countdown.vue b/components/uni-countdown/uni-countdown.vue
index 2c689e7..3d40207 100644
--- a/components/uni-countdown/uni-countdown.vue
+++ b/components/uni-countdown/uni-countdown.vue
@@ -1,6 +1,6 @@
- 仅剩
+
{{ d }}
{{ showColon ? ':' : '天' }}
{{ h }}
@@ -9,7 +9,7 @@
{{ showColon ? ':' : '分' }}
{{ s }}
秒
- 结束
+
-
-
diff --git a/components/uni-icons/icons.js b/components/uni-icons/icons.js
deleted file mode 100644
index 60b7332..0000000
--- a/components/uni-icons/icons.js
+++ /dev/null
@@ -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"
-}
diff --git a/components/uni-icons/uni-icons.vue b/components/uni-icons/uni-icons.vue
deleted file mode 100644
index 5f303e4..0000000
--- a/components/uni-icons/uni-icons.vue
+++ /dev/null
@@ -1,67 +0,0 @@
-
- {{icons[type]}}
-
-
-
-
-
diff --git a/components/uni-list/changelog.md b/components/uni-list/changelog.md
new file mode 100644
index 0000000..dd6f01d
--- /dev/null
+++ b/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 角标显示不正常的问题
diff --git a/components/uni-list/components/uni-list-ad/uni-list-ad.vue b/components/uni-list/components/uni-list-ad/uni-list-ad.vue
new file mode 100644
index 0000000..e256e4c
--- /dev/null
+++ b/components/uni-list/components/uni-list-ad/uni-list-ad.vue
@@ -0,0 +1,107 @@
+
+
+
+
+
+
+
+
+
+ |
+
+
+
+
+
+
+
diff --git a/components/uni-list/components/uni-list-chat/uni-list-chat.scss b/components/uni-list/components/uni-list-chat/uni-list-chat.scss
new file mode 100644
index 0000000..311f8d9
--- /dev/null
+++ b/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;
diff --git a/components/uni-list/components/uni-list-chat/uni-list-chat.vue b/components/uni-list/components/uni-list-chat/uni-list-chat.vue
new file mode 100644
index 0000000..70345af
--- /dev/null
+++ b/components/uni-list/components/uni-list-chat/uni-list-chat.vue
@@ -0,0 +1,534 @@
+
+
+
+
+
+
+
+
+
+ {{ badgeText === 'dot' ? '' : badgeText }}
+
+
+
+ {{ title }}
+ {{ note }}
+
+
+
+
+
+
+ |
+
+
+
+
+
+
diff --git a/components/uni-list/components/uni-list-item/uni-list-item.vue b/components/uni-list/components/uni-list-item/uni-list-item.vue
new file mode 100644
index 0000000..167222b
--- /dev/null
+++ b/components/uni-list/components/uni-list-item/uni-list-item.vue
@@ -0,0 +1,461 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ title }}
+ {{ note }}
+
+
+
+
+
+
+
+
+
+ |
+
+
+
+
+
+
diff --git a/components/uni-list/components/uni-list/uni-list.vue b/components/uni-list/components/uni-list/uni-list.vue
new file mode 100644
index 0000000..1c85003
--- /dev/null
+++ b/components/uni-list/components/uni-list/uni-list.vue
@@ -0,0 +1,106 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/components/uni-list/components/uni-list/uni-refresh.vue b/components/uni-list/components/uni-list/uni-refresh.vue
new file mode 100644
index 0000000..3b4c5a2
--- /dev/null
+++ b/components/uni-list/components/uni-list/uni-refresh.vue
@@ -0,0 +1,65 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/components/uni-list/components/uni-list/uni-refresh.wxs b/components/uni-list/components/uni-list/uni-refresh.wxs
new file mode 100644
index 0000000..818a6b7
--- /dev/null
+++ b/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
+}
diff --git a/components/uni-list/package.json b/components/uni-list/package.json
new file mode 100644
index 0000000..f7f7ef9
--- /dev/null
+++ b/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"
+ }
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/components/uni-list/readme.md b/components/uni-list/readme.md
new file mode 100644
index 0000000..e4a5d73
--- /dev/null
+++ b/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
+
+
+
+
+
+```
+
+### 多行内容显示
+
+- 设置 `note` 属性 ,可以在第二行显示描述文本信息
+
+```html
+
+
+
+
+
+```
+
+### 右侧显示角标、switch
+
+- 设置 `show-badge` 属性 ,可以显示角标内容
+- 设置 `show-switch` 属性,可以显示 switch 开关
+
+```html
+
+
+
+
+
+```
+
+### 左侧显示略缩图、图标
+
+- 设置 `thumb` 属性 ,可以在列表左侧显示略缩图
+- 设置 `show-extra-icon` 属性,并指定 `extra-icon` 可以在左侧显示图标
+
+```html
+
+
+
+
+```
+
+### 开启点击反馈和右侧箭头
+- 设置 `clickable` 为 `true` ,则表示这是一个可点击的列表,会默认给一个点击效果,并可以监听 `click` 事件
+- 设置 `link` 属性,会自动开启点击反馈,并给列表右侧添加一个箭头
+- 设置 `to` 属性,可以跳转页面,`link` 的值表示跳转方式,如果不指定,默认为 `navigateTo`
+
+```html
+
+
+
+
+
+
+
+```
+
+
+### 聊天列表示例
+- 设置 `clickable` 为 `true` ,则表示这是一个可点击的列表,会默认给一个点击效果,并可以监听 `click` 事件
+- 设置 `link` 属性,会自动开启点击反馈,`link` 的值表示跳转方式,如果不指定,默认为 `navigateTo`
+- 设置 `to` 属性,可以跳转页面
+- `time` 属性,通常会设置成时间显示,但是这个属性不仅仅可以设置时间,你可以传入任何文本,注意文本长度可能会影响显示
+- `avatar` 和 `avatarList` 属性同时只会有一个生效,同时设置的话,`avatarList` 属性的长度大于1 ,`avatar` 属性将失效
+- 可以通过默认插槽自定义列表右侧内容
+
+```html
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 刚刚
+
+
+
+
+
+
+
+```
+
+```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
+
+
+
+
+
+
+
+
+
+
+ 自定义插槽
+
+
+
+
+
+
+```
+
+
+
+
+
+### 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)
\ No newline at end of file
diff --git a/components/uni-load-more/uni-load-more.vue b/components/uni-load-more/uni-load-more.vue
deleted file mode 100644
index 6c43365..0000000
--- a/components/uni-load-more/uni-load-more.vue
+++ /dev/null
@@ -1,194 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- {{status === 'more' ? contentText.contentdown : (status === 'loading' ? contentText.contentrefresh : contentText.contentnomore)}}
-
-
-
-
-
-
\ No newline at end of file
diff --git a/main.js b/main.js
index d6a61f5..b1b34c3 100644
--- a/main.js
+++ b/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'
diff --git a/manifest.json b/manifest.json
index e7a0a72..ee3c7bd 100644
--- a/manifest.json
+++ b/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" : {
diff --git a/pages.json b/pages.json
index d12afeb..df66088 100644
--- a/pages.json
+++ b/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"
}
}
diff --git a/pages/index/index.vue b/pages/index/index.vue
index a6dd92d..e2c5227 100644
--- a/pages/index/index.vue
+++ b/pages/index/index.vue
@@ -1,59 +1,98 @@
-
-
@@ -81,6 +120,50 @@
},
data() {
return {
+ endNum: 0,
+ shopname:'',
+ keyword: '',
+ value1: 1,
+ value2: 2,
+ cityname:'武汉',
+ listbanner: [{
+ image: 'https://cdn.uviewui.com/uview/swiper/1.jpg',
+ title: '昨夜星辰昨夜风,画楼西畔桂堂东'
+ },
+ {
+ image: 'https://cdn.uviewui.com/uview/swiper/2.jpg',
+ title: '身无彩凤双飞翼,心有灵犀一点通'
+ },
+ {
+ image: 'https://cdn.uviewui.com/uview/swiper/3.jpg',
+ title: '谁念西风独自凉,萧萧黄叶闭疏窗,沉思往事立残阳'
+ }
+ ],
+ list: [{
+ name: '综合'
+ }, {
+ name: '距离'
+ }, {
+ name: '佣金',
+ }],
+ current: 0,
+ value1: 0,
+ options1: [{
+ label: '双平台',
+ value: 0,
+ },
+ {
+ label: '美团',
+ value: 1,
+ },
+ {
+ label: '饿了么',
+ value: 2,
+ }
+ ],
+ shoplist:[
+
+ ],
localCampus: '未知',
city: '',
meituanList: {},
@@ -136,44 +219,42 @@
if (e.userByinvitationId) {
this.$queue.setData('userByinvitationId', e.userByinvitationId);
}
-
+
// #ifdef MP-WEIXIN
if (e.scene) {
const scene = decodeURIComponent(e.scene);
this.$queue.setData('userByinvitationId', scene.split(',')[0]);
}
// #endif
-
- // #ifdef MP-WEIXIN
+
// 实例化API核心类
qqmapsdk = new QQMapWX({
key: 'J5FBZ-XCUKI-UFEG2-5KOJJ-XD4L3-KNFNG'
});
that.authorizationLocation();
- // #endif
- this.getBannerList();
- this.getnavlistClassify();
- this.getClassify();
-
+ // this.getBannerList();
+ // this.getnavlistClassify();
+ // this.getClassify();
+
//美团饿了么优惠券开关
- this.$Request.getT('/common/type/138').then(res => {
- if (res.code == 0) {
- if (res.data && res.data.value) {
- this.mtelmCheck = res.data.value;
- }
- }
- });
-
- this.$Request.getT('/banner/selectBannerList?classify=4&state=1').then(res => {
- if (res.code === 0) {
- this.meituanList = res.data[0];
- }
- });
- this.$Request.getT('/banner/selectBannerList?classify=4&state=2').then(res => {
- if (res.code === 0) {
- this.elemeList = res.data[0];
- }
- });
+ // this.$Request.getT('/common/type/138').then(res => {
+ // if (res.code == 0) {
+ // if (res.data && res.data.value) {
+ // this.mtelmCheck = res.data.value;
+ // }
+ // }
+ // });
+
+ // this.$Request.getT('/banner/selectBannerList?classify=4&state=1').then(res => {
+ // if (res.code === 0) {
+ // this.meituanList = res.data[0];
+ // }
+ // });
+ // this.$Request.getT('/banner/selectBannerList?classify=4&state=2').then(res => {
+ // if (res.code === 0) {
+ // this.elemeList = res.data[0];
+ // }
+ // });
// 订单审核提醒 202
@@ -187,27 +268,27 @@
// 积分变动提醒 206
// 提现审核提醒 203
- that.$Request.getT('/common/type/209').then(res => { //活动反馈推送提醒
- if (res.code == 0) {
- if (res.data && res.data.value) {
- that.arr.push(res.data.value)
- }
- }
- })
- that.$Request.getT('/common/type/208').then(res => { //收益到账通知
- if (res.code == 0) {
- if (res.data && res.data.value) {
- that.arr.push(res.data.value)
- }
- }
- })
- that.$Request.getT('/common/type/206').then(res => { //积分变动提醒
- if (res.code == 0) {
- if (res.data && res.data.value) {
- that.arr.push(res.data.value)
- }
- }
- })
+ // that.$Request.getT('/common/type/209').then(res => { //活动反馈推送提醒
+ // if (res.code == 0) {
+ // if (res.data && res.data.value) {
+ // that.arr.push(res.data.value)
+ // }
+ // }
+ // })
+ // that.$Request.getT('/common/type/208').then(res => { //收益到账通知
+ // if (res.code == 0) {
+ // if (res.data && res.data.value) {
+ // that.arr.push(res.data.value)
+ // }
+ // }
+ // })
+ // that.$Request.getT('/common/type/206').then(res => { //积分变动提醒
+ // if (res.code == 0) {
+ // if (res.data && res.data.value) {
+ // that.arr.push(res.data.value)
+ // }
+ // }
+ // })
},
onShow() {
let that = this;
@@ -229,64 +310,364 @@
if (userId) {
//订阅
if (!uni.getStorageSync('sendindexMsg')) {
- this.openMsg()
+ // this.openMsg()
}
}
},
methods: {
- // 开启订阅消息
+ change(index) {
+ this.current = index;
+ },
+ //跳转到选择城市界面
+ goSelectCity() {
+ uni.navigateTo({
+ url: '/pages/index/citys'
+ })
+ },
+ //跳转到任务详情
+ totasks() {
+ uni.navigateTo({
+ url: '/pages/index/tasksdetails',
+ })
+ },
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('sendindexMsg', true)
- uni.openSetting({ // 打开设置页
- success(rea) {
- console.log(rea.authSetting)
- }
- });
- } else { // 用户没有点击“总是保持以上,不再询问”则每次都会调起订阅消息
- uni.setStorageSync('sendindexMsg', 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)
+ 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('sendindexMsg', true)
+ uni.openSetting({ // 打开设置页
+ success(rea) {
+ console.log(rea.authSetting)
+ }
+ });
+ } else { // 用户没有点击“总是保持以上,不再询问”则每次都会调起订阅消息
+ uni.setStorageSync('sendindexMsg', 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)
}
- },
- fail: (res) => {
- console.log(res)
- }
- })
- that.showModal = false
- } else if (res.cancel) {
- that.showModal = true
+ })
+ that.showModal = false
+ } else if (res.cancel) {
+ that.showModal = true
+ }
+ }
+ })
+ }
+ }
+ })
+ },
+ // 点击优惠券跳转小程序
+ gochegnxu(classify) {
+ let token = this.$queue.getData('token');
+ let userId = this.$queue.getData('userId');
+ if (token) {
+ if (uni.getStorageSync('sendindexMsg')) {
+ 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)
}
})
}
+ if (classify == 1) { //美团
+ // #ifdef MP-WEIXIN
+ uni.navigateToMiniProgram({
+ appId: 'wxde8ac0a21135c07d',
+ path: this.meituanList.url,
+ fail(res) {
+ console.error(res)
+ }
+ })
+ // #endif
+ } else if (classify == 2) { //饿了么
+ // #ifdef MP-WEIXIN
+ uni.navigateToMiniProgram({
+ appId: 'wxece3a9a4c82f58c9',
+ path: this.elemeList.url,
+ fail(res) {
+ console.error(res)
+ }
+ })
+ // #endif
+ }
+ } else {
+ this.goLogin();
}
- })
- },
- // 点击优惠券跳转小程序
- gochegnxu(classify) {
- let token = this.$queue.getData('token');
- let userId = this.$queue.getData('userId');
- if (token) {
+ },
+ tuijianClickItem(index) {
+ let token = this.$queue.getData('token');
+ let userId = this.$queue.getData('userId');
+ if (token) {
+ if (uni.getStorageSync('sendindexMsg')) {
+ 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/index/tuijianList'
+ });
+ } else {
+ this.goLogin();
+ }
+ },
+ ed(res) {
+ console.log(res)
+ },
+ dateChange(d) {
+ console.log(d)
+ },
+ getHaoDianTuiJian() {
+ this.loadingType = 1;
+ uni.showLoading({
+ title: '加载中...',
+ });
+ let data = {
+ page: 1,
+ limit: 4,
+ longitude: this.longitude,
+ latitude: this.latitude,
+ city: this.city,
+ search: '',
+ isGoods: '1'
+ }
+ this.$Request.getT('/wm/selectHomeGoodsList', data).then(res => {
+ if (res.code === 0) {
+ this.tuijianList = [];
+
+ res.data.list.forEach(d => {
+ d.distance = this.setMorKm(d.distance);
+ this.tuijianList.push(d)
+ });
+ }
+ uni.hideLoading();
+ })
+ },
+ getHaoDianTuiJian1() {
+ this.loadingType = 1;
+ uni.showLoading({
+ title: '加载中...',
+ });
+ let data = {
+ page: this.page,
+ limit: this.limit,
+ longitude: this.longitude,
+ latitude: this.latitude,
+ city: this.city,
+ search: '',
+ sort: this.sortType,
+ typeId: this.typeId
+
+ }
+ this.$Request.getT('/wm/selectHomeGoodsList', data).then(res => {
+ if (res.code === 0) {
+ if (this.page === 1) {
+ this.goodsHomeList = [];
+ }
+
+ res.data.list.forEach(d => {
+ d.distance = this.setMorKm(d.distance);
+ this.goodsHomeList.push(d)
+ });
+ if (res.data.list.length === this.limit) {
+ this.loadingType = 0;
+ } else {
+ this.loadingType = 3;
+ }
+ } else {
+ this.loadingType = 2;
+ }
+ uni.hideLoading();
+ })
+ },
+ 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
+ },
+ getClassify() {
+ this.$Request.getT('/helpClassify/selectClassifyList').then(res => {
+ if (res.code === 0) {
+ this.navlist = res.data;
+ }
+ });
+ },
+ getnavlistClassify() {
+ this.$Request.getT('/banner/selectBannerList?state=-1&classify=2').then(res => {
+ if (res.code === 0) {
+ let dataList = [];
+ let data = {
+ text: '全部品类',
+ value: 0
+ }
+ dataList.push(data);
+
+ res.data.forEach(d => {
+ let data = {
+ text: '',
+ value: ''
+ }
+ data.text = d.name;
+ data.value = d.id;
+ if (d.state == 1) {
+ dataList.push(data);
+ }
+
+ });
+ this.filterData.push(dataList);
+ }
+ });
+ },
+ initLocation(latitude, longitude) {
+ var that = this;
+ console.log('1234')
+ qqmapsdk.reverseGeocoder({
+ location: latitude + ',' + longitude || '',
+ success: function(res) { //成功后的回调
+ if (res.status == 0) {
+ console.log(res)
+ that.authorize = false;
+ var res = res.result;
+ that.latitude = latitude;
+ that.longitude = longitude;
+ that.$queue.setData('latitude', latitude)
+ that.$queue.setData('longitude', longitude)
+ let s = res.ad_info.city.substring(0, res.ad_info.city.length - 1);
+ that.city = s;
+ that.$queue.setData('city', that.city);
+ that.localCampus = res.address_reference.landmark_l2.title;
+ that.getHaoDianTuiJian1();
+ that.getHaoDianTuiJian();
+ }
+ },
+ fail: function(error) {
+ console.error(error);
+ },
+ complete: function(res) {
+ console.log(res);
+ }
+ })
+ },
+ startSetting() {
+ let that = this;
+ // #ifdef APP-PLUS
+ permision.gotoAppSetting();
+ // #endif
+ // #ifdef MP-WEIXIN
+ uni.openSetting({
+ success(res3) {
+ console.log(res3)
+ if (res3.authSetting[
+ 'scope.userLocation'
+ ]) {
+ uni.hideToast();
+ that.initMyPosition();
+ } else {
+ that.authorizationLocation();
+ }
+ // 已授权-(获取位置信息)
+ }
+ });
+ // #endif
+ },
+ initMyPosition() {
+ let that = this;
+ console.log('1111')
+ uni.getLocation({
+ type: 'gcj02',
+ altitude: true,
+ success: res => {
+ console.log(res)
+ that.initLocation(res.latitude, res.longitude);
+ }
+ });
+ },
+ authorizationLocation: function() {
+ let that = this;
+ // #ifdef MP-WEIXIN
+ uni.getSetting({
+ success(res1) {
+ if (!res1.authSetting['scope.userLocation']) {
+ // 未授权
+ uni.authorize({
+ scope: 'scope.userLocation',
+ success() { //1.1 允许授权
+ that.initMyPosition();
+ },
+ fail() { //1.2 拒绝授权
+ that.authorize = true; //用户是否拒绝了定位授权 true:用户拒绝 false:用户授权
+ }
+ })
+ } else {
+ // 已授权-(获取位置信息)
+ that.initMyPosition();
+ }
+ }
+ });
+ // #endif
+ // #ifdef H5
+ that.initMyPosition();
+ // #endif
+ },
+ getBannerList() {
+ this.$Request.getT('/banner/selectBannerList?state=-1&classify=1').then(res => {
+ if (res.code === 0) {
+ this.banners = [];
+ res.data.forEach(d => {
+ if (d.state == 1) {
+ this.banners.push(d);
+ }
+ });
+ }
+ });
+ },
+ // 轮播图跳转小程序
+ toGoodsInfo: function(url) {
if (uni.getStorageSync('sendindexMsg')) {
uni.requestSubscribeMessage({
tmplIds: this.arr,
@@ -302,35 +683,26 @@
}
})
}
- if (classify == 1) { //美团
- // #ifdef MP-WEIXIN
- uni.navigateToMiniProgram({
- appId: 'wxde8ac0a21135c07d',
- path: this.meituanList.url,
- fail(res) {
- console.error(res)
- }
- })
- // #endif
- } else if (classify == 2) { //饿了么
- // #ifdef MP-WEIXIN
- uni.navigateToMiniProgram({
- appId: 'wxece3a9a4c82f58c9',
- path: this.elemeList.url,
- fail(res) {
- console.error(res)
- }
- })
- // #endif
+ let token = this.$queue.getData('token');
+ let userId = this.$queue.getData('userId');
+ if (url.indexOf('/pages/') !== -1) {
+ uni.navigateTo({
+ url
+ });
+ } else {
+ //#ifndef H5
+ uni.navigateTo({
+ url: '/pages/public/webview?url=' + url
+ });
+ //#endif
+ //#ifdef H5
+ window.location.href = url;
+ //#endif
}
- } else {
- this.goLogin();
- }
- },
- tuijianClickItem(index) {
- let token = this.$queue.getData('token');
- let userId = this.$queue.getData('userId');
- if (token) {
+ },
+ goSearch() {
+ console.log('12123')
+
if (uni.getStorageSync('sendindexMsg')) {
uni.requestSubscribeMessage({
tmplIds: this.arr,
@@ -347,336 +719,10 @@
})
}
uni.navigateTo({
- url: '/pages/index/tuijianList'
- });
- } else {
- this.goLogin();
- }
- },
- ed(res) {
- console.log(res)
- },
- dateChange(d) {
- console.log(d)
- },
- getHaoDianTuiJian() {
- this.loadingType = 1;
- uni.showLoading({
- title: '加载中...',
- });
- let data = {
- page: 1,
- limit: 4,
- longitude: this.longitude,
- latitude: this.latitude,
- city: this.city,
- search: '',
- isGoods: '1'
- }
- this.$Request.getT('/wm/selectHomeGoodsList', data).then(res => {
- if (res.code === 0) {
- this.tuijianList = [];
-
- res.data.list.forEach(d => {
- d.distance = this.setMorKm(d.distance);
- this.tuijianList.push(d)
- });
- }
- uni.hideLoading();
- })
- },
- getHaoDianTuiJian1() {
- this.loadingType = 1;
- uni.showLoading({
- title: '加载中...',
- });
- let data = {
- page: this.page,
- limit: this.limit,
- longitude: this.longitude,
- latitude: this.latitude,
- city: this.city,
- search: '',
- sort: this.sortType,
- typeId: this.typeId
-
- }
- this.$Request.getT('/wm/selectHomeGoodsList', data).then(res => {
- if (res.code === 0) {
- if (this.page === 1) {
- this.goodsHomeList = [];
- }
-
- res.data.list.forEach(d => {
- d.distance = this.setMorKm(d.distance);
- this.goodsHomeList.push(d)
- });
- if (res.data.list.length === this.limit) {
- this.loadingType = 0;
- } else {
- this.loadingType = 3;
- }
- } else {
- this.loadingType = 2;
- }
- uni.hideLoading();
- })
- },
- 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
- },
- getClassify() {
- this.$Request.getT('/helpClassify/selectClassifyList').then(res => {
- if (res.code === 0) {
- this.navlist = res.data;
- }
- });
- },
- getnavlistClassify() {
- this.$Request.getT('/banner/selectBannerList?state=-1&classify=2').then(res => {
- if (res.code === 0) {
- let dataList = [];
- let data = {
- text: '全部品类',
- value: 0
- }
- dataList.push(data);
-
- res.data.forEach(d => {
- let data = {
- text: '',
- value: ''
- }
- data.text = d.name;
- data.value = d.id;
- if (d.state == 1) {
- dataList.push(data);
- }
-
- });
- this.filterData.push(dataList);
- }
- });
- },
- initLocation(latitude, longitude) {
- var that = this;
- qqmapsdk.reverseGeocoder({
- location: latitude + ',' + longitude || '',
- success: function(res) { //成功后的回调
- if (res.status == 0) {
- console.log(res)
- that.authorize = false;
- var res = res.result;
- that.latitude = latitude;
- that.longitude = longitude;
- that.$queue.setData('latitude', latitude)
- that.$queue.setData('longitude', longitude)
- let s = res.ad_info.city.substring(0, res.ad_info.city.length - 1);
- that.city = s;
- that.$queue.setData('city', that.city);
- that.localCampus = res.address_reference.landmark_l2.title;
- that.getHaoDianTuiJian1();
- that.getHaoDianTuiJian();
- }
- },
- fail: function(error) {
- console.error(error);
- },
- complete: function(res) {
- console.log(res);
- }
- })
- },
- startSetting() {
- let that = this;
- // #ifdef APP-PLUS
- permision.gotoAppSetting();
- // #endif
- // #ifdef MP-WEIXIN
- uni.openSetting({
- success(res3) {
- console.log(res3)
- if (res3.authSetting[
- 'scope.userLocation'
- ]) {
- uni.hideToast();
- that.initMyPosition();
- } else {
- that.authorizationLocation();
- }
- // 已授权-(获取位置信息)
- }
- });
- // #endif
- },
- initMyPosition() {
- let that = this;
- uni.getLocation({
- type: 'gcj02',
- altitude: true,
- success: res => {
- that.initLocation(res.latitude, res.longitude);
- }
- });
- },
- authorizationLocation: function() {
- let that = this;
- uni.getSetting({
- success(res1) {
- if (!res1.authSetting['scope.userLocation']) {
- // 未授权
- uni.authorize({
- scope: 'scope.userLocation',
- success() { //1.1 允许授权
- that.initMyPosition();
- },
- fail() { //1.2 拒绝授权
- that.authorize = true; //用户是否拒绝了定位授权 true:用户拒绝 false:用户授权
- }
- })
- } else {
- // 已授权-(获取位置信息)
- that.initMyPosition();
- }
- }
- });
- },
- getBannerList() {
- this.$Request.getT('/banner/selectBannerList?state=-1&classify=1').then(res => {
- if (res.code === 0) {
- this.banners = [];
- res.data.forEach(d => {
- if (d.state == 1) {
- this.banners.push(d);
- }
- });
- }
- });
- },
- // 轮播图跳转小程序
- toGoodsInfo: function(url) {
- if (uni.getStorageSync('sendindexMsg')) {
- 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 token = this.$queue.getData('token');
- let userId = this.$queue.getData('userId');
- if (url.indexOf('/pages/') !== -1) {
- uni.navigateTo({
- url
- });
- } else {
- //#ifndef H5
- uni.navigateTo({
- url: '/pages/public/webview?url=' + url
- });
- //#endif
- //#ifdef H5
- window.location.href = url;
- //#endif
- }
- },
- goSearch() {
- if (uni.getStorageSync('sendindexMsg')) {
- 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/task/search'
- });
- },
- goSelectCity() {
- if (uni.getStorageSync('sendindexMsg')) {
- 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)
- }
- })
- }
- if (!this.authorize) {
- uni.navigateTo({
- url: '/pages/index/selectCampus?city=' + this.city
+ url: '/pages/task/search'
});
- } else {
- this.startSetting();
- }
- },
- goLogin() {
- this.$queue.setData('href', '/pages/index/index');
- uni.navigateTo({
- url: '/pages/public/login'
- });
- },
- navClick: function(res) {
- if (uni.getStorageSync('sendindexMsg')) {
- 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('点击', res)
- this.page = 1;
- if (res.index1 == 0) {
- this.sortType = res.index ? res.index : 0;
- this.getHaoDianTuiJian1();
- } else if (res.index1 == 1) {
- this.typeId = res.index ? res.index : 0;
- this.getHaoDianTuiJian1();
- }
- },
- clickItem: function(options) {
- let token = this.$queue.getData('token');
- let userId = this.$queue.getData('userId');
- if (token) {
+ },
+ goSelectCity() {
if (uni.getStorageSync('sendindexMsg')) {
uni.requestSubscribeMessage({
tmplIds: this.arr,
@@ -692,18 +738,21 @@
}
})
}
+ if (!this.authorize) {
+ uni.navigateTo({
+ url: '/pages/index/selectCampus?city=' + this.city
+ });
+ } else {
+ this.startSetting();
+ }
+ },
+ goLogin() {
+ this.$queue.setData('href', '/pages/index/index');
uni.navigateTo({
- url: '/pages/index/taskDetail?goodsId=' + options.item.goodsId + '&latitude=' + this
- .latitude + '&longitude=' + this.longitude
- })
- } else {
- this.goLogin();
- }
- },
- toNavList: function(item) {
- let token = this.$queue.getData('token');
- let userId = this.$queue.getData('userId');
- if (token) {
+ url: '/pages/public/login'
+ });
+ },
+ navClick: function(res) {
if (uni.getStorageSync('sendindexMsg')) {
uni.requestSubscribeMessage({
tmplIds: this.arr,
@@ -719,399 +768,338 @@
}
})
}
- uni.navigateTo({
- url: '/pages/task/tasklist?searchValue=&classifyId=' + item.id + '&name=' + item
- .classifyName
+ console.log('点击', res)
+ this.page = 1;
+ if (res.index1 == 0) {
+ this.sortType = res.index ? res.index : 0;
+ this.getHaoDianTuiJian1();
+ } else if (res.index1 == 1) {
+ this.typeId = res.index ? res.index : 0;
+ this.getHaoDianTuiJian1();
+ }
+ },
+ clickItem: function(options) {
+ let token = this.$queue.getData('token');
+ let userId = this.$queue.getData('userId');
+ if (token) {
+ if (uni.getStorageSync('sendindexMsg')) {
+ 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/index/tasksdetails?goodsId=' + options.item.goodsId + '&latitude=' + this
+ .latitude + '&longitude=' + this.longitude
+ })
+ } else {
+ this.goLogin();
+ }
+ },
+ toNavList: function(item) {
+ let token = this.$queue.getData('token');
+ let userId = this.$queue.getData('userId');
+ if (token) {
+ if (uni.getStorageSync('sendindexMsg')) {
+ 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/task/tasklist?searchValue=&classifyId=' + item.id + '&name=' + item
+ .classifyName
+ });
+ } else {
+ this.goLogin();
+ }
+ },
+ // 传进数组和指定个数,进行拆分
+ chunk: function(array, size) {
+ const length = array.length
+ if (!length || !size || size < 1) {
+ return []
+ }
+ let index = 0
+ let resIndex = 0
+ let result = new Array(Math.ceil(length / size))
+ while (index < length) {
+ result[resIndex++] = array.slice(index, (index += size))
+ }
+ return result
+ },
+ topScrollTap: function() {
+ uni.pageScrollTo({
+ scrollTop: 0,
+ duration: 300
});
- } else {
- this.goLogin();
}
},
- // 传进数组和指定个数,进行拆分
- chunk: function(array, size) {
- const length = array.length
- if (!length || !size || size < 1) {
- return []
- }
- let index = 0
- let resIndex = 0
- let result = new Array(Math.ceil(length / size))
- while (index < length) {
- result[resIndex++] = array.slice(index, (index += size))
- }
- return result
+ onPageScroll: function(e) {
+ this.scrollTop = e.scrollTop > 200;
},
- topScrollTap: function() {
- uni.pageScrollTo({
- scrollTop: 0,
- duration: 300
- });
+ onReachBottom: function() {
+ this.page = this.page + 1;
+ this.getHaoDianTuiJian1();
}
- },
- onPageScroll: function(e) {
- this.scrollTop = e.scrollTop > 200;
- },
- onReachBottom: function() {
- this.page = this.page + 1;
- this.getHaoDianTuiJian1();
- }
}
+
+ // this.$Request.getT('/banner/selectBannerList?classify=4&state=2').then(res => {
+ // if (res.code === 0) {
+ // this.elemeList = res.data[0];
+ // }
+ // });
diff --git a/pages/index/taskDetail.vue b/pages/index/taskDetail.vue
index 1b71ec7..91756c4 100644
--- a/pages/index/taskDetail.vue
+++ b/pages/index/taskDetail.vue
@@ -7,6 +7,9 @@
+
+
+
@@ -14,133 +17,90 @@
-
-
-
-
-
- {{info.goodsTitle}}
-
-
-
-
- {{info.endTime}}
+
+
+
+ 番茄会员满18元返18元
+
+
+
+
+
+
+
+ 限时
-
-
- 还剩{{info.endNum}}份
+
+ 抢购
+
+
+
+
+ 剩余20{{info.endNum}}份
+
+
+
+
+
+
+
-
+
- 会员满{{info.memberPrice}}返{{info.memberMoney}}
+ 美团会员满20{{info.memberPrice}}返12{{info.memberMoney}}
- 非会员满{{info.price}}返{{info.money}}
-
-
+ 非美团会员满20{{info.price}}返{{info.money}}
-
-
-
-
- {{info.numStar}}星好评
- {{info.numImg}}张配图
- {{info.numWord}}字评论
-
-
-
- {{info.numStar}}星好评
- {{info.numImg}}张配图
- {{info.numWord}}字评论
-
-
-
- {{info.numStar}}星好评
- {{info.numImg}}张配图
- {{info.numWord}}字评论
-
-
-
-
-
-
+
-
- 分享赚钱
-
-
- 分享赚钱
-
-
-
+
+
+
+ 进入番茄饭团福利群
- 粉丝福利号
-
- 已有999人加入
+ style="margin-top: 15rpx;font-size: 11px;font-family: PingFang SC;font-weight: 500;color: #000000;">
+ 添加客服微信进入番茄饭团福利群
+
+ 添加
-
-
- 立即添加
-
-
-
+
+ 订单返现流程规则
+
-
- 优惠流程
-
+
- 立即抢单
+ 抢购订单
-
+
@@ -148,22 +108,22 @@
外卖平台下单
-
+
- 订单上传
+ 好评上传
-
+
- 评鉴上传
+ 返现到账
@@ -179,7 +139,7 @@
-
-
-
+
\ No newline at end of file
diff --git a/pages/member/feedback.vue b/pages/member/feedback.vue
index a2e0760..537a041 100644
--- a/pages/member/feedback.vue
+++ b/pages/member/feedback.vue
@@ -1,306 +1,236 @@
-
+
- 问题和意见
- 快速键入
+
+ 请选择问题反馈类型:
+
+
+
+ {{item.name}}
+
+
+
+
+
+
+
+
+
+
+
-
+
-
+ 提交
diff --git a/pages/my/account.vue b/pages/my/account.vue
deleted file mode 100644
index 3d936ff..0000000
--- a/pages/my/account.vue
+++ /dev/null
@@ -1,116 +0,0 @@
-
-
-
- 支付宝账号
-
-
-
- 隐私政策
-
-
-
- 用户协议
-
-
-
- 意见反馈
-
-
-
-
-
-
-
-
diff --git a/pages/my/cooperation.vue b/pages/my/cooperation.vue
index eacaa3d..9d37168 100644
--- a/pages/my/cooperation.vue
+++ b/pages/my/cooperation.vue
@@ -1,23 +1,27 @@
- 店铺名称
+ 商家信息填写
+ 店铺名称
- 姓名
+ 联系人姓名
- 联系电话
+ 手机号
- 地址信息
+
-
+
@@ -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;
+ }
diff --git a/pages/my/customer.vue b/pages/my/customer.vue
index f607ec0..eb7b67d 100644
--- a/pages/my/customer.vue
+++ b/pages/my/customer.vue
@@ -3,12 +3,12 @@
添加客服微信咨询
微信号:{{weixin}}
- 一键复制
+ 一键复制
{{ isWeiXin ? '长按识别上方二维码' : '' }}
diff --git a/pages/my/index.vue b/pages/my/index.vue
index dcaece8..e332570 100644
--- a/pages/my/index.vue
+++ b/pages/my/index.vue
@@ -1,8 +1,9 @@
-
+
+
+
diff --git a/pages/my/zhifubao.vue b/pages/my/zhifubao.vue
new file mode 100644
index 0000000..cdd7cd1
--- /dev/null
+++ b/pages/my/zhifubao.vue
@@ -0,0 +1,53 @@
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/pages/order/index.vue b/pages/order/index.vue
index cbf4e18..e83f52a 100644
--- a/pages/order/index.vue
+++ b/pages/order/index.vue
@@ -1,28 +1,29 @@
-
-
-
-
- {{ tab.name }}
-
-
-
+
+
-
-
-
-
-
-
-
-
-
+
+
+
+ 2021年11月11日11:25:38
+
+
+
+
+
+ {{item.goodsTitle}}
+
+ 会员满20返18
+ 非会员满20返18
+
+
+
+
+
+
+
+ {{item.status == 1 ? '待提交' : item.status == 2 ? '待审核' : item.status == 3 ? '审核成功' : item.status == 4 ? '审核失败' : item.status == 5 ? '放弃任务':''}}
+ 拒绝原因:{{item.auditContent}}
-
-
-
- 取消作业
- 提交作业
-
+
+
+
+
+ 放弃任务
+ 上传凭证
+
+
+
+
+ 结束后自动审核
-
-
-
-
-
-
+
+
+
+
+
+
+
@@ -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;
+ }
diff --git a/pages/order/release.vue b/pages/order/release.vue
index af48f2c..a51da63 100644
--- a/pages/order/release.vue
+++ b/pages/order/release.vue
@@ -2,29 +2,49 @@
- 订餐手机号
+ 订单手机号:
-
+
+
- 支付金额
+ 支付金额:
-
+
+
- 上传订单凭证(最少两张)
-
+
+ 请选择订单类型:
+
+
+
+
+ {{array[index]}}
+
+
+
+
+
+
+ 上传订单凭证(最少两张):
+
+
+
上传订单凭证示例图
-
-
+
+
@@ -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 @@
diff --git a/pages/public/login.vue b/pages/public/login.vue
index 15014df..7a55193 100644
--- a/pages/public/login.vue
+++ b/pages/public/login.vue
@@ -5,11 +5,13 @@
- 申请获取以下权限
- 获得你的公开信息(昵称,头像、地区等)
+ 番茄饭团
+ 为了提供优质服务,需要您授权基本信息
+
-->
-
@@ -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 @@
+```
+
+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
+
+ 按钮
+
+```
+
+请通过[快速上手](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)
+
+## 预览
+
+您可以通过**微信**扫码,查看最佳的演示效果。
+
+
+
+
+
+## 版权信息
+uView遵循[MIT](https://en.wikipedia.org/wiki/MIT_License)开源协议,意味着您无需支付任何费用,也无需授权,即可将uView应用到您的产品中。
diff --git a/uview-ui/components/u-action-sheet/u-action-sheet.vue b/uview-ui/components/u-action-sheet/u-action-sheet.vue
new file mode 100644
index 0000000..722b668
--- /dev/null
+++ b/uview-ui/components/u-action-sheet/u-action-sheet.vue
@@ -0,0 +1,190 @@
+
+
+
+ {{tips.text}}
+
+
+
+ {{item.text}}
+ {{item.subText}}
+
+
+
+
+ {{cancelText}}
+
+
+
+
+
+
diff --git a/uview-ui/components/u-alert-tips/u-alert-tips.vue b/uview-ui/components/u-alert-tips/u-alert-tips.vue
new file mode 100644
index 0000000..e81fc37
--- /dev/null
+++ b/uview-ui/components/u-alert-tips/u-alert-tips.vue
@@ -0,0 +1,256 @@
+
+
+
+
+
+
+
+ {{title}}
+
+
+ {{description}}
+
+
+
+
+
+ {{closeText}}
+
+
+
+
+
+
diff --git a/uview-ui/components/u-avatar-cropper/u-avatar-cropper.vue b/uview-ui/components/u-avatar-cropper/u-avatar-cropper.vue
new file mode 100644
index 0000000..a48dd54
--- /dev/null
+++ b/uview-ui/components/u-avatar-cropper/u-avatar-cropper.vue
@@ -0,0 +1,290 @@
+
+
+
+
+
+
+
+
+ 选择图片
+
+
+ 重新选择
+
+ 确定
+
+
+
+
+
+
+
diff --git a/uview-ui/components/u-avatar-cropper/weCropper.js b/uview-ui/components/u-avatar-cropper/weCropper.js
new file mode 100644
index 0000000..df02483
--- /dev/null
+++ b/uview-ui/components/u-avatar-cropper/weCropper.js
@@ -0,0 +1,1265 @@
+/**
+ * we-cropper v1.3.9
+ * (c) 2020 dlhandsome
+ * @license MIT
+ */
+(function(global, factory) {
+ typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
+ typeof define === 'function' && define.amd ? define(factory) :
+ (global.WeCropper = factory());
+}(this, (function() {
+ 'use strict';
+
+ var device = void 0;
+ var TOUCH_STATE = ['touchstarted', 'touchmoved', 'touchended'];
+
+ function firstLetterUpper(str) {
+ return str.charAt(0).toUpperCase() + str.slice(1)
+ }
+
+ function setTouchState(instance) {
+ var arg = [],
+ len = arguments.length - 1;
+ while (len-- > 0) arg[len] = arguments[len + 1];
+
+ TOUCH_STATE.forEach(function(key, i) {
+ if (arg[i] !== undefined) {
+ instance[key] = arg[i];
+ }
+ });
+ }
+
+ function validator(instance, o) {
+ Object.defineProperties(instance, o);
+ }
+
+ function getDevice() {
+ if (!device) {
+ device = uni.getSystemInfoSync();
+ }
+ return device
+ }
+
+ var tmp = {};
+
+ var ref = getDevice();
+ var pixelRatio = ref.pixelRatio;
+
+ var DEFAULT = {
+ id: {
+ default: 'cropper',
+ get: function get() {
+ return tmp.id
+ },
+ set: function set(value) {
+ if (typeof(value) !== 'string') {
+ console.error(("id:" + value + " is invalid"));
+ }
+ tmp.id = value;
+ }
+ },
+ width: {
+ default: 750,
+ get: function get() {
+ return tmp.width
+ },
+ set: function set(value) {
+ if (typeof(value) !== 'number') {
+ console.error(("width:" + value + " is invalid"));
+ }
+ tmp.width = value;
+ }
+ },
+ height: {
+ default: 750,
+ get: function get() {
+ return tmp.height
+ },
+ set: function set(value) {
+ if (typeof(value) !== 'number') {
+ console.error(("height:" + value + " is invalid"));
+ }
+ tmp.height = value;
+ }
+ },
+ pixelRatio: {
+ default: pixelRatio,
+ get: function get() {
+ return tmp.pixelRatio
+ },
+ set: function set(value) {
+ if (typeof(value) !== 'number') {
+ console.error(("pixelRatio:" + value + " is invalid"));
+ }
+ tmp.pixelRatio = value;
+ }
+ },
+ scale: {
+ default: 2.5,
+ get: function get() {
+ return tmp.scale
+ },
+ set: function set(value) {
+ if (typeof(value) !== 'number') {
+ console.error(("scale:" + value + " is invalid"));
+ }
+ tmp.scale = value;
+ }
+ },
+ zoom: {
+ default: 5,
+ get: function get() {
+ return tmp.zoom
+ },
+ set: function set(value) {
+ if (typeof(value) !== 'number') {
+ console.error(("zoom:" + value + " is invalid"));
+ } else if (value < 0 || value > 10) {
+ console.error("zoom should be ranged in 0 ~ 10");
+ }
+ tmp.zoom = value;
+ }
+ },
+ src: {
+ default: '',
+ get: function get() {
+ return tmp.src
+ },
+ set: function set(value) {
+ if (typeof(value) !== 'string') {
+ console.error(("src:" + value + " is invalid"));
+ }
+ tmp.src = value;
+ }
+ },
+ cut: {
+ default: {},
+ get: function get() {
+ return tmp.cut
+ },
+ set: function set(value) {
+ if (typeof(value) !== 'object') {
+ console.error(("cut:" + value + " is invalid"));
+ }
+ tmp.cut = value;
+ }
+ },
+ boundStyle: {
+ default: {},
+ get: function get() {
+ return tmp.boundStyle
+ },
+ set: function set(value) {
+ if (typeof(value) !== 'object') {
+ console.error(("boundStyle:" + value + " is invalid"));
+ }
+ tmp.boundStyle = value;
+ }
+ },
+ onReady: {
+ default: null,
+ get: function get() {
+ return tmp.ready
+ },
+ set: function set(value) {
+ tmp.ready = value;
+ }
+ },
+ onBeforeImageLoad: {
+ default: null,
+ get: function get() {
+ return tmp.beforeImageLoad
+ },
+ set: function set(value) {
+ tmp.beforeImageLoad = value;
+ }
+ },
+ onImageLoad: {
+ default: null,
+ get: function get() {
+ return tmp.imageLoad
+ },
+ set: function set(value) {
+ tmp.imageLoad = value;
+ }
+ },
+ onBeforeDraw: {
+ default: null,
+ get: function get() {
+ return tmp.beforeDraw
+ },
+ set: function set(value) {
+ tmp.beforeDraw = value;
+ }
+ }
+ };
+
+ var ref$1 = getDevice();
+ var windowWidth = ref$1.windowWidth;
+
+ function prepare() {
+ var self = this;
+
+ // v1.4.0 版本中将不再自动绑定we-cropper实例
+ self.attachPage = function() {
+ var pages = getCurrentPages();
+ // 获取到当前page上下文
+ var pageContext = pages[pages.length - 1];
+ // 把this依附在Page上下文的wecropper属性上,便于在page钩子函数中访问
+ Object.defineProperty(pageContext, 'wecropper', {
+ get: function get() {
+ console.warn(
+ 'Instance will not be automatically bound to the page after v1.4.0\n\n' +
+ 'Please use a custom instance name instead\n\n' +
+ 'Example: \n' +
+ 'this.mycropper = new WeCropper(options)\n\n' +
+ '// ...\n' +
+ 'this.mycropper.getCropperImage()'
+ );
+ return self
+ },
+ configurable: true
+ });
+ };
+
+ self.createCtx = function() {
+ var id = self.id;
+ var targetId = self.targetId;
+
+ if (id) {
+ self.ctx = self.ctx || uni.createCanvasContext(id);
+ self.targetCtx = self.targetCtx || uni.createCanvasContext(targetId);
+ } else {
+ console.error("constructor: create canvas context failed, 'id' must be valuable");
+ }
+ };
+
+ self.deviceRadio = windowWidth / 750;
+ }
+
+ var commonjsGlobal = typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !==
+ 'undefined' ? self : {};
+
+
+
+
+
+ function createCommonjsModule(fn, module) {
+ return module = {
+ exports: {}
+ }, fn(module, module.exports), module.exports;
+ }
+
+ var tools = createCommonjsModule(function(module, exports) {
+ /**
+ * String type check
+ */
+ exports.isStr = function(v) {
+ return typeof v === 'string';
+ };
+ /**
+ * Number type check
+ */
+ exports.isNum = function(v) {
+ return typeof v === 'number';
+ };
+ /**
+ * Array type check
+ */
+ exports.isArr = Array.isArray;
+ /**
+ * undefined type check
+ */
+ exports.isUndef = function(v) {
+ return v === undefined;
+ };
+
+ exports.isTrue = function(v) {
+ return v === true;
+ };
+
+ exports.isFalse = function(v) {
+ return v === false;
+ };
+ /**
+ * Function type check
+ */
+ exports.isFunc = function(v) {
+ return typeof v === 'function';
+ };
+ /**
+ * Quick object check - this is primarily used to tell
+ * Objects from primitive values when we know the value
+ * is a JSON-compliant type.
+ */
+ exports.isObj = exports.isObject = function(obj) {
+ return obj !== null && typeof obj === 'object'
+ };
+
+ /**
+ * Strict object type check. Only returns true
+ * for plain JavaScript objects.
+ */
+ var _toString = Object.prototype.toString;
+ exports.isPlainObject = function(obj) {
+ return _toString.call(obj) === '[object Object]'
+ };
+
+ /**
+ * Check whether the object has the property.
+ */
+ var hasOwnProperty = Object.prototype.hasOwnProperty;
+ exports.hasOwn = function(obj, key) {
+ return hasOwnProperty.call(obj, key)
+ };
+
+ /**
+ * Perform no operation.
+ * Stubbing args to make Flow happy without leaving useless transpiled code
+ * with ...rest (https://flow.org/blog/2017/05/07/Strict-Function-Call-Arity/)
+ */
+ exports.noop = function(a, b, c) {};
+
+ /**
+ * Check if val is a valid array index.
+ */
+ exports.isValidArrayIndex = function(val) {
+ var n = parseFloat(String(val));
+ return n >= 0 && Math.floor(n) === n && isFinite(val)
+ };
+ });
+
+ var tools_7 = tools.isFunc;
+ var tools_10 = tools.isPlainObject;
+
+ var EVENT_TYPE = ['ready', 'beforeImageLoad', 'beforeDraw', 'imageLoad'];
+
+ function observer() {
+ var self = this;
+
+ self.on = function(event, fn) {
+ if (EVENT_TYPE.indexOf(event) > -1) {
+ if (tools_7(fn)) {
+ event === 'ready' ?
+ fn(self) :
+ self[("on" + (firstLetterUpper(event)))] = fn;
+ }
+ } else {
+ console.error(("event: " + event + " is invalid"));
+ }
+ return self
+ };
+ }
+
+ function wxPromise(fn) {
+ return function(obj) {
+ var args = [],
+ len = arguments.length - 1;
+ while (len-- > 0) args[len] = arguments[len + 1];
+
+ if (obj === void 0) obj = {};
+ return new Promise(function(resolve, reject) {
+ obj.success = function(res) {
+ resolve(res);
+ };
+ obj.fail = function(err) {
+ reject(err);
+ };
+ fn.apply(void 0, [obj].concat(args));
+ })
+ }
+ }
+
+ function draw(ctx, reserve) {
+ if (reserve === void 0) reserve = false;
+
+ return new Promise(function(resolve) {
+ ctx.draw(reserve, resolve);
+ })
+ }
+
+ var getImageInfo = wxPromise(uni.getImageInfo);
+
+ var canvasToTempFilePath = wxPromise(uni.canvasToTempFilePath);
+
+ var base64 = createCommonjsModule(function(module, exports) {
+ /*! http://mths.be/base64 v0.1.0 by @mathias | MIT license */
+ (function(root) {
+
+ // Detect free variables `exports`.
+ var freeExports = 'object' == 'object' && exports;
+
+ // Detect free variable `module`.
+ var freeModule = 'object' == 'object' && module &&
+ module.exports == freeExports && module;
+
+ // Detect free variable `global`, from Node.js or Browserified code, and use
+ // it as `root`.
+ var freeGlobal = typeof commonjsGlobal == 'object' && commonjsGlobal;
+ if (freeGlobal.global === freeGlobal || freeGlobal.window === freeGlobal) {
+ root = freeGlobal;
+ }
+
+ /*--------------------------------------------------------------------------*/
+
+ var InvalidCharacterError = function(message) {
+ this.message = message;
+ };
+ InvalidCharacterError.prototype = new Error;
+ InvalidCharacterError.prototype.name = 'InvalidCharacterError';
+
+ var error = function(message) {
+ // Note: the error messages used throughout this file match those used by
+ // the native `atob`/`btoa` implementation in Chromium.
+ throw new InvalidCharacterError(message);
+ };
+
+ var TABLE = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';
+ // http://whatwg.org/html/common-microsyntaxes.html#space-character
+ var REGEX_SPACE_CHARACTERS = /[\t\n\f\r ]/g;
+
+ // `decode` is designed to be fully compatible with `atob` as described in the
+ // HTML Standard. http://whatwg.org/html/webappapis.html#dom-windowbase64-atob
+ // The optimized base64-decoding algorithm used is based on @atk’s excellent
+ // implementation. https://gist.github.com/atk/1020396
+ var decode = function(input) {
+ input = String(input)
+ .replace(REGEX_SPACE_CHARACTERS, '');
+ var length = input.length;
+ if (length % 4 == 0) {
+ input = input.replace(/==?$/, '');
+ length = input.length;
+ }
+ if (
+ length % 4 == 1 ||
+ // http://whatwg.org/C#alphanumeric-ascii-characters
+ /[^+a-zA-Z0-9/]/.test(input)
+ ) {
+ error(
+ 'Invalid character: the string to be decoded is not correctly encoded.'
+ );
+ }
+ var bitCounter = 0;
+ var bitStorage;
+ var buffer;
+ var output = '';
+ var position = -1;
+ while (++position < length) {
+ buffer = TABLE.indexOf(input.charAt(position));
+ bitStorage = bitCounter % 4 ? bitStorage * 64 + buffer : buffer;
+ // Unless this is the first of a group of 4 characters…
+ if (bitCounter++ % 4) {
+ // …convert the first 8 bits to a single ASCII character.
+ output += String.fromCharCode(
+ 0xFF & bitStorage >> (-2 * bitCounter & 6)
+ );
+ }
+ }
+ return output;
+ };
+
+ // `encode` is designed to be fully compatible with `btoa` as described in the
+ // HTML Standard: http://whatwg.org/html/webappapis.html#dom-windowbase64-btoa
+ var encode = function(input) {
+ input = String(input);
+ if (/[^\0-\xFF]/.test(input)) {
+ // Note: no need to special-case astral symbols here, as surrogates are
+ // matched, and the input is supposed to only contain ASCII anyway.
+ error(
+ 'The string to be encoded contains characters outside of the ' +
+ 'Latin1 range.'
+ );
+ }
+ var padding = input.length % 3;
+ var output = '';
+ var position = -1;
+ var a;
+ var b;
+ var c;
+ var buffer;
+ // Make sure any padding is handled outside of the loop.
+ var length = input.length - padding;
+
+ while (++position < length) {
+ // Read three bytes, i.e. 24 bits.
+ a = input.charCodeAt(position) << 16;
+ b = input.charCodeAt(++position) << 8;
+ c = input.charCodeAt(++position);
+ buffer = a + b + c;
+ // Turn the 24 bits into four chunks of 6 bits each, and append the
+ // matching character for each of them to the output.
+ output += (
+ TABLE.charAt(buffer >> 18 & 0x3F) +
+ TABLE.charAt(buffer >> 12 & 0x3F) +
+ TABLE.charAt(buffer >> 6 & 0x3F) +
+ TABLE.charAt(buffer & 0x3F)
+ );
+ }
+
+ if (padding == 2) {
+ a = input.charCodeAt(position) << 8;
+ b = input.charCodeAt(++position);
+ buffer = a + b;
+ output += (
+ TABLE.charAt(buffer >> 10) +
+ TABLE.charAt((buffer >> 4) & 0x3F) +
+ TABLE.charAt((buffer << 2) & 0x3F) +
+ '='
+ );
+ } else if (padding == 1) {
+ buffer = input.charCodeAt(position);
+ output += (
+ TABLE.charAt(buffer >> 2) +
+ TABLE.charAt((buffer << 4) & 0x3F) +
+ '=='
+ );
+ }
+
+ return output;
+ };
+
+ var base64 = {
+ 'encode': encode,
+ 'decode': decode,
+ 'version': '0.1.0'
+ };
+
+ // Some AMD build optimizers, like r.js, check for specific condition patterns
+ // like the following:
+ if (
+ typeof undefined == 'function' &&
+ typeof undefined.amd == 'object' &&
+ undefined.amd
+ ) {
+ undefined(function() {
+ return base64;
+ });
+ } else if (freeExports && !freeExports.nodeType) {
+ if (freeModule) { // in Node.js or RingoJS v0.8.0+
+ freeModule.exports = base64;
+ } else { // in Narwhal or RingoJS v0.7.0-
+ for (var key in base64) {
+ base64.hasOwnProperty(key) && (freeExports[key] = base64[key]);
+ }
+ }
+ } else { // in Rhino or a web browser
+ root.base64 = base64;
+ }
+
+ }(commonjsGlobal));
+ });
+
+ function makeURI(strData, type) {
+ return 'data:' + type + ';base64,' + strData
+ }
+
+ function fixType(type) {
+ type = type.toLowerCase().replace(/jpg/i, 'jpeg');
+ var r = type.match(/png|jpeg|bmp|gif/)[0];
+ return 'image/' + r
+ }
+
+ function encodeData(data) {
+ var str = '';
+ if (typeof data === 'string') {
+ str = data;
+ } else {
+ for (var i = 0; i < data.length; i++) {
+ str += String.fromCharCode(data[i]);
+ }
+ }
+ return base64.encode(str)
+ }
+
+ /**
+ * 获取图像区域隐含的像素数据
+ * @param canvasId canvas标识
+ * @param x 将要被提取的图像数据矩形区域的左上角 x 坐标
+ * @param y 将要被提取的图像数据矩形区域的左上角 y 坐标
+ * @param width 将要被提取的图像数据矩形区域的宽度
+ * @param height 将要被提取的图像数据矩形区域的高度
+ * @param done 完成回调
+ */
+ function getImageData(canvasId, x, y, width, height, done) {
+ uni.canvasGetImageData({
+ canvasId: canvasId,
+ x: x,
+ y: y,
+ width: width,
+ height: height,
+ success: function success(res) {
+ done(res, null);
+ },
+ fail: function fail(res) {
+ done(null, res);
+ }
+ });
+ }
+
+ /**
+ * 生成bmp格式图片
+ * 按照规则生成图片响应头和响应体
+ * @param oData 用来描述 canvas 区域隐含的像素数据 { data, width, height } = oData
+ * @returns {*} base64字符串
+ */
+ function genBitmapImage(oData) {
+ //
+ // BITMAPFILEHEADER: http://msdn.microsoft.com/en-us/library/windows/desktop/dd183374(v=vs.85).aspx
+ // BITMAPINFOHEADER: http://msdn.microsoft.com/en-us/library/dd183376.aspx
+ //
+ var biWidth = oData.width;
+ var biHeight = oData.height;
+ var biSizeImage = biWidth * biHeight * 3;
+ var bfSize = biSizeImage + 54; // total header size = 54 bytes
+
+ //
+ // typedef struct tagBITMAPFILEHEADER {
+ // WORD bfType;
+ // DWORD bfSize;
+ // WORD bfReserved1;
+ // WORD bfReserved2;
+ // DWORD bfOffBits;
+ // } BITMAPFILEHEADER;
+ //
+ var BITMAPFILEHEADER = [
+ // WORD bfType -- The file type signature; must be "BM"
+ 0x42, 0x4D,
+ // DWORD bfSize -- The size, in bytes, of the bitmap file
+ bfSize & 0xff, bfSize >> 8 & 0xff, bfSize >> 16 & 0xff, bfSize >> 24 & 0xff,
+ // WORD bfReserved1 -- Reserved; must be zero
+ 0, 0,
+ // WORD bfReserved2 -- Reserved; must be zero
+ 0, 0,
+ // DWORD bfOffBits -- The offset, in bytes, from the beginning of the BITMAPFILEHEADER structure to the bitmap bits.
+ 54, 0, 0, 0
+ ];
+
+ //
+ // typedef struct tagBITMAPINFOHEADER {
+ // DWORD biSize;
+ // LONG biWidth;
+ // LONG biHeight;
+ // WORD biPlanes;
+ // WORD biBitCount;
+ // DWORD biCompression;
+ // DWORD biSizeImage;
+ // LONG biXPelsPerMeter;
+ // LONG biYPelsPerMeter;
+ // DWORD biClrUsed;
+ // DWORD biClrImportant;
+ // } BITMAPINFOHEADER, *PBITMAPINFOHEADER;
+ //
+ var BITMAPINFOHEADER = [
+ // DWORD biSize -- The number of bytes required by the structure
+ 40, 0, 0, 0,
+ // LONG biWidth -- The width of the bitmap, in pixels
+ biWidth & 0xff, biWidth >> 8 & 0xff, biWidth >> 16 & 0xff, biWidth >> 24 & 0xff,
+ // LONG biHeight -- The height of the bitmap, in pixels
+ biHeight & 0xff, biHeight >> 8 & 0xff, biHeight >> 16 & 0xff, biHeight >> 24 & 0xff,
+ // WORD biPlanes -- The number of planes for the target device. This value must be set to 1
+ 1, 0,
+ // WORD biBitCount -- The number of bits-per-pixel, 24 bits-per-pixel -- the bitmap
+ // has a maximum of 2^24 colors (16777216, Truecolor)
+ 24, 0,
+ // DWORD biCompression -- The type of compression, BI_RGB (code 0) -- uncompressed
+ 0, 0, 0, 0,
+ // DWORD biSizeImage -- The size, in bytes, of the image. This may be set to zero for BI_RGB bitmaps
+ biSizeImage & 0xff, biSizeImage >> 8 & 0xff, biSizeImage >> 16 & 0xff, biSizeImage >> 24 & 0xff,
+ // LONG biXPelsPerMeter, unused
+ 0, 0, 0, 0,
+ // LONG biYPelsPerMeter, unused
+ 0, 0, 0, 0,
+ // DWORD biClrUsed, the number of color indexes of palette, unused
+ 0, 0, 0, 0,
+ // DWORD biClrImportant, unused
+ 0, 0, 0, 0
+ ];
+
+ var iPadding = (4 - ((biWidth * 3) % 4)) % 4;
+
+ var aImgData = oData.data;
+
+ var strPixelData = '';
+ var biWidth4 = biWidth << 2;
+ var y = biHeight;
+ var fromCharCode = String.fromCharCode;
+
+ do {
+ var iOffsetY = biWidth4 * (y - 1);
+ var strPixelRow = '';
+ for (var x = 0; x < biWidth; x++) {
+ var iOffsetX = x << 2;
+ strPixelRow += fromCharCode(aImgData[iOffsetY + iOffsetX + 2]) +
+ fromCharCode(aImgData[iOffsetY + iOffsetX + 1]) +
+ fromCharCode(aImgData[iOffsetY + iOffsetX]);
+ }
+
+ for (var c = 0; c < iPadding; c++) {
+ strPixelRow += String.fromCharCode(0);
+ }
+
+ strPixelData += strPixelRow;
+ } while (--y)
+
+ var strEncoded = encodeData(BITMAPFILEHEADER.concat(BITMAPINFOHEADER)) + encodeData(strPixelData);
+
+ return strEncoded
+ }
+
+ /**
+ * 转换为图片base64
+ * @param canvasId canvas标识
+ * @param x 将要被提取的图像数据矩形区域的左上角 x 坐标
+ * @param y 将要被提取的图像数据矩形区域的左上角 y 坐标
+ * @param width 将要被提取的图像数据矩形区域的宽度
+ * @param height 将要被提取的图像数据矩形区域的高度
+ * @param type 转换图片类型
+ * @param done 完成回调
+ */
+ function convertToImage(canvasId, x, y, width, height, type, done) {
+ if (done === void 0) done = function() {};
+
+ if (type === undefined) {
+ type = 'png';
+ }
+ type = fixType(type);
+ if (/bmp/.test(type)) {
+ getImageData(canvasId, x, y, width, height, function(data, err) {
+ var strData = genBitmapImage(data);
+ tools_7(done) && done(makeURI(strData, 'image/' + type), err);
+ });
+ } else {
+ console.error('暂不支持生成\'' + type + '\'类型的base64图片');
+ }
+ }
+
+ var CanvasToBase64 = {
+ convertToImage: convertToImage,
+ // convertToPNG: function (width, height, done) {
+ // return convertToImage(width, height, 'png', done)
+ // },
+ // convertToJPEG: function (width, height, done) {
+ // return convertToImage(width, height, 'jpeg', done)
+ // },
+ // convertToGIF: function (width, height, done) {
+ // return convertToImage(width, height, 'gif', done)
+ // },
+ convertToBMP: function(ref, done) {
+ if (ref === void 0) ref = {};
+ var canvasId = ref.canvasId;
+ var x = ref.x;
+ var y = ref.y;
+ var width = ref.width;
+ var height = ref.height;
+ if (done === void 0) done = function() {};
+
+ return convertToImage(canvasId, x, y, width, height, 'bmp', done)
+ }
+ };
+
+ function methods() {
+ var self = this;
+
+ var boundWidth = self.width; // 裁剪框默认宽度,即整个画布宽度
+ var boundHeight = self.height; // 裁剪框默认高度,即整个画布高度
+
+ var id = self.id;
+ var targetId = self.targetId;
+ var pixelRatio = self.pixelRatio;
+
+ var ref = self.cut;
+ var x = ref.x;
+ if (x === void 0) x = 0;
+ var y = ref.y;
+ if (y === void 0) y = 0;
+ var width = ref.width;
+ if (width === void 0) width = boundWidth;
+ var height = ref.height;
+ if (height === void 0) height = boundHeight;
+
+ self.updateCanvas = function(done) {
+ if (self.croperTarget) {
+ // 画布绘制图片
+ self.ctx.drawImage(
+ self.croperTarget,
+ self.imgLeft,
+ self.imgTop,
+ self.scaleWidth,
+ self.scaleHeight
+ );
+ }
+ tools_7(self.onBeforeDraw) && self.onBeforeDraw(self.ctx, self);
+
+ self.setBoundStyle(self.boundStyle); // 设置边界样式
+
+ self.ctx.draw(false, done);
+ return self
+ };
+
+ self.pushOrigin = self.pushOrign = function(src) {
+ self.src = src;
+
+ tools_7(self.onBeforeImageLoad) && self.onBeforeImageLoad(self.ctx, self);
+
+ return getImageInfo({
+ src: src
+ })
+ .then(function(res) {
+ var innerAspectRadio = res.width / res.height;
+ var customAspectRadio = width / height;
+
+ self.croperTarget = res.path;
+
+ if (innerAspectRadio < customAspectRadio) {
+ self.rectX = x;
+ self.baseWidth = width;
+ self.baseHeight = width / innerAspectRadio;
+ self.rectY = y - Math.abs((height - self.baseHeight) / 2);
+ } else {
+ self.rectY = y;
+ self.baseWidth = height * innerAspectRadio;
+ self.baseHeight = height;
+ self.rectX = x - Math.abs((width - self.baseWidth) / 2);
+ }
+
+ self.imgLeft = self.rectX;
+ self.imgTop = self.rectY;
+ self.scaleWidth = self.baseWidth;
+ self.scaleHeight = self.baseHeight;
+
+ self.update();
+
+ return new Promise(function(resolve) {
+ self.updateCanvas(resolve);
+ })
+ })
+ .then(function() {
+ tools_7(self.onImageLoad) && self.onImageLoad(self.ctx, self);
+ })
+ };
+
+ self.removeImage = function() {
+ self.src = '';
+ self.croperTarget = '';
+ return draw(self.ctx)
+ };
+
+ self.getCropperBase64 = function(done) {
+ if (done === void 0) done = function() {};
+
+ CanvasToBase64.convertToBMP({
+ canvasId: id,
+ x: x,
+ y: y,
+ width: width,
+ height: height
+ }, done);
+ };
+
+ self.getCropperImage = function(opt, fn) {
+ var customOptions = opt;
+
+ var canvasOptions = {
+ canvasId: id,
+ x: x,
+ y: y,
+ width: width,
+ height: height
+ };
+
+ var task = function() {
+ return Promise.resolve();
+ };
+
+ if (
+ tools_10(customOptions) &&
+ customOptions.original
+ ) {
+ // original mode
+ task = function() {
+ self.targetCtx.drawImage(
+ self.croperTarget,
+ self.imgLeft * pixelRatio,
+ self.imgTop * pixelRatio,
+ self.scaleWidth * pixelRatio,
+ self.scaleHeight * pixelRatio
+ );
+
+ canvasOptions = {
+ canvasId: targetId,
+ x: x * pixelRatio,
+ y: y * pixelRatio,
+ width: width * pixelRatio,
+ height: height * pixelRatio
+ };
+
+ return draw(self.targetCtx)
+ };
+ }
+
+ return task()
+ .then(function() {
+ if (tools_10(customOptions)) {
+ canvasOptions = Object.assign({}, canvasOptions, customOptions);
+ }
+
+ if (tools_7(customOptions)) {
+ fn = customOptions;
+ }
+
+ var arg = canvasOptions.componentContext ?
+ [canvasOptions, canvasOptions.componentContext] :
+ [canvasOptions];
+
+ return canvasToTempFilePath.apply(null, arg)
+ })
+ .then(function(res) {
+ var tempFilePath = res.tempFilePath;
+
+ return tools_7(fn) ?
+ fn.call(self, tempFilePath, null) :
+ tempFilePath
+ })
+ .catch(function(err) {
+ if (tools_7(fn)) {
+ fn.call(self, null, err);
+ } else {
+ throw err
+ }
+ })
+ };
+ }
+
+ /**
+ * 获取最新缩放值
+ * @param oldScale 上一次触摸结束后的缩放值
+ * @param oldDistance 上一次触摸结束后的双指距离
+ * @param zoom 缩放系数
+ * @param touch0 第一指touch对象
+ * @param touch1 第二指touch对象
+ * @returns {*}
+ */
+ var getNewScale = function(oldScale, oldDistance, zoom, touch0, touch1) {
+ var xMove, yMove, newDistance;
+ // 计算二指最新距离
+ xMove = Math.round(touch1.x - touch0.x);
+ yMove = Math.round(touch1.y - touch0.y);
+ newDistance = Math.round(Math.sqrt(xMove * xMove + yMove * yMove));
+
+ return oldScale + 0.001 * zoom * (newDistance - oldDistance)
+ };
+
+ function update() {
+ var self = this;
+
+ if (!self.src) {
+ return
+ }
+
+ self.__oneTouchStart = function(touch) {
+ self.touchX0 = Math.round(touch.x);
+ self.touchY0 = Math.round(touch.y);
+ };
+
+ self.__oneTouchMove = function(touch) {
+ var xMove, yMove;
+ // 计算单指移动的距离
+ if (self.touchended) {
+ return self.updateCanvas()
+ }
+ xMove = Math.round(touch.x - self.touchX0);
+ yMove = Math.round(touch.y - self.touchY0);
+
+ var imgLeft = Math.round(self.rectX + xMove);
+ var imgTop = Math.round(self.rectY + yMove);
+
+ self.outsideBound(imgLeft, imgTop);
+
+ self.updateCanvas();
+ };
+
+ self.__twoTouchStart = function(touch0, touch1) {
+ var xMove, yMove, oldDistance;
+
+ self.touchX1 = Math.round(self.rectX + self.scaleWidth / 2);
+ self.touchY1 = Math.round(self.rectY + self.scaleHeight / 2);
+
+ // 计算两指距离
+ xMove = Math.round(touch1.x - touch0.x);
+ yMove = Math.round(touch1.y - touch0.y);
+ oldDistance = Math.round(Math.sqrt(xMove * xMove + yMove * yMove));
+
+ self.oldDistance = oldDistance;
+ };
+
+ self.__twoTouchMove = function(touch0, touch1) {
+ var oldScale = self.oldScale;
+ var oldDistance = self.oldDistance;
+ var scale = self.scale;
+ var zoom = self.zoom;
+
+ self.newScale = getNewScale(oldScale, oldDistance, zoom, touch0, touch1);
+
+ // 设定缩放范围
+ self.newScale <= 1 && (self.newScale = 1);
+ self.newScale >= scale && (self.newScale = scale);
+
+ self.scaleWidth = Math.round(self.newScale * self.baseWidth);
+ self.scaleHeight = Math.round(self.newScale * self.baseHeight);
+ var imgLeft = Math.round(self.touchX1 - self.scaleWidth / 2);
+ var imgTop = Math.round(self.touchY1 - self.scaleHeight / 2);
+
+ self.outsideBound(imgLeft, imgTop);
+
+ self.updateCanvas();
+ };
+
+ self.__xtouchEnd = function() {
+ self.oldScale = self.newScale;
+ self.rectX = self.imgLeft;
+ self.rectY = self.imgTop;
+ };
+ }
+
+ var handle = {
+ // 图片手势初始监测
+ touchStart: function touchStart(e) {
+ var self = this;
+ var ref = e.touches;
+ var touch0 = ref[0];
+ var touch1 = ref[1];
+
+ if (!self.src) {
+ return
+ }
+
+ setTouchState(self, true, null, null);
+
+ // 计算第一个触摸点的位置,并参照改点进行缩放
+ self.__oneTouchStart(touch0);
+
+ // 两指手势触发
+ if (e.touches.length >= 2) {
+ self.__twoTouchStart(touch0, touch1);
+ }
+ },
+
+ // 图片手势动态缩放
+ touchMove: function touchMove(e) {
+ var self = this;
+ var ref = e.touches;
+ var touch0 = ref[0];
+ var touch1 = ref[1];
+
+ if (!self.src) {
+ return
+ }
+
+ setTouchState(self, null, true);
+
+ // 单指手势时触发
+ if (e.touches.length === 1) {
+ self.__oneTouchMove(touch0);
+ }
+ // 两指手势触发
+ if (e.touches.length >= 2) {
+ self.__twoTouchMove(touch0, touch1);
+ }
+ },
+
+ touchEnd: function touchEnd(e) {
+ var self = this;
+
+ if (!self.src) {
+ return
+ }
+
+ setTouchState(self, false, false, true);
+ self.__xtouchEnd();
+ }
+ };
+
+ function cut() {
+ var self = this;
+ var boundWidth = self.width; // 裁剪框默认宽度,即整个画布宽度
+ var boundHeight = self.height;
+ // 裁剪框默认高度,即整个画布高度
+ var ref = self.cut;
+ var x = ref.x;
+ if (x === void 0) x = 0;
+ var y = ref.y;
+ if (y === void 0) y = 0;
+ var width = ref.width;
+ if (width === void 0) width = boundWidth;
+ var height = ref.height;
+ if (height === void 0) height = boundHeight;
+
+ /**
+ * 设置边界
+ * @param imgLeft 图片左上角横坐标值
+ * @param imgTop 图片左上角纵坐标值
+ */
+ self.outsideBound = function(imgLeft, imgTop) {
+ self.imgLeft = imgLeft >= x ?
+ x :
+ self.scaleWidth + imgLeft - x <= width ?
+ x + width - self.scaleWidth :
+ imgLeft;
+
+ self.imgTop = imgTop >= y ?
+ y :
+ self.scaleHeight + imgTop - y <= height ?
+ y + height - self.scaleHeight :
+ imgTop;
+ };
+
+ /**
+ * 设置边界样式
+ * @param color 边界颜色
+ */
+ self.setBoundStyle = function(ref) {
+ if (ref === void 0) ref = {};
+ var color = ref.color;
+ if (color === void 0) color = '#04b00f';
+ var mask = ref.mask;
+ if (mask === void 0) mask = 'rgba(0, 0, 0, 0.3)';
+ var lineWidth = ref.lineWidth;
+ if (lineWidth === void 0) lineWidth = 1;
+
+ var half = lineWidth / 2;
+ var boundOption = [{
+ start: {
+ x: x - half,
+ y: y + 10 - half
+ },
+ step1: {
+ x: x - half,
+ y: y - half
+ },
+ step2: {
+ x: x + 10 - half,
+ y: y - half
+ }
+ },
+ {
+ start: {
+ x: x - half,
+ y: y + height - 10 + half
+ },
+ step1: {
+ x: x - half,
+ y: y + height + half
+ },
+ step2: {
+ x: x + 10 - half,
+ y: y + height + half
+ }
+ },
+ {
+ start: {
+ x: x + width - 10 + half,
+ y: y - half
+ },
+ step1: {
+ x: x + width + half,
+ y: y - half
+ },
+ step2: {
+ x: x + width + half,
+ y: y + 10 - half
+ }
+ },
+ {
+ start: {
+ x: x + width + half,
+ y: y + height - 10 + half
+ },
+ step1: {
+ x: x + width + half,
+ y: y + height + half
+ },
+ step2: {
+ x: x + width - 10 + half,
+ y: y + height + half
+ }
+ }
+ ];
+
+ // 绘制半透明层
+ self.ctx.beginPath();
+ self.ctx.setFillStyle(mask);
+ self.ctx.fillRect(0, 0, x, boundHeight);
+ self.ctx.fillRect(x, 0, width, y);
+ self.ctx.fillRect(x, y + height, width, boundHeight - y - height);
+ self.ctx.fillRect(x + width, 0, boundWidth - x - width, boundHeight);
+ self.ctx.fill();
+
+ boundOption.forEach(function(op) {
+ self.ctx.beginPath();
+ self.ctx.setStrokeStyle(color);
+ self.ctx.setLineWidth(lineWidth);
+ self.ctx.moveTo(op.start.x, op.start.y);
+ self.ctx.lineTo(op.step1.x, op.step1.y);
+ self.ctx.lineTo(op.step2.x, op.step2.y);
+ self.ctx.stroke();
+ });
+ };
+ }
+
+ var version = "1.3.9";
+
+ var WeCropper = function WeCropper(params) {
+ var self = this;
+ var _default = {};
+
+ validator(self, DEFAULT);
+
+ Object.keys(DEFAULT).forEach(function(key) {
+ _default[key] = DEFAULT[key].default;
+ });
+ Object.assign(self, _default, params);
+
+ self.prepare();
+ self.attachPage();
+ self.createCtx();
+ self.observer();
+ self.cutt();
+ self.methods();
+ self.init();
+ self.update();
+
+ return self
+ };
+
+ WeCropper.prototype.init = function init() {
+ var self = this;
+ var src = self.src;
+
+ self.version = version;
+
+ typeof self.onReady === 'function' && self.onReady(self.ctx, self);
+
+ if (src) {
+ self.pushOrign(src);
+ } else {
+ self.updateCanvas();
+ }
+ setTouchState(self, false, false, false);
+
+ self.oldScale = 1;
+ self.newScale = 1;
+
+ return self
+ };
+
+ Object.assign(WeCropper.prototype, handle);
+
+ WeCropper.prototype.prepare = prepare;
+ WeCropper.prototype.observer = observer;
+ WeCropper.prototype.methods = methods;
+ WeCropper.prototype.cutt = cut;
+ WeCropper.prototype.update = update;
+
+ return WeCropper;
+
+})));
diff --git a/uview-ui/components/u-avatar/u-avatar.vue b/uview-ui/components/u-avatar/u-avatar.vue
new file mode 100644
index 0000000..289b9b0
--- /dev/null
+++ b/uview-ui/components/u-avatar/u-avatar.vue
@@ -0,0 +1,244 @@
+
+
+
+ {{uText}}
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/uview-ui/components/u-back-top/u-back-top.vue b/uview-ui/components/u-back-top/u-back-top.vue
new file mode 100644
index 0000000..7970fc7
--- /dev/null
+++ b/uview-ui/components/u-back-top/u-back-top.vue
@@ -0,0 +1,153 @@
+
+
+
+
+
+ {{tips}}
+
+
+
+
+
+
+
+
+
diff --git a/uview-ui/components/u-badge/u-badge.vue b/uview-ui/components/u-badge/u-badge.vue
new file mode 100644
index 0000000..e85b133
--- /dev/null
+++ b/uview-ui/components/u-badge/u-badge.vue
@@ -0,0 +1,216 @@
+
+
+ {{showText}}
+
+
+
+
+
+
\ No newline at end of file
diff --git a/uview-ui/components/u-button/u-button.vue b/uview-ui/components/u-button/u-button.vue
new file mode 100644
index 0000000..82c3a6f
--- /dev/null
+++ b/uview-ui/components/u-button/u-button.vue
@@ -0,0 +1,596 @@
+
+
+
+
+
+
+
+
+
+
diff --git a/uview-ui/components/u-calendar/u-calendar.vue b/uview-ui/components/u-calendar/u-calendar.vue
new file mode 100644
index 0000000..2b30184
--- /dev/null
+++ b/uview-ui/components/u-calendar/u-calendar.vue
@@ -0,0 +1,639 @@
+
+
+
+
+
+
+
+
+
+
+
+ {{ showTitle }}
+
+
+
+
+
+
+
+
+ {{item}}
+
+
+
+
+
+
+
+
+ {{ index + 1 }}
+
+ {{startText}}
+ {{endText}}
+
+ {{month}}
+
+
+
+ {{mode == 'date' ? activeDate : startDate}}
+ 至{{endDate}}
+
+
+ 确定
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/uview-ui/components/u-car-keyboard/u-car-keyboard.vue b/uview-ui/components/u-car-keyboard/u-car-keyboard.vue
new file mode 100644
index 0000000..84b1467
--- /dev/null
+++ b/uview-ui/components/u-car-keyboard/u-car-keyboard.vue
@@ -0,0 +1,257 @@
+
+ {}">
+
+
+
+
+ {{ item }}
+
+
+
+
+
+
+ 中
+ /
+ 英
+
+
+
+
+
+
+
+
+
diff --git a/uview-ui/components/u-card/u-card.vue b/uview-ui/components/u-card/u-card.vue
new file mode 100644
index 0000000..a3cb2aa
--- /dev/null
+++ b/uview-ui/components/u-card/u-card.vue
@@ -0,0 +1,299 @@
+
+
+
+
+
+
+
+ {{ title }}
+
+
+
+
+ {{ subTitle }}
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/uview-ui/components/u-cell-group/u-cell-group.vue b/uview-ui/components/u-cell-group/u-cell-group.vue
new file mode 100644
index 0000000..3fbca72
--- /dev/null
+++ b/uview-ui/components/u-cell-group/u-cell-group.vue
@@ -0,0 +1,70 @@
+
+
+
+ {{title}}
+
+
+
+
+
+
+
+
+
+
diff --git a/uview-ui/components/u-cell-item/u-cell-item.vue b/uview-ui/components/u-cell-item/u-cell-item.vue
new file mode 100644
index 0000000..055af3a
--- /dev/null
+++ b/uview-ui/components/u-cell-item/u-cell-item.vue
@@ -0,0 +1,316 @@
+
+
+
+
+
+
+
+ {{ title }}
+
+
+
+ {{ label }}
+
+
+
+
+
+ {{ value }}
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/uview-ui/components/u-checkbox-group/u-checkbox-group.vue b/uview-ui/components/u-checkbox-group/u-checkbox-group.vue
new file mode 100644
index 0000000..6a149b3
--- /dev/null
+++ b/uview-ui/components/u-checkbox-group/u-checkbox-group.vue
@@ -0,0 +1,123 @@
+
+
+
+
+
+
+
+
+
diff --git a/uview-ui/components/u-checkbox/u-checkbox.vue b/uview-ui/components/u-checkbox/u-checkbox.vue
new file mode 100644
index 0000000..9414461
--- /dev/null
+++ b/uview-ui/components/u-checkbox/u-checkbox.vue
@@ -0,0 +1,284 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/uview-ui/components/u-circle-progress/u-circle-progress.vue b/uview-ui/components/u-circle-progress/u-circle-progress.vue
new file mode 100644
index 0000000..46e7c18
--- /dev/null
+++ b/uview-ui/components/u-circle-progress/u-circle-progress.vue
@@ -0,0 +1,220 @@
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/uview-ui/components/u-circle-progress/u-line-progress/u-line-progress.vue b/uview-ui/components/u-circle-progress/u-line-progress/u-line-progress.vue
new file mode 100644
index 0000000..77e2da2
--- /dev/null
+++ b/uview-ui/components/u-circle-progress/u-line-progress/u-line-progress.vue
@@ -0,0 +1,147 @@
+
+
+
+
+
+ {{percent + '%'}}
+
+
+
+
+
+
+
+
diff --git a/uview-ui/components/u-col/u-col.vue b/uview-ui/components/u-col/u-col.vue
new file mode 100644
index 0000000..3b6cc64
--- /dev/null
+++ b/uview-ui/components/u-col/u-col.vue
@@ -0,0 +1,156 @@
+
+
+
+
+
+
+
+
+
diff --git a/uview-ui/components/u-collapse-item/u-collapse-item.vue b/uview-ui/components/u-collapse-item/u-collapse-item.vue
new file mode 100644
index 0000000..3b66bfa
--- /dev/null
+++ b/uview-ui/components/u-collapse-item/u-collapse-item.vue
@@ -0,0 +1,204 @@
+
+
+
+
+
+ {{ title }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/uview-ui/components/u-collapse/u-collapse.vue b/uview-ui/components/u-collapse/u-collapse.vue
new file mode 100644
index 0000000..8572957
--- /dev/null
+++ b/uview-ui/components/u-collapse/u-collapse.vue
@@ -0,0 +1,99 @@
+
+
+
+
+
+
+
+
+
diff --git a/uview-ui/components/u-column-notice/u-column-notice.vue b/uview-ui/components/u-column-notice/u-column-notice.vue
new file mode 100644
index 0000000..dd8bd31
--- /dev/null
+++ b/uview-ui/components/u-column-notice/u-column-notice.vue
@@ -0,0 +1,237 @@
+
+
+
+
+
+
+
+
+ {{ item }}
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/uview-ui/components/u-count-down/u-count-down.vue b/uview-ui/components/u-count-down/u-count-down.vue
new file mode 100644
index 0000000..7285d67
--- /dev/null
+++ b/uview-ui/components/u-count-down/u-count-down.vue
@@ -0,0 +1,318 @@
+
+
+
+
+ {{ d }}
+
+
+
+ {{ separator == 'colon' ? ':' : '天' }}
+
+
+
+ {{ h }}
+
+
+
+ {{ separator == 'colon' ? ':' : '时' }}
+
+
+
+ {{ i }}
+
+
+
+ {{ separator == 'colon' ? ':' : '分' }}
+
+
+
+ {{ s }}
+
+
+
+ 秒
+
+
+
+
+
+
+
diff --git a/uview-ui/components/u-count-to/u-count-to.vue b/uview-ui/components/u-count-to/u-count-to.vue
new file mode 100644
index 0000000..053dc5f
--- /dev/null
+++ b/uview-ui/components/u-count-to/u-count-to.vue
@@ -0,0 +1,241 @@
+
+
+ {{ displayValue }}
+
+
+
+
+
+
diff --git a/uview-ui/components/u-divider/u-divider.vue b/uview-ui/components/u-divider/u-divider.vue
new file mode 100644
index 0000000..6f8d7e6
--- /dev/null
+++ b/uview-ui/components/u-divider/u-divider.vue
@@ -0,0 +1,153 @@
+
+
+
+
+
+
+
+
+
+
+
diff --git a/uview-ui/components/u-dropdown-item/u-dropdown-item.vue b/uview-ui/components/u-dropdown-item/u-dropdown-item.vue
new file mode 100644
index 0000000..ba60d8f
--- /dev/null
+++ b/uview-ui/components/u-dropdown-item/u-dropdown-item.vue
@@ -0,0 +1,132 @@
+
+ {}" @tap.stop.prevent="() => {}">
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/uview-ui/components/u-dropdown/u-dropdown.vue b/uview-ui/components/u-dropdown/u-dropdown.vue
new file mode 100644
index 0000000..a62e469
--- /dev/null
+++ b/uview-ui/components/u-dropdown/u-dropdown.vue
@@ -0,0 +1,298 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/uview-ui/components/u-empty/u-empty.vue b/uview-ui/components/u-empty/u-empty.vue
new file mode 100644
index 0000000..2c77b24
--- /dev/null
+++ b/uview-ui/components/u-empty/u-empty.vue
@@ -0,0 +1,193 @@
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/uview-ui/components/u-field/u-field.vue b/uview-ui/components/u-field/u-field.vue
new file mode 100644
index 0000000..b562798
--- /dev/null
+++ b/uview-ui/components/u-field/u-field.vue
@@ -0,0 +1,384 @@
+
+
+
+
+
+
+
+
+ {{ label }}
+
+
+
+
+
+
+
+
+
+
+
+ {{ errorMessage }}
+
+
+
+
+
+
diff --git a/uview-ui/components/u-form-item/u-form-item.vue b/uview-ui/components/u-form-item/u-form-item.vue
new file mode 100644
index 0000000..d6b8c8b
--- /dev/null
+++ b/uview-ui/components/u-form-item/u-form-item.vue
@@ -0,0 +1,431 @@
+
+
+
+
+
+
+
+
+ *
+
+
+
+
+ {{label}}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{validateMessage}}
+
+
+
+
+
+
diff --git a/uview-ui/components/u-form/u-form.vue b/uview-ui/components/u-form/u-form.vue
new file mode 100644
index 0000000..bdbafaf
--- /dev/null
+++ b/uview-ui/components/u-form/u-form.vue
@@ -0,0 +1,134 @@
+
+
+
+
+
+
+
diff --git a/uview-ui/components/u-full-screen/u-full-screen.vue b/uview-ui/components/u-full-screen/u-full-screen.vue
new file mode 100644
index 0000000..4f7e7d9
--- /dev/null
+++ b/uview-ui/components/u-full-screen/u-full-screen.vue
@@ -0,0 +1,52 @@
+
+
+
+
+
+
+
+
+
+
+
diff --git a/uview-ui/components/u-gap/u-gap.vue b/uview-ui/components/u-gap/u-gap.vue
new file mode 100644
index 0000000..6c01f94
--- /dev/null
+++ b/uview-ui/components/u-gap/u-gap.vue
@@ -0,0 +1,54 @@
+
+
+
+
+
+
+
diff --git a/uview-ui/components/u-grid-item/u-grid-item.vue b/uview-ui/components/u-grid-item/u-grid-item.vue
new file mode 100644
index 0000000..0773307
--- /dev/null
+++ b/uview-ui/components/u-grid-item/u-grid-item.vue
@@ -0,0 +1,126 @@
+
+
+
+
+
+
+
+
+
+
+
diff --git a/uview-ui/components/u-grid/u-grid.vue b/uview-ui/components/u-grid/u-grid.vue
new file mode 100644
index 0000000..6588c06
--- /dev/null
+++ b/uview-ui/components/u-grid/u-grid.vue
@@ -0,0 +1,108 @@
+
+
+
+
+
+
+
diff --git a/uview-ui/components/u-icon/u-icon.vue b/uview-ui/components/u-icon/u-icon.vue
new file mode 100644
index 0000000..db1b019
--- /dev/null
+++ b/uview-ui/components/u-icon/u-icon.vue
@@ -0,0 +1,336 @@
+
+
+
+
+
+
+
+
+ {{ label }}
+
+
+
+
+
+
+
diff --git a/uview-ui/components/u-image/u-image.vue b/uview-ui/components/u-image/u-image.vue
new file mode 100644
index 0000000..c729c3c
--- /dev/null
+++ b/uview-ui/components/u-image/u-image.vue
@@ -0,0 +1,267 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/uview-ui/components/u-index-anchor/u-index-anchor.vue b/uview-ui/components/u-index-anchor/u-index-anchor.vue
new file mode 100644
index 0000000..5038827
--- /dev/null
+++ b/uview-ui/components/u-index-anchor/u-index-anchor.vue
@@ -0,0 +1,89 @@
+
+
+
+
+
+
+
+ {{ index }}
+
+
+
+
+
+
+
+
+
diff --git a/uview-ui/components/u-index-list/u-index-list.vue b/uview-ui/components/u-index-list/u-index-list.vue
new file mode 100644
index 0000000..30fcda0
--- /dev/null
+++ b/uview-ui/components/u-index-list/u-index-list.vue
@@ -0,0 +1,315 @@
+
+
+
+
+
+
+
+ {{indexList[touchmoveIndex]}}
+
+
+
+
+
+
+
+
diff --git a/uview-ui/components/u-input/u-input.vue b/uview-ui/components/u-input/u-input.vue
new file mode 100644
index 0000000..f2aea72
--- /dev/null
+++ b/uview-ui/components/u-input/u-input.vue
@@ -0,0 +1,387 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/uview-ui/components/u-keyboard/u-keyboard.vue b/uview-ui/components/u-keyboard/u-keyboard.vue
new file mode 100644
index 0000000..1904a2b
--- /dev/null
+++ b/uview-ui/components/u-keyboard/u-keyboard.vue
@@ -0,0 +1,217 @@
+
+
+
+
+
+ {{cancelBtn ? cancelText : ''}}
+
+
+ {{tips ? tips : mode == 'number' ? '数字键盘' : mode == 'card' ? '身份证键盘' : '车牌号键盘'}}
+
+
+ {{confirmBtn ? confirmText : ''}}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/uview-ui/components/u-lazy-load/u-lazy-load.vue b/uview-ui/components/u-lazy-load/u-lazy-load.vue
new file mode 100644
index 0000000..429a680
--- /dev/null
+++ b/uview-ui/components/u-lazy-load/u-lazy-load.vue
@@ -0,0 +1,244 @@
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/uview-ui/components/u-line-progress/u-line-progress.vue b/uview-ui/components/u-line-progress/u-line-progress.vue
new file mode 100644
index 0000000..77e2da2
--- /dev/null
+++ b/uview-ui/components/u-line-progress/u-line-progress.vue
@@ -0,0 +1,147 @@
+
+
+
+
+
+ {{percent + '%'}}
+
+
+
+
+
+
+
+
diff --git a/uview-ui/components/u-line/u-line.vue b/uview-ui/components/u-line/u-line.vue
new file mode 100644
index 0000000..c56fbc3
--- /dev/null
+++ b/uview-ui/components/u-line/u-line.vue
@@ -0,0 +1,84 @@
+
+
+
+
+
+
+
+
+
diff --git a/uview-ui/components/u-link/u-link.vue b/uview-ui/components/u-link/u-link.vue
new file mode 100644
index 0000000..2dd2a73
--- /dev/null
+++ b/uview-ui/components/u-link/u-link.vue
@@ -0,0 +1,89 @@
+
+
+
+
+
+
+
+
+
diff --git a/uview-ui/components/u-loading-page/u-loading-page.vue b/uview-ui/components/u-loading-page/u-loading-page.vue
new file mode 100644
index 0000000..7e04401
--- /dev/null
+++ b/uview-ui/components/u-loading-page/u-loading-page.vue
@@ -0,0 +1,25 @@
+
+
+
+
+
+
+
+
+
diff --git a/uview-ui/components/u-loading/u-loading.vue b/uview-ui/components/u-loading/u-loading.vue
new file mode 100644
index 0000000..c747f64
--- /dev/null
+++ b/uview-ui/components/u-loading/u-loading.vue
@@ -0,0 +1,103 @@
+
+
+
+
+
+
+
+
diff --git a/uview-ui/components/u-loadmore/u-loadmore.vue b/uview-ui/components/u-loadmore/u-loadmore.vue
new file mode 100644
index 0000000..6b852a8
--- /dev/null
+++ b/uview-ui/components/u-loadmore/u-loadmore.vue
@@ -0,0 +1,203 @@
+
+
+
+
+
+
+
+
+
+
+ {{ showText }}
+
+
+
+
+
+
+
+
+
diff --git a/uview-ui/components/u-mask/u-mask.vue b/uview-ui/components/u-mask/u-mask.vue
new file mode 100644
index 0000000..0b55d9d
--- /dev/null
+++ b/uview-ui/components/u-mask/u-mask.vue
@@ -0,0 +1,123 @@
+
+ {}" :class="{
+ 'u-mask-zoom': zoom,
+ 'u-mask-show': show
+ }">
+
+
+
+
+
+
+
diff --git a/uview-ui/components/u-message-input/u-message-input.vue b/uview-ui/components/u-message-input/u-message-input.vue
new file mode 100644
index 0000000..41e0719
--- /dev/null
+++ b/uview-ui/components/u-message-input/u-message-input.vue
@@ -0,0 +1,311 @@
+
+
+
+
+
+
+
+
+
+ {{ charArr[index] ? charArr[index] : ''}}
+
+ {{ charArr[index] ? '●' : ''}}
+
+
+
+
+
+
+
+
+
+
diff --git a/uview-ui/components/u-modal/u-modal.vue b/uview-ui/components/u-modal/u-modal.vue
new file mode 100644
index 0000000..ce58113
--- /dev/null
+++ b/uview-ui/components/u-modal/u-modal.vue
@@ -0,0 +1,283 @@
+
+
+
+
+ {{ title }}
+
+
+
+
+ {{ content }}
+
+
+
+
+
+
+
+
+
+
diff --git a/uview-ui/components/u-navbar/u-navbar.vue b/uview-ui/components/u-navbar/u-navbar.vue
new file mode 100644
index 0000000..450242e
--- /dev/null
+++ b/uview-ui/components/u-navbar/u-navbar.vue
@@ -0,0 +1,315 @@
+
+
+
+
+
+
+
+
+
+ {{ backText }}
+
+
+
+ {{ title }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/uview-ui/components/u-no-network/u-no-network.vue b/uview-ui/components/u-no-network/u-no-network.vue
new file mode 100644
index 0000000..51d9f4f
--- /dev/null
+++ b/uview-ui/components/u-no-network/u-no-network.vue
@@ -0,0 +1,233 @@
+
+ {}">
+
+
+
+ {{tips}}
+
+
+
+
+ 请检查网络,或前往设置
+
+
+
+ 重试
+
+
+
+
+
+
+
+
diff --git a/uview-ui/components/u-notice-bar/u-notice-bar.vue b/uview-ui/components/u-notice-bar/u-notice-bar.vue
new file mode 100644
index 0000000..41a6cc4
--- /dev/null
+++ b/uview-ui/components/u-notice-bar/u-notice-bar.vue
@@ -0,0 +1,272 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/uview-ui/components/u-number-box/u-number-box.vue b/uview-ui/components/u-number-box/u-number-box.vue
new file mode 100644
index 0000000..54a679e
--- /dev/null
+++ b/uview-ui/components/u-number-box/u-number-box.vue
@@ -0,0 +1,363 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/uview-ui/components/u-number-keyboard/u-number-keyboard.vue b/uview-ui/components/u-number-keyboard/u-number-keyboard.vue
new file mode 100644
index 0000000..6425a1f
--- /dev/null
+++ b/uview-ui/components/u-number-keyboard/u-number-keyboard.vue
@@ -0,0 +1,158 @@
+
+ {}">
+
+
+ {{ item }}
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/uview-ui/components/u-parse/libs/CssHandler.js b/uview-ui/components/u-parse/libs/CssHandler.js
new file mode 100644
index 0000000..75c6015
--- /dev/null
+++ b/uview-ui/components/u-parse/libs/CssHandler.js
@@ -0,0 +1,100 @@
+const cfg = require('./config.js'),
+ isLetter = c => (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z');
+
+function CssHandler(tagStyle) {
+ var styles = Object.assign(Object.create(null), cfg.userAgentStyles);
+ for (var item in tagStyle)
+ styles[item] = (styles[item] ? styles[item] + ';' : '') + tagStyle[item];
+ this.styles = styles;
+}
+CssHandler.prototype.getStyle = function(data) {
+ this.styles = new parser(data, this.styles).parse();
+}
+CssHandler.prototype.match = function(name, attrs) {
+ var tmp, matched = (tmp = this.styles[name]) ? tmp + ';' : '';
+ if (attrs.class) {
+ var items = attrs.class.split(' ');
+ for (var i = 0, item; item = items[i]; i++)
+ if (tmp = this.styles['.' + item])
+ matched += tmp + ';';
+ }
+ if (tmp = this.styles['#' + attrs.id])
+ matched += tmp + ';';
+ return matched;
+}
+module.exports = CssHandler;
+
+function parser(data, init) {
+ this.data = data;
+ this.floor = 0;
+ this.i = 0;
+ this.list = [];
+ this.res = init;
+ this.state = this.Space;
+}
+parser.prototype.parse = function() {
+ for (var c; c = this.data[this.i]; this.i++)
+ this.state(c);
+ return this.res;
+}
+parser.prototype.section = function() {
+ return this.data.substring(this.start, this.i);
+}
+// 状态机
+parser.prototype.Space = function(c) {
+ if (c == '.' || c == '#' || isLetter(c)) {
+ this.start = this.i;
+ this.state = this.Name;
+ } else if (c == '/' && this.data[this.i + 1] == '*')
+ this.Comment();
+ else if (!cfg.blankChar[c] && c != ';')
+ this.state = this.Ignore;
+}
+parser.prototype.Comment = function() {
+ this.i = this.data.indexOf('*/', this.i) + 1;
+ if (!this.i) this.i = this.data.length;
+ this.state = this.Space;
+}
+parser.prototype.Ignore = function(c) {
+ if (c == '{') this.floor++;
+ else if (c == '}' && !--this.floor) {
+ this.list = [];
+ this.state = this.Space;
+ }
+}
+parser.prototype.Name = function(c) {
+ if (cfg.blankChar[c]) {
+ this.list.push(this.section());
+ this.state = this.NameSpace;
+ } else if (c == '{') {
+ this.list.push(this.section());
+ this.Content();
+ } else if (c == ',') {
+ this.list.push(this.section());
+ this.Comma();
+ } else if (!isLetter(c) && (c < '0' || c > '9') && c != '-' && c != '_')
+ this.state = this.Ignore;
+}
+parser.prototype.NameSpace = function(c) {
+ if (c == '{') this.Content();
+ else if (c == ',') this.Comma();
+ else if (!cfg.blankChar[c]) this.state = this.Ignore;
+}
+parser.prototype.Comma = function() {
+ while (cfg.blankChar[this.data[++this.i]]);
+ if (this.data[this.i] == '{') this.Content();
+ else {
+ this.start = this.i--;
+ this.state = this.Name;
+ }
+}
+parser.prototype.Content = function() {
+ this.start = ++this.i;
+ if ((this.i = this.data.indexOf('}', this.i)) == -1) this.i = this.data.length;
+ var content = this.section();
+ for (var i = 0, item; item = this.list[i++];)
+ if (this.res[item]) this.res[item] += ';' + content;
+ else this.res[item] = content;
+ this.list = [];
+ this.state = this.Space;
+}
diff --git a/uview-ui/components/u-parse/libs/MpHtmlParser.js b/uview-ui/components/u-parse/libs/MpHtmlParser.js
new file mode 100644
index 0000000..aeb0fc3
--- /dev/null
+++ b/uview-ui/components/u-parse/libs/MpHtmlParser.js
@@ -0,0 +1,580 @@
+/**
+ * html 解析器
+ * @tutorial https://github.com/jin-yufeng/Parser
+ * @version 20201029
+ * @author JinYufeng
+ * @listens MIT
+ */
+const cfg = require('./config.js'),
+ blankChar = cfg.blankChar,
+ CssHandler = require('./CssHandler.js'),
+ windowWidth = uni.getSystemInfoSync().windowWidth;
+var emoji;
+
+function MpHtmlParser(data, options = {}) {
+ this.attrs = {};
+ this.CssHandler = new CssHandler(options.tagStyle, windowWidth);
+ this.data = data;
+ this.domain = options.domain;
+ this.DOM = [];
+ this.i = this.start = this.audioNum = this.imgNum = this.videoNum = 0;
+ options.prot = (this.domain || '').includes('://') ? this.domain.split('://')[0] : 'http';
+ this.options = options;
+ this.state = this.Text;
+ this.STACK = [];
+ // 工具函数
+ this.bubble = () => {
+ for (var i = this.STACK.length, item; item = this.STACK[--i];) {
+ if (cfg.richOnlyTags[item.name]) return false;
+ item.c = 1;
+ }
+ return true;
+ }
+ this.decode = (val, amp) => {
+ var i = -1,
+ j, en;
+ while (1) {
+ if ((i = val.indexOf('&', i + 1)) == -1) break;
+ if ((j = val.indexOf(';', i + 2)) == -1) break;
+ if (val[i + 1] == '#') {
+ en = parseInt((val[i + 2] == 'x' ? '0' : '') + val.substring(i + 2, j));
+ if (!isNaN(en)) val = val.substr(0, i) + String.fromCharCode(en) + val.substr(j + 1);
+ } else {
+ en = val.substring(i + 1, j);
+ if (cfg.entities[en] || en == amp)
+ val = val.substr(0, i) + (cfg.entities[en] || '&') + val.substr(j + 1);
+ }
+ }
+ return val;
+ }
+ this.getUrl = url => {
+ if (url[0] == '/') {
+ if (url[1] == '/') url = this.options.prot + ':' + url;
+ else if (this.domain) url = this.domain + url;
+ } else if (this.domain && url.indexOf('data:') != 0 && !url.includes('://'))
+ url = this.domain + '/' + url;
+ return url;
+ }
+ this.isClose = () => this.data[this.i] == '>' || (this.data[this.i] == '/' && this.data[this.i + 1] == '>');
+ this.section = () => this.data.substring(this.start, this.i);
+ this.parent = () => this.STACK[this.STACK.length - 1];
+ this.siblings = () => this.STACK.length ? this.parent().children : this.DOM;
+}
+MpHtmlParser.prototype.parse = function() {
+ if (emoji) this.data = emoji.parseEmoji(this.data);
+ for (var c; c = this.data[this.i]; this.i++)
+ this.state(c);
+ if (this.state == this.Text) this.setText();
+ while (this.STACK.length) this.popNode(this.STACK.pop());
+ return this.DOM;
+}
+// 设置属性
+MpHtmlParser.prototype.setAttr = function() {
+ var name = this.attrName.toLowerCase(),
+ val = this.attrVal;
+ if (cfg.boolAttrs[name]) this.attrs[name] = 'T';
+ else if (val) {
+ if (name == 'src' || (name == 'data-src' && !this.attrs.src)) this.attrs.src = this.getUrl(this.decode(val, 'amp'));
+ else if (name == 'href' || name == 'style') this.attrs[name] = this.decode(val, 'amp');
+ else if (name.substr(0, 5) != 'data-') this.attrs[name] = val;
+ }
+ this.attrVal = '';
+ while (blankChar[this.data[this.i]]) this.i++;
+ if (this.isClose()) this.setNode();
+ else {
+ this.start = this.i;
+ this.state = this.AttrName;
+ }
+}
+// 设置文本节点
+MpHtmlParser.prototype.setText = function() {
+ var back, text = this.section();
+ if (!text) return;
+ text = (cfg.onText && cfg.onText(text, () => back = true)) || text;
+ if (back) {
+ this.data = this.data.substr(0, this.start) + text + this.data.substr(this.i);
+ let j = this.start + text.length;
+ for (this.i = this.start; this.i < j; this.i++) this.state(this.data[this.i]);
+ return;
+ }
+ if (!this.pre) {
+ // 合并空白符
+ var flag, tmp = [];
+ for (let i = text.length, c; c = text[--i];)
+ if (!blankChar[c]) {
+ tmp.unshift(c);
+ if (!flag) flag = 1;
+ } else {
+ if (tmp[0] != ' ') tmp.unshift(' ');
+ if (c == '\n' && flag == void 0) flag = 0;
+ }
+ if (flag == 0) return;
+ text = tmp.join('');
+ }
+ this.siblings().push({
+ type: 'text',
+ text: this.decode(text)
+ });
+}
+// 设置元素节点
+MpHtmlParser.prototype.setNode = function() {
+ var node = {
+ name: this.tagName.toLowerCase(),
+ attrs: this.attrs
+ },
+ close = cfg.selfClosingTags[node.name];
+ if (this.options.nodes.length) node.type = 'node';
+ this.attrs = {};
+ if (!cfg.ignoreTags[node.name]) {
+ // 处理属性
+ var attrs = node.attrs,
+ style = this.CssHandler.match(node.name, attrs, node) + (attrs.style || ''),
+ styleObj = {};
+ if (attrs.id) {
+ if (this.options.compress & 1) attrs.id = void 0;
+ else if (this.options.useAnchor) this.bubble();
+ }
+ if ((this.options.compress & 2) && attrs.class) attrs.class = void 0;
+ switch (node.name) {
+ case 'a':
+ case 'ad': // #ifdef APP-PLUS
+ case 'iframe':
+ // #endif
+ this.bubble();
+ break;
+ case 'font':
+ if (attrs.color) {
+ styleObj['color'] = attrs.color;
+ attrs.color = void 0;
+ }
+ if (attrs.face) {
+ styleObj['font-family'] = attrs.face;
+ attrs.face = void 0;
+ }
+ if (attrs.size) {
+ var size = parseInt(attrs.size);
+ if (size < 1) size = 1;
+ else if (size > 7) size = 7;
+ var map = ['xx-small', 'x-small', 'small', 'medium', 'large', 'x-large', 'xx-large'];
+ styleObj['font-size'] = map[size - 1];
+ attrs.size = void 0;
+ }
+ break;
+ case 'embed':
+ // #ifndef APP-PLUS
+ var src = node.attrs.src || '',
+ type = node.attrs.type || '';
+ if (type.includes('video') || src.includes('.mp4') || src.includes('.3gp') || src.includes('.m3u8'))
+ node.name = 'video';
+ else if (type.includes('audio') || src.includes('.m4a') || src.includes('.wav') || src.includes('.mp3') || src.includes(
+ '.aac'))
+ node.name = 'audio';
+ else break;
+ if (node.attrs.autostart)
+ node.attrs.autoplay = 'T';
+ node.attrs.controls = 'T';
+ // #endif
+ // #ifdef APP-PLUS
+ this.bubble();
+ break;
+ // #endif
+ case 'video':
+ case 'audio':
+ if (!attrs.id) attrs.id = node.name + (++this[`${node.name}Num`]);
+ else this[`${node.name}Num`]++;
+ if (node.name == 'video') {
+ if (this.videoNum > 3)
+ node.lazyLoad = 1;
+ if (attrs.width) {
+ styleObj.width = parseFloat(attrs.width) + (attrs.width.includes('%') ? '%' : 'px');
+ attrs.width = void 0;
+ }
+ if (attrs.height) {
+ styleObj.height = parseFloat(attrs.height) + (attrs.height.includes('%') ? '%' : 'px');
+ attrs.height = void 0;
+ }
+ }
+ if (!attrs.controls && !attrs.autoplay) attrs.controls = 'T';
+ attrs.source = [];
+ if (attrs.src) {
+ attrs.source.push(attrs.src);
+ attrs.src = void 0;
+ }
+ this.bubble();
+ break;
+ case 'td':
+ case 'th':
+ if (attrs.colspan || attrs.rowspan)
+ for (var k = this.STACK.length, item; item = this.STACK[--k];)
+ if (item.name == 'table') {
+ item.flag = 1;
+ break;
+ }
+ }
+ if (attrs.align) {
+ if (node.name == 'table') {
+ if (attrs.align == 'center') styleObj['margin-inline-start'] = styleObj['margin-inline-end'] = 'auto';
+ else styleObj['float'] = attrs.align;
+ } else styleObj['text-align'] = attrs.align;
+ attrs.align = void 0;
+ }
+ // 压缩 style
+ var styles = style.split(';');
+ style = '';
+ for (var i = 0, len = styles.length; i < len; i++) {
+ var info = styles[i].split(':');
+ if (info.length < 2) continue;
+ let key = info[0].trim().toLowerCase(),
+ value = info.slice(1).join(':').trim();
+ if (value[0] == '-' || value.includes('safe'))
+ style += `;${key}:${value}`;
+ else if (!styleObj[key] || value.includes('import') || !styleObj[key].includes('import'))
+ styleObj[key] = value;
+ }
+ if (node.name == 'img') {
+ if (attrs.src && !attrs.ignore) {
+ if (this.bubble())
+ attrs.i = (this.imgNum++).toString();
+ else attrs.ignore = 'T';
+ }
+ if (attrs.ignore) {
+ style += ';-webkit-touch-callout:none';
+ styleObj['max-width'] = '100%';
+ }
+ var width;
+ if (styleObj.width) width = styleObj.width;
+ else if (attrs.width) width = attrs.width.includes('%') ? attrs.width : parseFloat(attrs.width) + 'px';
+ if (width) {
+ styleObj.width = width;
+ attrs.width = '100%';
+ if (parseInt(width) > windowWidth) {
+ styleObj.height = '';
+ if (attrs.height) attrs.height = void 0;
+ }
+ }
+ if (styleObj.height) {
+ attrs.height = styleObj.height;
+ styleObj.height = '';
+ } else if (attrs.height && !attrs.height.includes('%'))
+ attrs.height = parseFloat(attrs.height) + 'px';
+ }
+ for (var key in styleObj) {
+ var value = styleObj[key];
+ if (!value) continue;
+ if (key.includes('flex') || key == 'order' || key == 'self-align') node.c = 1;
+ // 填充链接
+ if (value.includes('url')) {
+ var j = value.indexOf('(');
+ if (j++ != -1) {
+ while (value[j] == '"' || value[j] == "'" || blankChar[value[j]]) j++;
+ value = value.substr(0, j) + this.getUrl(value.substr(j));
+ }
+ }
+ // 转换 rpx
+ else if (value.includes('rpx'))
+ value = value.replace(/[0-9.]+\s*rpx/g, $ => parseFloat($) * windowWidth / 750 + 'px');
+ else if (key == 'white-space' && value.includes('pre') && !close)
+ this.pre = node.pre = true;
+ style += `;${key}:${value}`;
+ }
+ style = style.substr(1);
+ if (style) attrs.style = style;
+ if (!close) {
+ node.children = [];
+ if (node.name == 'pre' && cfg.highlight) {
+ this.remove(node);
+ this.pre = node.pre = true;
+ }
+ this.siblings().push(node);
+ this.STACK.push(node);
+ } else if (!cfg.filter || cfg.filter(node, this) != false)
+ this.siblings().push(node);
+ } else {
+ if (!close) this.remove(node);
+ else if (node.name == 'source') {
+ var parent = this.parent();
+ if (parent && (parent.name == 'video' || parent.name == 'audio') && node.attrs.src)
+ parent.attrs.source.push(node.attrs.src);
+ } else if (node.name == 'base' && !this.domain) this.domain = node.attrs.href;
+ }
+ if (this.data[this.i] == '/') this.i++;
+ this.start = this.i + 1;
+ this.state = this.Text;
+}
+// 移除标签
+MpHtmlParser.prototype.remove = function(node) {
+ var name = node.name,
+ j = this.i;
+ // 处理 svg
+ var handleSvg = () => {
+ var src = this.data.substring(j, this.i + 1);
+ node.attrs.xmlns = 'http://www.w3.org/2000/svg';
+ for (var key in node.attrs) {
+ if (key == 'viewbox') src = ` viewBox="${node.attrs.viewbox}"` + src;
+ else if (key != 'style') src = ` ${key}="${node.attrs[key]}"` + src;
+ }
+ src = '