WIN-2308041133\Administrator 7 mesiacov pred
rodič
commit
c65a6a91b7

+ 6 - 33
application/admin/lang/zh-cn/wechat/plan.php

@@ -1,37 +1,10 @@
 <?php
 
 return [
-    'User_id'         => '用户编号',
-    'Unionid'         => '微信unionid',
-    'Openid'          => '微信openid',
-    'Routine_openid'  => '微信小程序openid',
-    'Nickname'        => '用户的昵称',
-    'Headimgurl'      => '用户头像',
-    'Sex'             => '性别',
-    'Sex 1'           => '男性',
-    'Sex 2'           => '女性',
-    'Sex 0'           => '未知',
-    'City'            => '市',
-    'Language'        => '语言',
-    'Province'        => '省',
-    'Country'         => '国家',
-    'Remark'          => 'remark',
-    'Groupid'         => '用户所在的分组ID',
-    'Tagid_list'      => '标签ID列表',
-    'Subscribe'       => '订阅公众号',
-    'Subscribe 0'     => '否',
-    'Subscribe 1'     => '是',
-    'Subscribe_time'  => '关注公众号时间',
-    'Createtime'      => '创建时间',
-    'Stair'           => '一级推荐人',
-    'Second'          => '二级推荐人',
-    'Order_stair'     => '一级推荐人订单',
-    'Order_second'    => '二级推荐人订单',
-    'Brokerage_price' => '佣金',
-    'Session_key'     => '小程序用户会话密匙',
-    'User_type'       => '用户类型',
-    'User_type 0'     => 'h5',
-    'User_type 1'     => '公众号',
-    'User_type 2'     => '小程序',
-    'User_type 3'     => '通用'
+    'Cid'        => '单位编号',
+    'PlanId'    => '模板编号',
+    'Price'     => '价格',
+    'text'     => '模版介绍',
+    'Createtime' => '创建时间',
+    'Updatetime' => '更新时间'
 ];

+ 76 - 0
public/assets/js/backend/wechat/plan.js

@@ -0,0 +1,76 @@
+define(['jquery', 'bootstrap', 'backend', 'form', 'table'], function ($, undefined, Backend, Form, Table) {
+
+    var Controller = {
+        index: function () {
+            // 初始化表格参数配置
+            Table.api.init({
+                extend: {
+                    index_url: 'wechat/plan/index',
+                    add_url: 'wechat/plan/add',
+                    edit_url: 'wechat/plan/edit',
+                    del_url: 'wechat/plan/del',
+                    multi_url: 'wechat/plan/multi',
+                }
+            });
+
+            var table = $("#table");
+
+            // 初始化表格
+            table.bootstrapTable({
+                url: $.fn.bootstrapTable.defaults.extend.index_url,
+                sortName: 'id',
+                columns: [
+                    [
+                        {field: 'state', checkbox: true, },
+                        {field: 'id', title: __('Id')},
+                        {field: 'planid', title: __('PlanId')},
+                        {field: 'text', title: __('Text')},
+                        {field: 'price', title: __('price')},
+                        {field: 'createtime', title: __('Create time'), formatter: Table.api.formatter.datetime, operate: 'RANGE', addclass: 'datetimerange', sortable: true},
+                        {field: 'updatetime', title: __('Update time'), formatter: Table.api.formatter.datetime, operate: 'RANGE', addclass: 'datetimerange', sortable: true},
+                        // {field: 'status', title: __('Status'), formatter: Table.api.formatter.status},
+                        {field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate}
+                    ]
+                ]
+            });
+
+            // 为表格绑定事件
+            Table.api.bindevent(table);
+
+        },
+        add: function () {
+            Controller.api.bindevent();
+        },
+        edit: function () {
+            Controller.api.bindevent();
+        },
+        api: {
+            bindevent: function () {
+                Form.api.bindevent($("form[role=form]"));
+
+                var refreshkey = function (data) {
+                    $("input[name='row[price]']").val(data.eventkey).trigger("change");
+                    Layer.closeAll();
+                    var keytitle = data.text;
+                    var cont = $(".clickbox .create-click:first");
+                    $(".keytitle", cont).remove();
+                    if (keytitle) {
+                        cont.append('<div class="keytitle">' + __('Event key') + ':' + keytitle + '</div>');
+                    }
+                };
+                $(document).on('click', "#select-resources", function () {
+                    var key = $("input[name='row[eventkey]']").val();
+                    parent.Backend.api.open($(this).attr("href") + "?key=" + key, __('Select'), {callback: refreshkey});
+                    return false;
+                });
+
+                $(document).on('click', "#add-resources", function () {
+                    parent.Backend.api.open($(this).attr("href") + "?key=", __('Add'), {callback: refreshkey});
+                    return false;
+                });
+            }
+        }
+
+    };
+    return Controller;
+});