people.vue 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259
  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.loginInfo){
  108. this.userInfo=data.loginInfo.openUser;
  109. this.wxOpenData=data.loginInfo;
  110. this.$store.commit('mutationswxOpenData', data)
  111. this.$store.commit('mutationsuserInfo', this.userInfo)
  112. this.list=[]
  113. this.getList()
  114. }
  115. })
  116. },
  117. },
  118. onReachBottom(){
  119. this.page++;
  120. this.getList()
  121. //console.log("shanglas")
  122. },
  123. onPullDownRefresh(){
  124. this.page=1;
  125. this.list=[];
  126. this.getList();
  127. setTimeout(() => {
  128. uni.stopPullDownRefresh(); // 关闭下拉刷新
  129. }, 2000);
  130. }
  131. }
  132. </script>
  133. <style scoped lang="less">
  134. .box {
  135. width: 100vw;
  136. min-height: 100vh;
  137. background: #F4F5F7;
  138. }
  139. .nickNameBox{
  140. display: flex;
  141. padding-top: 6rpx;
  142. }
  143. .nickName{
  144. font-weight: 400;
  145. color: #999999;
  146. font-size: 24rpx;
  147. line-height: 30rpx;
  148. padding-left: 10rpx;
  149. }
  150. .lineContLeftImg{
  151. width: 30rpx;
  152. height: 30rpx;
  153. margin-right: 10rpx;
  154. }
  155. .line{
  156. width: 702rpx;
  157. background: #FFFFFF;
  158. border-radius: 10rpx;
  159. margin-bottom: 20rpx;
  160. margin-left: 24rpx;
  161. }
  162. .linetop{
  163. display: flex;
  164. justify-content: space-between;
  165. font-size: 30rpx;
  166. padding: 20rpx;
  167. padding-bottom: 0;
  168. }
  169. .lineline{
  170. display: flex;
  171. justify-content: space-between;
  172. padding: 20rpx;
  173. font-weight: 400;
  174. color: #999999;
  175. font-size: 24rpx;
  176. line-height: 30rpx;
  177. }
  178. .lineContLeft{
  179. display: flex;
  180. }
  181. .name{
  182. font-weight: 500;
  183. color: #3C3C3C;
  184. }
  185. .amount{
  186. color: #FF0000;
  187. }
  188. .nickNameImg{
  189. width: 30rpx;
  190. height: 30rpx;
  191. }
  192. .authorizBox{
  193. width: 100vw;
  194. height: 100vh;
  195. background: rgba(0, 0, 0, 0.5);
  196. position: fixed;
  197. top: 0;
  198. left: 0;
  199. }
  200. .authorizCont{
  201. margin-top: 30vh;
  202. width: 564rpx;
  203. height: 408rpx;
  204. background: #FFFFFF;
  205. border-radius: 24rpx;
  206. margin-left: 93rpx;
  207. position: relative;
  208. }
  209. .authorizCloseImg{
  210. width: 62rpx;
  211. height: 62rpx;
  212. }
  213. .sqLogoBox{
  214. width: 180rpx;
  215. height: 180rpx;
  216. background: #FFFFFF;
  217. border-radius: 90rpx;
  218. text-align: center;
  219. position: absolute;
  220. top: -50rpx;
  221. left: 192rpx;
  222. }
  223. .authorizName{
  224. color: #333333;
  225. line-height: 42rpx;
  226. font-size: 30rpx;
  227. text-align: center;
  228. padding-top: 58rpx;
  229. }
  230. .authorizMs{
  231. color: #999999;
  232. line-height: 36rpx;
  233. font-size: 26rpx;
  234. width: 452rpx;
  235. padding-top: 24rpx;
  236. text-align: center;
  237. margin-left: 56rpx;
  238. }
  239. .authorizContbutton{
  240. width: 422rpx;
  241. height: 88rpx;
  242. background: #D53533;
  243. border-radius: 44rpx;
  244. line-height: 88rpx;
  245. text-align: center;
  246. font-size:30rpx;
  247. color: #FFFFFF;
  248. margin-top: 62rpx;
  249. margin-left:71rpx;
  250. }
  251. </style>