jufubao-base 1.0.169-beta4 → 1.0.169-beta5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jufubao-base",
3
- "version": "1.0.169-beta4",
3
+ "version": "1.0.169-beta5",
4
4
  "private": false,
5
5
  "description": "聚福宝业务组件基础插件包",
6
6
  "main": "index.js",
@@ -46,7 +46,7 @@
46
46
  this.BMap = new bmap.BMapWX({
47
47
  ak: this.ak
48
48
  })
49
- uni.getLocation({
49
+ wx.getFuzzyLocation({
50
50
  type: "gcj08",
51
51
  success: res => {
52
52
  console.log("getLocation", res);
@@ -1,13 +1,7 @@
1
1
  'use strict';
2
2
 
3
3
  /**
4
- * @description API模型
5
- * 建议:Ffff=>模块 Xxxx=>自定义名字
6
- * 获取单记录(getByIdFfffXxxx)
7
- * 获取列表记录(getByListFfffXxxx)
8
- * 添加列表记录(addFfffXxxxx)
9
- * 删除列表记录(removeFfffXxxxx|deleteFfffXxxx)
10
- * 更新列表记录(updateFfffXxxxx)
4
+ * @description 订单详情模块
11
5
  * @type {*[]}
12
6
  */
13
7
  module.exports = [
@@ -45,4 +39,15 @@ module.exports = [
45
39
  isConsole: true,
46
40
  disabled: true,
47
41
  },
42
+ {
43
+ mapFnName: 'deleteBaseOrder', //自定义方法名字(必选)
44
+ title: '删除订单',
45
+ path: '/order/v1/order/delete-main-order',
46
+ isRule: false,
47
+ data: {
48
+ main_order_id: ['id', 'Number', '必选'],
49
+ },
50
+ isConsole: true,
51
+ disabled: true,
52
+ },
48
53
  ];
@@ -22,20 +22,6 @@ export default {
22
22
  inline: false,
23
23
  notice: '前台页面展示会根据返回数据类型进行页面渲染'
24
24
  },
25
- {
26
- label: '是否需要客服电话:',
27
- ele: 'xd-radio',
28
- valueKey: 'is_hot',
29
- value: data['is_hot'] || 'N',
30
- groupKey:'content',
31
- placeholder: '请选择是否需要客服电话',
32
- multiple: false,
33
- className: 'input80',
34
- list: [
35
- { label: '是', value: 'Y' },
36
- { label: '否', value: 'N' },
37
- ]
38
- },
39
25
  {
40
26
  label: '自定义内容:',
41
27
  ele: 'xd-site-news',
@@ -260,6 +246,20 @@ export default {
260
246
  }
261
247
  },
262
248
  },
249
+ {
250
+ label: '是否需要客服电话:',
251
+ ele: 'xd-radio',
252
+ valueKey: 'is_hot',
253
+ value: data['is_hot'] || 'N',
254
+ groupKey:'content',
255
+ placeholder: '请选择是否需要客服电话',
256
+ multiple: false,
257
+ className: 'input80',
258
+ list: [
259
+ { label: '是', value: 'Y' },
260
+ { label: '否', value: 'N' },
261
+ ]
262
+ },
263
263
  {
264
264
  label: "是否展示可用门店:",
265
265
  ele: 'xd-radio',
@@ -274,6 +274,20 @@ export default {
274
274
  { label: '否', value: 'N' },
275
275
  ]
276
276
  },
277
+ {
278
+ label: "是否允许删除订单:",
279
+ ele: 'xd-radio',
280
+ valueKey: "is_show_delete_order",
281
+ value: data['is_show_delete_order'] || 'N',
282
+ groupKey:'content',
283
+ placeholder: '请选择是否允许删除订单',
284
+ multiple: false,
285
+ className: 'input80',
286
+ list: [
287
+ { label: '允许', value: 'Y' },
288
+ { label: '不允许', value: 'N' },
289
+ ]
290
+ },
277
291
  {
278
292
  label: '外填充:',
279
293
  ele: 'xd-margin-padding',
@@ -683,9 +683,8 @@
683
683
  <view v-else>
684
684
  <xd-button
685
685
  size="small"
686
- type="primary"
686
+ :type="item.type !== undefined ? item.type: 'primary'"
687
687
  radius="40rpx"
688
- :bg-color="mainColor"
689
688
  @click="handleAction(item)"
690
689
  >{{ item.text }}</xd-button>
691
690
  </view>
@@ -741,6 +740,7 @@ import { mapState } from "vuex";
741
740
  import bizMock from "./bizMock";
742
741
  import Color from "color";
743
742
 
743
+
744
744
  export default {
745
745
  name: "JfbBaseOrderDetail",
746
746
  components: {
@@ -774,6 +774,7 @@ export default {
774
774
  is_not_show_price: "",
775
775
  brandTextColor:'',
776
776
  is_show_support_shop: "",
777
+ is_show_delete_order:'N', //删除订单
777
778
 
778
779
  showPassword: false,
779
780
  dialogPassword: "",
@@ -822,6 +823,11 @@ export default {
822
823
  this.getOrderDetail();
823
824
  }
824
825
  },
826
+ is_show_delete_order(){
827
+ if (this.isPreview) {
828
+ this.getOrderDetail();
829
+ }
830
+ },
825
831
  },
826
832
  computed: {
827
833
  ...mapState(['siteInfo']),
@@ -857,8 +863,7 @@ export default {
857
863
  },
858
864
  methods: {
859
865
  onJfbLoad(options) {
860
- this.main_order_id =
861
- options.id || options.order_id || options.main_order_id;
866
+ this.main_order_id = options.id || options.order_id || options.main_order_id;
862
867
  this.getOrderDetail();
863
868
  },
864
869
 
@@ -993,6 +998,20 @@ export default {
993
998
  ).fullTime;
994
999
  res.film_show.thumb = getServiceUrl(res.film_show.thumb);
995
1000
  }
1001
+
1002
+ //增加删除订单按钮
1003
+ if(this.is_show_delete_order === 'Y') {
1004
+ let pay = (res.buttons||[]).filter(item => item.action === 'pay');
1005
+ let del = [{action:'delete', text:'删除订单', type: 'info'}];
1006
+ if(pay.length === 1) del = []
1007
+ res.buttons = del.concat(res.buttons || []).map(item=>{
1008
+ if(item.action === 'view_logistics' && !item.type) {
1009
+ item.type = 'default';
1010
+ }
1011
+ return item
1012
+ });
1013
+ }
1014
+
996
1015
  if (res.product) {
997
1016
  jfbRootExec("getBaseProductDetail", {
998
1017
  vm: this,
@@ -1011,7 +1030,8 @@ export default {
1011
1030
  .catch((err) => {
1012
1031
  console.log(err, "err");
1013
1032
  });
1014
- } else {
1033
+ }
1034
+ else {
1015
1035
  this.info = res;
1016
1036
  if (this.info.status.loading_timeout != "-1") {
1017
1037
  this.timeDown();
@@ -1051,6 +1071,7 @@ export default {
1051
1071
  this.is_border_w = getContainerPropsValue(container, "content.is_border_w", 2);
1052
1072
  this.viewStatus = getContainerPropsValue(container, "content.viewStatus", "mall");
1053
1073
  this.is_show_support_shop = getContainerPropsValue(container, "content.is_show_support_shop", "N");
1074
+ this.is_show_delete_order = 'Y'//getContainerPropsValue(container, "content.is_show_delete_order", "N");
1054
1075
  },
1055
1076
  getCountDown() {
1056
1077
  this.timer = setInterval(() => {
@@ -1135,25 +1156,15 @@ export default {
1135
1156
  },
1136
1157
  handleAction(item) {
1137
1158
  if (item.action === "view_logistics") {
1138
- // if (
1139
- // this.info.extras.first_logistics_package_id &&
1140
- // this.info.extras.logistics_count === 1
1141
- // ) {
1142
- // this.$xdUniHelper.navigateTo({
1143
- // url: `${this.logisticsPath}?package_id=${this.info.extras.first_logistics_package_id}`,
1144
- // });
1145
- // } else {
1146
- // this.$xdUniHelper.navigateTo({
1147
- // url: `${this.packageListPath}?order_id=${this.main_order_id}`,
1148
- // });
1149
- // }
1150
1159
  this.$xdUniHelper.navigateTo({
1151
1160
  url: `${this.packageListPath}?order_id=${this.main_order_id}`,
1152
1161
  });
1153
- } else {
1162
+ }
1163
+ else if(item.action === 'cancel_unpaid') {
1154
1164
  this.$xdConfirm({
1155
1165
  styles: this.styles,
1156
1166
  content: "是否取消订单",
1167
+ zIndex: 3000,
1157
1168
  success: (action) => {
1158
1169
  if (action.confirm) {
1159
1170
  jfbRootExec("cancelBaseOrder", {
@@ -1175,6 +1186,43 @@ export default {
1175
1186
  },
1176
1187
  });
1177
1188
  }
1189
+ else if(item.action === 'delete'){
1190
+ this.$xdConfirm({
1191
+ styles: this.styles,
1192
+ content: "是否要删除当前订单吗?",
1193
+ zIndex: 3000,
1194
+ success: (action) => {
1195
+ if (action.confirm) {
1196
+ this.handleDeleteOrder();
1197
+ }
1198
+ },
1199
+ });
1200
+ }
1201
+ else {
1202
+ console.error(`item.action=${item.action}, 此action不可用`)
1203
+ }
1204
+ },
1205
+
1206
+ handleDeleteOrder(){
1207
+ jfbRootExec("deleteBaseOrder", {
1208
+ vm: this,
1209
+ data: {
1210
+ main_order_id: this.main_order_id,
1211
+ },
1212
+ })
1213
+ .then((res) => {
1214
+ this.$xdAlert({
1215
+ content: "删除成功",
1216
+ time: 2000,
1217
+ zIndex: 3000,
1218
+ });
1219
+ setTimeout(()=>{
1220
+ this.$xdUniHelper.navigateBack()
1221
+ },3000)
1222
+ })
1223
+ .catch((err) => {
1224
+ console.log(err, "err");
1225
+ });
1178
1226
  },
1179
1227
 
1180
1228
  onJfbShow(options) {
@@ -95,5 +95,7 @@ module.exports = {
95
95
  "shop_address": "北京3北京西夏区城区河北省廊坊市三河市燕郊开发区燕高路西侧实验小学南侧 "
96
96
  },
97
97
  "request_id": "6178d3499b91f274"
98
- }
98
+ },
99
+ cancelBaseOrder:{"pay_order_id": "488003809474256896","request_id": "6178d3499b91f274"},
100
+ deleteBaseOrder:{"pay_order_id": "488003809474256896","request_id": "6178d3499b91f274"},
99
101
  }
@@ -1,4 +1,5 @@
1
1
  'use strict';
2
+ import CusAttr from "./CusAttr";
2
3
 
3
4
  /**
4
5
  * @description 当表单组件中有联动操作时候,使用方法进行返回
@@ -8,50 +9,36 @@ export default {
8
9
  content: (data) => {
9
10
  return [
10
11
  {
11
- label: '背景颜色:',
12
- ele: 'xd-color',
13
- valueKey: 'bgcolor',
14
- value: data.bgcolor || '',
15
- placeholder: '请输入占位框背景颜色',
16
- classNmae: 'input80',
12
+ label: '是否支持聚好兑:',
13
+ ele: 'xd-radio',
14
+ valueKey: 'isShowExchange',
15
+ value: data['isShowExchange'] || "N",
16
+ groupKey:'content',
17
17
  rules: [
18
- {
19
- required: true,
20
- message: '请输入占位框背景颜色',
21
- trigger: 'blur'
22
- },
18
+ {required: true, message: '请选择', trigger: ['blur', 'change']}
19
+ ],
20
+ list: [
21
+ {"label": "支持", "value": "Y"},
22
+ {"label": "不支持", "value": "N"},
23
23
  ]
24
24
  },
25
25
  {
26
- label: '选中路径:',
27
- ele: 'xd-select-pages-path',
28
- valueKey: 'select-pages-path',
29
- value: data['select-pages-path'] || null,
30
- setting: {
31
- router: XdBus.getParentApi('getPagesTree')
32
- },
33
- },
34
- data.bgcolor && {
35
- label: '高度:',
26
+ label: '外边间距:',
36
27
  ele: 'el-input',
37
28
  type: 'number',
38
- valueKey: 'height',
39
- value: data.height || 100,
40
- placeholder: '请输入占位框高度,单位像素,默认:10px',
41
- className: 'input80',
42
- rules: [
43
- {
44
- required: true,
45
- message: '请输入占位框高度',
46
- trigger: 'blur'
47
- },
48
- ]
49
- },
50
- {
51
- label: '', //label
52
- ele: 'slot', //package 名称
53
- slot: 'is_reference',
29
+ groupKey:'style',
30
+ valueKey: 'outSpacing',
31
+ value: data['outSpacing'] || '',
32
+ notice: '外边间距设置,单位:像素,默认值:<span style="color:red">20</span> px',
33
+ inline: false,
34
+ className: 'input60',
54
35
  },
36
+
37
+ //todo
38
+
39
+
40
+ //列表相关属性
41
+ ...CusAttr(data),
55
42
  ].filter(i=>i)
56
43
  },
57
44
  advanced: [],
@@ -0,0 +1,147 @@
1
+ <template>
2
+ <view class="content" @click="handleCinemaDetail">
3
+ <view class="title">{{item['cinema_name']}}</view>
4
+ <view class="address">{{item['address']}}</view>
5
+ <view class="bottom">
6
+ <view class="distance">
7
+ <template v-if="item['distance']">
8
+ <xd-font-icon size="26" icon="icondizhi" :color="color.SEAT"></xd-font-icon>
9
+ <text :style="{color: color.SEAT}">{{item['distance']}}</text>
10
+ </template>
11
+ </view>
12
+ <view class="btn">
13
+ <!--不展示核销类型【SELL】-->
14
+ <view
15
+ v-for="(name,index) in item['cinema_type_name']"
16
+ v-if="item['cinema_type'][index] !== 'SELL'"
17
+ :key="index"
18
+ @click.stop="handleBtn(item['cinema_type'][index])"
19
+ :style="{
20
+ backgroundColor:color[item['cinema_type'][index]],
21
+ color:'#fff'
22
+ }">{{name}}</view>
23
+ </view>
24
+ </view>
25
+ </view>
26
+ </template>
27
+
28
+ <script>
29
+ import XdButton from "@/components/XdButton/XdButton.vue";
30
+ import XdFontIcon from "@/components/XdFontIcon/XdFontIcon.vue";
31
+
32
+ export default {
33
+ name:'ContentCinema',
34
+ components:{
35
+ XdButton,
36
+ XdFontIcon
37
+ },
38
+ props:{
39
+ item:Object,
40
+ color: {
41
+ type: Object,
42
+ default: {}
43
+ },
44
+
45
+ },
46
+ data(){
47
+ return {
48
+
49
+ }
50
+ },
51
+ created() {
52
+
53
+ },
54
+ methods:{
55
+ handleCinemaDetail(){
56
+ //优先在线选座
57
+ if(this.item['cinema_type'].includes('SEAT')) {
58
+ this.handleSchedule();
59
+ return
60
+ }
61
+ if(this.item['cinema_type'].includes('CODE')) {
62
+ this.handleCodeDetail();
63
+ return
64
+ }
65
+ if(this.item['cinema_type'].includes('SELL')) {
66
+ this.handleCashierDetail();
67
+ return
68
+ }
69
+ console.error(`${JSON.stringify(this.item['cinema_type'])}`)
70
+ },
71
+
72
+ handleBtn(code){
73
+ if(code === 'SEAT') this.handleSchedule();
74
+ else if(code === 'CODE') this.handleCodeDetail();
75
+ else if(code === 'SELL') this.handleCashierDetail();
76
+ else console.error(`${JSON.stringify(this.item['cinema_type'])}`)
77
+ },
78
+
79
+ //电子码
80
+ handleCodeDetail(){
81
+ console.warn(`handleCodeDetail`)
82
+ this.$emit('on-code-detail', this.item);
83
+ },
84
+ //核销
85
+ handleCashierDetail(){
86
+ console.warn(`handleCashierDetail`)
87
+ this.$emit('on-cashier-detail', this.item);
88
+ },
89
+
90
+ //选座排期
91
+ handleSchedule(){
92
+ console.warn(`handleSchedule`)
93
+ this.$emit('on-schedule', this.item);
94
+ },
95
+ }
96
+ }
97
+ </script>
98
+
99
+ <style scoped lang="less">
100
+ .content {
101
+ .title {
102
+ font-size: 32rpx;
103
+ line-height: 40rpx;
104
+ margin-bottom: 20rpx;
105
+ color: #333;
106
+ font-weight: 500;
107
+ }
108
+ .address {
109
+ font-size: 24rpx;
110
+ line-height: 30rpx;
111
+ color: #999;
112
+ margin-bottom: 15rpx;
113
+ }
114
+
115
+ .bottom {
116
+ display: flex;
117
+ justify-content: space-between;
118
+ align-items: center;
119
+ margin-top: 30rpx;
120
+
121
+ & > .distance {
122
+ display: flex;
123
+ justify-content: flex-start;
124
+ align-items: center;
125
+
126
+ & > text {
127
+ margin-left: 10rpx;
128
+ font-size: 24rpx;
129
+ }
130
+ }
131
+
132
+ & > .btn {
133
+ display: flex;
134
+ justify-content: flex-end;
135
+ align-items: center;
136
+
137
+ & > view {
138
+ margin-left: 10rpx;
139
+ padding: 0 30rpx;
140
+ line-height: 60rpx;
141
+ border-radius: 30rpx;
142
+ font-size: 26rpx;
143
+ }
144
+ }
145
+ }
146
+ }
147
+ </style>
@@ -0,0 +1,165 @@
1
+ <template>
2
+ <view class="content" @click="handleDetail(item)">
3
+ <view
4
+ class="image"
5
+ :style="{marginRight: outSpacing + 'rpx',borderRadius:borderRadius+'rpx'}"
6
+ >
7
+ <image :src="item['poster']" :alt="item['show_name']"></image>
8
+ </view>
9
+ <view class="middle">
10
+ <view class="name">{{item['show_name']}}</view>
11
+ <view class="other">类型:{{item['type']}}</view>
12
+ <view class="other">导演:{{item['director']}}</view>
13
+ <view class="other">主演:{{item['leading_role']}}</view>
14
+ </view>
15
+ <view class="right">
16
+ <view class="score">
17
+ <template v-if="item['remark']">
18
+ <text>评分:</text><text :style="{color:color}">{{item['remark']}}</text>
19
+ </template>
20
+ </view>
21
+ <view class="btn">
22
+ <template v-if="type === 'hot'">
23
+ <xd-button
24
+ v-if="item['show_button'] === '1'"
25
+ type="primary"
26
+ style="display:block;"
27
+ size="small"
28
+ @click.stop="handleBuy(item)">购票</xd-button>
29
+ <xd-button
30
+ v-else-if="item['show_button'] === '2'"
31
+ type="subPrimary"
32
+ style="display:block;"
33
+ size="small"
34
+ @click="handleBuy(item)">预售</xd-button>
35
+ </template>
36
+ <template v-if="type === 'rightnow'">
37
+ <xd-button
38
+ v-if="item['show_button'] === '3'"
39
+ type="success"
40
+ style="display:block;"
41
+ size="small"
42
+ @click.stop="handleDetail(item)"
43
+ >想看</xd-button>
44
+ <xd-button
45
+ v-else-if="item['show_button'] === '2'"
46
+ type="subPrimary"
47
+ style="display:block;"
48
+ size="small"
49
+ @click.stop="handleBuy(item)">预售</xd-button>
50
+ </template>
51
+ </view>
52
+ </view>
53
+ </view>
54
+ </template>
55
+
56
+ <script>
57
+ import XdButton from "@/components/XdButton/XdButton.vue";
58
+
59
+ export default {
60
+ name:'ContentItem',
61
+ components:{
62
+ XdButton
63
+ },
64
+ props:{
65
+ item:Object,
66
+ outSpacing: {
67
+ type: Number|String,
68
+ default: 20
69
+ },
70
+ color: {
71
+ type: String,
72
+ default: ''
73
+ },
74
+ type:{
75
+ type: String,
76
+ default: 'hot'
77
+ },
78
+ borderRadius:{
79
+ type: String,
80
+ default: '10'
81
+ }
82
+
83
+ },
84
+ created() {
85
+
86
+ },
87
+ methods:{
88
+ handleDetail(item){
89
+ console.log('handleDetail.item',item,item.id);
90
+ this.$emit('on-film-detail',item.id);
91
+ },
92
+ handleBuy(item){
93
+ console.log('handleDetail.item',item,item.id);
94
+ this.$emit('on-buy',item.id);
95
+ }
96
+ }
97
+ }
98
+ </script>
99
+
100
+ <style scoped lang="less">
101
+ .content {
102
+ display: flex;
103
+ justify-content: space-between;
104
+ align-items: center;
105
+
106
+ .image {
107
+ width: 160rpx;
108
+ height: 240rpx;
109
+ flex-shrink: 0;
110
+ overflow: hidden;
111
+
112
+ & > image {
113
+ width: 100%;
114
+ height: 100%;
115
+ }
116
+ }
117
+ .middle {
118
+ flex: 1;
119
+ & .name {
120
+ font-size: 36rpx;
121
+ font-weight: 600;
122
+ margin-bottom: 20rpx;
123
+ .uni-max-cut(2, 90);
124
+ line-height: 45rpx;
125
+ }
126
+
127
+ & .other {
128
+ font-size: 25rpx;
129
+ color: #999;
130
+ .uni-max-cut(1,36);
131
+ line-height: 36rpx;
132
+ margin-bottom: 10rpx;
133
+ &:last-child {
134
+ margin-bottom: 0!important;
135
+ }
136
+ }
137
+ }
138
+
139
+ .right {
140
+ flex-shrink: 0;
141
+ display: flex;
142
+ align-content: space-between;
143
+ align-items: flex-end;
144
+ justify-content: flex-end;
145
+ flex-flow: wrap;
146
+ height: 100%;
147
+ box-sizing: border-box;
148
+ width: 160rpx;
149
+
150
+ & .score {
151
+ height: 40rpx;
152
+ width:100%;
153
+ text-align: right;
154
+ & > text:nth-child(1) {
155
+ font-size: 20rpx;
156
+ }
157
+ & > text:nth-child(2) {
158
+ font-size: 28rpx;
159
+ }
160
+
161
+ }
162
+
163
+ }
164
+ }
165
+ </style>