people.vue 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274
  1. <template>
  2. <view class="box">
  3. <view style="height: 20rpx;"></view>
  4. <view class="line" v-for="(item,index) in list">
  5. <view class="linetop">
  6. <view class="name">{{item.CustomerName}}</view>
  7. <view class="nickNameBox">
  8. <image src="../../static/timg/icon_wechat.png" mode="" class="nickNameImg"></image>
  9. <view class="nickName">{{item.WxNickName?item.WxNickName:''}}</view>
  10. </view>
  11. </view>
  12. <view class="lineCOnt">
  13. <view class="lineline">
  14. <view class="lineContLeft">
  15. <image src="../../static/timg/icon_dianhua.png" mode="" class="lineContLeftImg"></image>
  16. <view class="lineContLeftMs">{{item.MobilePhone}}</view>
  17. </view>
  18. <view class="lineTIme">{{item.PJCreateTime}}</view>
  19. </view>
  20. </view>
  21. </view>
  22. <nodata v-if="list.length==0"></nodata>
  23. <!-- 手机号授权 -->
  24. <view class="authorizBox" v-if="authorizShow" @click="authorizShow=false">
  25. <view class="authorizCont" @click.stop="">
  26. <view class="authorizName">{{wxOpenData.miniAppName}}</view>
  27. <view class="authorizMs">您好,欢迎访问本店,授权手机号登录能获取我们最新的促销活动哦~</view>
  28. <button class="authorizContbutton" type="default" open-type="getPhoneNumber" @getphonenumber="decryptPhoneNumber">授权</button>
  29. </view>
  30. <view style="text-align: center;padding-top: 56rpx;">
  31. <image src="../../static/timg/icon_guanbi@2x.png" mode="" class="authorizCloseImg"></image>
  32. </view>
  33. </view>
  34. </view>
  35. </template>
  36. <script>
  37. import nodata from '../../components/nodata/nodata.vue'
  38. export default {
  39. components: {
  40. nodata
  41. },
  42. data() {
  43. return {
  44. list:[],
  45. themeColor:'',
  46. userInfo:'',
  47. page:1,
  48. limit:20,
  49. authorizShow:false,
  50. userInfo:'',
  51. ext:'',
  52. wxOpenData:'',
  53. }
  54. },
  55. onLoad(opt) {
  56. this.themeColor = uni.getStorageSync("themeColor");
  57. this.userInfo=this.$store.state.userInfo;
  58. this.ext=this.$common.getExtStoreId();
  59. if(this.userInfo){
  60. this.getList()
  61. }else{
  62. this.$common.automaticlogin().then(val => {
  63. this.userInfo=this.$store.state.userInfo;
  64. this.wxOpenData=this.$store.state.wxOpenData;
  65. this.themeColor = uni.getStorageSync("themeColor");
  66. if(!this.userInfo){
  67. this.authorizShow=true
  68. }
  69. this.getList()
  70. })
  71. }
  72. //this.getList()
  73. },
  74. onShow() {
  75. },
  76. methods: {
  77. getList(){
  78. uni.showLoading({
  79. title: '加载中'
  80. })
  81. this.$http('opencarInfoOwner/listPJBonusPage', {
  82. page:this.page,limit:this.limit,
  83. }, 'GET').then(res => {
  84. uni.hideLoading();
  85. console.log(res.data)
  86. var data=res.data.Items;
  87. this.list=this.list.concat(data);
  88. //this.list = res.data.Items
  89. //console.log('list+=', this.queryShopList);
  90. })
  91. },
  92. decryptPhoneNumber: function(e) {
  93. console.log(e);
  94. this.code=e.detail.code
  95. this.wxPhoneLogin()
  96. this.authorizShow=false;
  97. },
  98. wxPhoneLogin(){
  99. var that=this;
  100. this.$http('miniApp2/sys/wxPhoneLogin', {
  101. appId:this.ext.appId,
  102. unionId:this.ext.unionId,
  103. code:this.code,
  104. openId:this.wxOpenData.openid
  105. },'POST').then(res => {
  106. var data = res.data;
  107. if(data.newCustomer){
  108. uni.showModal({
  109. title: '提示',
  110. content: data.newCustomerMsg,
  111. success: function(resTK) {
  112. }
  113. });
  114. var token=res.data.token
  115. data.loginInfo={}
  116. data.loginInfo.token=token
  117. this.$store.commit('mutationswxOpenData', data);
  118. return false;
  119. }
  120. if(data.loginInfo){
  121. this.userInfo=data.loginInfo.openUser;
  122. this.wxOpenData=data.loginInfo;
  123. this.$store.commit('mutationswxOpenData', data)
  124. this.$store.commit('mutationsuserInfo', this.userInfo)
  125. this.list=[]
  126. this.getList()
  127. }
  128. })
  129. },
  130. },
  131. onReachBottom(){
  132. this.page++;
  133. this.getList()
  134. //console.log("shanglas")
  135. },
  136. onPullDownRefresh(){
  137. this.page=1;
  138. this.list=[];
  139. this.getList();
  140. setTimeout(() => {
  141. uni.stopPullDownRefresh(); // 关闭下拉刷新
  142. }, 2000);
  143. }
  144. }
  145. </script>
  146. <style scoped lang="less">
  147. .box {
  148. width: 100vw;
  149. min-height: 100vh;
  150. background: #F4F5F7;
  151. }
  152. .nickNameBox{
  153. display: flex;
  154. padding-top: 6rpx;
  155. }
  156. .nickName{
  157. font-weight: 400;
  158. color: #999999;
  159. font-size: 24rpx;
  160. line-height: 30rpx;
  161. padding-left: 10rpx;
  162. }
  163. .lineContLeftImg{
  164. width: 30rpx;
  165. height: 30rpx;
  166. margin-right: 10rpx;
  167. }
  168. .line{
  169. width: 702rpx;
  170. background: #FFFFFF;
  171. border-radius: 10rpx;
  172. margin-bottom: 20rpx;
  173. margin-left: 24rpx;
  174. }
  175. .linetop{
  176. display: flex;
  177. justify-content: space-between;
  178. font-size: 30rpx;
  179. padding: 20rpx;
  180. padding-bottom: 0;
  181. }
  182. .lineline{
  183. display: flex;
  184. justify-content: space-between;
  185. padding: 20rpx;
  186. font-weight: 400;
  187. color: #999999;
  188. font-size: 24rpx;
  189. line-height: 30rpx;
  190. }
  191. .lineContLeft{
  192. display: flex;
  193. }
  194. .name{
  195. font-weight: 500;
  196. color: #3C3C3C;
  197. }
  198. .amount{
  199. color: #FF0000;
  200. }
  201. .nickNameImg{
  202. width: 30rpx;
  203. height: 30rpx;
  204. }
  205. .authorizBox{
  206. width: 100vw;
  207. height: 100vh;
  208. background: rgba(0, 0, 0, 0.5);
  209. position: fixed;
  210. top: 0;
  211. left: 0;
  212. }
  213. .authorizCont{
  214. margin-top: 30vh;
  215. width: 564rpx;
  216. height: 408rpx;
  217. background: #FFFFFF;
  218. border-radius: 24rpx;
  219. margin-left: 93rpx;
  220. position: relative;
  221. }
  222. .authorizCloseImg{
  223. width: 62rpx;
  224. height: 62rpx;
  225. }
  226. .sqLogoBox{
  227. width: 180rpx;
  228. height: 180rpx;
  229. background: #FFFFFF;
  230. border-radius: 90rpx;
  231. text-align: center;
  232. position: absolute;
  233. top: -50rpx;
  234. left: 192rpx;
  235. }
  236. .authorizName{
  237. color: #333333;
  238. line-height: 42rpx;
  239. font-size: 30rpx;
  240. text-align: center;
  241. padding-top: 58rpx;
  242. }
  243. .authorizMs{
  244. color: #999999;
  245. line-height: 36rpx;
  246. font-size: 26rpx;
  247. width: 452rpx;
  248. padding-top: 24rpx;
  249. text-align: center;
  250. margin-left: 56rpx;
  251. }
  252. .authorizContbutton{
  253. width: 422rpx;
  254. height: 88rpx;
  255. background: #D53533;
  256. border-radius: 44rpx;
  257. line-height: 88rpx;
  258. text-align: center;
  259. font-size:30rpx;
  260. color: #FFFFFF;
  261. margin-top: 62rpx;
  262. margin-left:71rpx;
  263. }
  264. </style>